OpenLexocad  27.1
Topo::WireTool Class Reference

Tools for creating, manipulating and querying Wires. More...

#include <WireTool.h>

Static Public Member Functions

static pWire projectWireOnPlane (const Geom::Pln &pln, pConstWire wire, double precision=Geom::Precision::linear_Resolution())
 Projects a wire onto a plane. Returns the new projected wire. More...
 
static bool projectPointOnWire (const Geom::Pnt &p, pConstWire wire, Geom::Pnt &nearest)
 Projects point 'p' on 'wire'. Returns the nearest solution point. More...
 
static bool projectPointOnWire (const Geom::Pnt &p, pConstWire wire, Geom::Pnt &nearest, Geom::Dir &refDirection)
 Projects point 'p' on 'wire'. Returns the nearest solution point and the reference (up) direction at that point. More...
 
static bool isPlanar (pConstWire wire, Geom::Pln &plane)
 Checks if the wire is planar. More...
 
static bool isClosed (pConstWire wire)
 Checks if the wire is closed. More...
 
static bool close (pWire wire, double precision=Geom::Precision::linear_Resolution())
 Closes the wire. More...
 
static pWire closed (pConstWire wire, double precision=Geom::Precision::linear_Resolution())
 Returns the closed wire. More...
 
static bool addEdge (pWire wire, pEdge edge, double precision=Geom::Precision::linear_Resolution())
 Adds an edge to the wire. More...
 
static bool addEdge (pWire wire, const std::vector< pEdge > &edges, double precision=Geom::Precision::linear_Resolution())
 Adds a vector of edges to a wire. More...
 
static bool addConstEdge (pWire wire, pConstEdge edge, double precision=Geom::Precision::linear_Resolution())
 Takes a const edge and copies it. The copy is added to the wire. More...
 
static bool addConstEdge (pWire wire, const std::vector< pEdge > &edges, double precision=Geom::Precision::linear_Resolution())
 Takes a vector of const edges and copies them. The copies are added to the wire. More...
 
static pWire addedEdge (pConstWire wire, pConstEdge edge, double precision=Geom::Precision::linear_Resolution())
 Returns the new wire with the added edge. More...
 
static pWire addedEdge (pConstWire wire, const std::vector< pConstEdge > &edges, double precision=Geom::Precision::linear_Resolution())
 Returns the new wire with the added edges. More...
 
static pConstVertex getClosestVertexToPoint (const Geom::Pnt &p, pConstWire wire)
 Returns the closest vertex from a point on a wire. Returns nullptr on failure. More...
 
static std::vector< pConstEdgegetClosestEdgesToPoint (const Geom::Pnt &p, pConstWire wire, double &distance, double tolerance=1E-06)
 Returns the closest edges from a point on a wire. More...
 
static std::vector< pConstEdgegetAdjacentEdgesToVertexOnWire (pConstVertex vertex, pConstWire wire)
 Returns the adjacent edges from a vertex on a wire. More...
 
static void getAdjacentEdgesToPointOnWire (const Geom::Pnt &point, pConstWire wire, std::vector< pConstEdge > &adjacentEdges)
 Get the adjacent edges from a point on a wire. More...
 
static pWire makeWire (const std::vector< pEdge > &edges, double precision=Geom::Precision::linear_Resolution())
 Makes a wire from edges. More...
 
static pWire makeWire (pEdge edges)
 Makes a wire one edges. More...
 
static pWire makeWire (pConstVertex vertex)
 
static std::vector< pWiremakeWires (const std::vector< pEdge > &edges, double precision=Geom::Precision::linear_Resolution())
 Makes (possibly sevaral) wires from edges. More...
 
static pWire copy (pConstWire wire)
 Copies a wire. More...
 
static pWire makePolygon (const std::vector< Geom::Pnt > &points)
 Makes an polygonal wire. More...
 
static pWire makePolyline (const std::vector< Geom::Pnt > &points)
 Makes a polyline wire (as opposed to makePoligon, the wire is not forced to be closed) More...
 
static std::vector< pConstEdgegetEdges (pConstWire wire)
 Returns the edges of a wire in a connection order. More...
 
static std::vector< pEdgegetEdgesCopy (pConstWire wire)
 Returns copy of the edges of a wire in a connection order. More...
 
static std::vector< pConstVertexgetVertices (pConstWire wire)
 Returns the vertices of a wire in a connection order. More...
 
static void getPoints (pConstWire wire, std::vector< Geom::Pnt > &pnts)
 Returns the points of a wire in a connection order. More...
 
static bool hasOnlyLines (pConstWire wire)
 Checks if all edges of the wire are lines. More...
 
static bool hasHelix (pConstWire wire)
 Checks if wire has at least one helix edge. More...
 
static bool fixReorder (pWire wire)
 Performs an analysis and reorders edges in the wire. More...
 
static void writeDbgInfo (pConstWire wire)
 Writes debug information of wire to stdout. More...
 
static Geom::Pnt getCentre (pConstWire wire)
 Returns centre of mass (centre of gravity) of the wire. More...
 
static bool filletWireAtVertex (pWire wire, const Geom::Pnt &p, double radius, double precision=Geom::Precision::linear_Resolution())
 Fillets a wire at the given vertex with the given radius. The give wire is modified in place. Returns TRUE if the operation is successful. More...
 
static bool chamferWireAtVertex (pWire wire, const Geom::Pnt &p, double offset, double precision=Geom::Precision::linear_Resolution())
 Chamfers a wire at the given vertex with the given offset. The give wire is modified in place. Returns TRUE if the operation is successful. More...
 
static bool removeEdgesFromWire (pWire wire, std::vector< pConstEdge > edges, double precision=Geom::Precision::linear_Resolution(), bool stayInBndBox=false)
 
static pWire transformed (pConstWire base, const Geom::Trsf &t)
 Creates a copy of the wire and transforms the copy. More...
 
static bool isSelfIntersecting (pConstWire wire)
 Check if the wire is self-intersecting. More...
 
static pWire createOffset (pConstWire wire, const Geom::Dir &refDirection, double offset)
 Create offset of wire. More...
 
static pWire reversed (pConstWire wire)
 Returns a reversed wire. More...
 
static pWire joined (pConstWire wire1, pConstWire wire2)
 Joins two wires at coincident vertices. Returns the joined wire. More...
 

Detailed Description

Tools for creating, manipulating and querying Wires.

Member Function Documentation

◆ addConstEdge() [1/2]

static bool Topo::WireTool::addConstEdge ( pWire  wire,
pConstEdge  edge,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Takes a const edge and copies it. The copy is added to the wire.

◆ addConstEdge() [2/2]

static bool Topo::WireTool::addConstEdge ( pWire  wire,
const std::vector< pEdge > &  edges,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Takes a vector of const edges and copies them. The copies are added to the wire.

◆ addedEdge() [1/2]

static pWire Topo::WireTool::addedEdge ( pConstWire  wire,
pConstEdge  edge,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Returns the new wire with the added edge.

◆ addedEdge() [2/2]

static pWire Topo::WireTool::addedEdge ( pConstWire  wire,
const std::vector< pConstEdge > &  edges,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Returns the new wire with the added edges.

◆ addEdge() [1/2]

static bool Topo::WireTool::addEdge ( pWire  wire,
pEdge  edge,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Adds an edge to the wire.

◆ addEdge() [2/2]

static bool Topo::WireTool::addEdge ( pWire  wire,
const std::vector< pEdge > &  edges,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Adds a vector of edges to a wire.

◆ chamferWireAtVertex()

static bool Topo::WireTool::chamferWireAtVertex ( pWire  wire,
const Geom::Pnt p,
double  offset,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Chamfers a wire at the given vertex with the given offset. The give wire is modified in place. Returns TRUE if the operation is successful.

◆ close()

static bool Topo::WireTool::close ( pWire  wire,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Closes the wire.

◆ closed()

static pWire Topo::WireTool::closed ( pConstWire  wire,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Returns the closed wire.

◆ copy()

static pWire Topo::WireTool::copy ( pConstWire  wire)
static

Copies a wire.

◆ createOffset()

static pWire Topo::WireTool::createOffset ( pConstWire  wire,
const Geom::Dir refDirection,
double  offset 
)
static

Create offset of wire.

◆ filletWireAtVertex()

static bool Topo::WireTool::filletWireAtVertex ( pWire  wire,
const Geom::Pnt p,
double  radius,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Fillets a wire at the given vertex with the given radius. The give wire is modified in place. Returns TRUE if the operation is successful.

◆ fixReorder()

static bool Topo::WireTool::fixReorder ( pWire  wire)
static

Performs an analysis and reorders edges in the wire.

◆ getAdjacentEdgesToPointOnWire()

static void Topo::WireTool::getAdjacentEdgesToPointOnWire ( const Geom::Pnt point,
pConstWire  wire,
std::vector< pConstEdge > &  adjacentEdges 
)
static

Get the adjacent edges from a point on a wire.

◆ getAdjacentEdgesToVertexOnWire()

static std::vector<pConstEdge> Topo::WireTool::getAdjacentEdgesToVertexOnWire ( pConstVertex  vertex,
pConstWire  wire 
)
static

Returns the adjacent edges from a vertex on a wire.

◆ getCentre()

static Geom::Pnt Topo::WireTool::getCentre ( pConstWire  wire)
static

Returns centre of mass (centre of gravity) of the wire.

◆ getClosestEdgesToPoint()

static std::vector<pConstEdge> Topo::WireTool::getClosestEdgesToPoint ( const Geom::Pnt p,
pConstWire  wire,
double &  distance,
double  tolerance = 1E-06 
)
static

Returns the closest edges from a point on a wire.

◆ getClosestVertexToPoint()

static pConstVertex Topo::WireTool::getClosestVertexToPoint ( const Geom::Pnt p,
pConstWire  wire 
)
static

Returns the closest vertex from a point on a wire. Returns nullptr on failure.

◆ getEdges()

static std::vector<pConstEdge> Topo::WireTool::getEdges ( pConstWire  wire)
static

Returns the edges of a wire in a connection order.

◆ getEdgesCopy()

static std::vector<pEdge> Topo::WireTool::getEdgesCopy ( pConstWire  wire)
static

Returns copy of the edges of a wire in a connection order.

◆ getPoints()

static void Topo::WireTool::getPoints ( pConstWire  wire,
std::vector< Geom::Pnt > &  pnts 
)
static

Returns the points of a wire in a connection order.

◆ getVertices()

static std::vector<pConstVertex> Topo::WireTool::getVertices ( pConstWire  wire)
static

Returns the vertices of a wire in a connection order.

◆ hasHelix()

static bool Topo::WireTool::hasHelix ( pConstWire  wire)
static

Checks if wire has at least one helix edge.

◆ hasOnlyLines()

static bool Topo::WireTool::hasOnlyLines ( pConstWire  wire)
static

Checks if all edges of the wire are lines.

◆ isClosed()

static bool Topo::WireTool::isClosed ( pConstWire  wire)
static

Checks if the wire is closed.

◆ isPlanar()

static bool Topo::WireTool::isPlanar ( pConstWire  wire,
Geom::Pln plane 
)
static

Checks if the wire is planar.

◆ isSelfIntersecting()

static bool Topo::WireTool::isSelfIntersecting ( pConstWire  wire)
static

Check if the wire is self-intersecting.

◆ joined()

static pWire Topo::WireTool::joined ( pConstWire  wire1,
pConstWire  wire2 
)
static

Joins two wires at coincident vertices. Returns the joined wire.

◆ makePolygon()

static pWire Topo::WireTool::makePolygon ( const std::vector< Geom::Pnt > &  points)
static

Makes an polygonal wire.

◆ makePolyline()

static pWire Topo::WireTool::makePolyline ( const std::vector< Geom::Pnt > &  points)
static

Makes a polyline wire (as opposed to makePoligon, the wire is not forced to be closed)

◆ makeWire() [1/3]

static pWire Topo::WireTool::makeWire ( const std::vector< pEdge > &  edges,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Makes a wire from edges.

◆ makeWire() [2/3]

static pWire Topo::WireTool::makeWire ( pEdge  edges)
static

Makes a wire one edges.

◆ makeWire() [3/3]

static pWire Topo::WireTool::makeWire ( pConstVertex  vertex)
static

Makes a wire one vertex - SB please note that in Acis this is perfectly legal (some Acis functions work with wires, for example, and a wire can be created from a vertex too).

◆ makeWires()

static std::vector<pWire> Topo::WireTool::makeWires ( const std::vector< pEdge > &  edges,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Makes (possibly sevaral) wires from edges.

◆ projectPointOnWire() [1/2]

static bool Topo::WireTool::projectPointOnWire ( const Geom::Pnt p,
pConstWire  wire,
Geom::Pnt nearest 
)
static

Projects point 'p' on 'wire'. Returns the nearest solution point.

◆ projectPointOnWire() [2/2]

static bool Topo::WireTool::projectPointOnWire ( const Geom::Pnt p,
pConstWire  wire,
Geom::Pnt nearest,
Geom::Dir refDirection 
)
static

Projects point 'p' on 'wire'. Returns the nearest solution point and the reference (up) direction at that point.

◆ projectWireOnPlane()

static pWire Topo::WireTool::projectWireOnPlane ( const Geom::Pln pln,
pConstWire  wire,
double  precision = Geom::Precision::linear_Resolution() 
)
static

Projects a wire onto a plane. Returns the new projected wire.

◆ removeEdgesFromWire()

static bool Topo::WireTool::removeEdgesFromWire ( pWire  wire,
std::vector< pConstEdge edges,
double  precision = Geom::Precision::linear_Resolution(),
bool  stayInBndBox = false 
)
static

Remove edges from a wire. The neighboring edges are extended naturally to fill the gap caused to the removal of wire edges. The edges must belong to the wire.

◆ reversed()

static pWire Topo::WireTool::reversed ( pConstWire  wire)
static

Returns a reversed wire.

◆ transformed()

static pWire Topo::WireTool::transformed ( pConstWire  base,
const Geom::Trsf t 
)
static

Creates a copy of the wire and transforms the copy.

◆ writeDbgInfo()

static void Topo::WireTool::writeDbgInfo ( pConstWire  wire)
static

Writes debug information of wire to stdout.


The documentation for this class was generated from the following file: