Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
ShapeAnalysis_Wire Class Reference

This class provides analysis of a wire to be compliant to CAS.CADE requirements. More...

#include <ShapeAnalysis_Wire.hxx>

Inheritance diagram for ShapeAnalysis_Wire:
Inheritance graph
[legend]

Public Member Functions

 ShapeAnalysis_Wire ()
 Empty constructor.
 
 ShapeAnalysis_Wire (const TopoDS_Wire &wire, const TopoDS_Face &face, const double precision)
 Creates object with standard TopoDS_Wire, face and precision.
 
 ShapeAnalysis_Wire (const occ::handle< ShapeExtend_WireData > &sbwd, const TopoDS_Face &face, const double precision)
 Creates the object with WireData object, face and precision.
 
void Init (const TopoDS_Wire &wire, const TopoDS_Face &face, const double precision)
 Initializes the object with standard TopoDS_Wire, face and precision.
 
void Init (const occ::handle< ShapeExtend_WireData > &sbwd, const TopoDS_Face &face, const double precision)
 Initializes the object with WireData object, face and precision.
 
void Load (const TopoDS_Wire &wire)
 Loads the object with standard TopoDS_Wire.
 
void Load (const occ::handle< ShapeExtend_WireData > &sbwd)
 Loads the object with WireData object.
 
void SetFace (const TopoDS_Face &face)
 Loads the face the wire lies on.
 
void SetFace (const TopoDS_Face &theFace, const occ::handle< ShapeAnalysis_Surface > &theSurfaceAnalysis)
 Loads the face the wire lies on and surface analysis object.
 
void SetSurface (const occ::handle< ShapeAnalysis_Surface > &theSurfaceAnalysis)
 Loads the surface analysis object.
 
void SetSurface (const occ::handle< Geom_Surface > &surface)
 Loads the surface the wire lies on.
 
void SetSurface (const occ::handle< Geom_Surface > &surface, const TopLoc_Location &location)
 Loads the surface the wire lies on.
 
void SetPrecision (const double precision)
 
void ClearStatuses ()
 Unsets all the status and distance fields wire, face and precision are not cleared.
 
bool IsLoaded () const
 Returns True if wire is loaded and has number of edges >0.
 
bool IsReady () const
 Returns True if IsLoaded and underlying face is not null.
 
double Precision () const
 Returns the value of precision.
 
const occ::handle< ShapeExtend_WireData > & WireData () const
 Returns wire object being analyzed.
 
int NbEdges () const
 Returns the number of edges in the wire, or 0 if it is not loaded.
 
const TopoDS_FaceFace () const
 Returns the working face.
 
const occ::handle< ShapeAnalysis_Surface > & Surface () const
 Returns the working surface.
 
bool Perform ()
 Performs all the checks in the following order : CheckOrder, CheckSmall, CheckConnected, CheckEdgeCurves, CheckDegenerated, CheckSelfIntersection, CheckLacking, CheckClosed Returns: True if at least one method returned True; For deeper analysis use Status...(status) methods.
 
bool CheckOrder (const bool isClosed=true, const bool mode3d=true)
 Calls CheckOrder and returns False if wire is already ordered (tail-to-head), True otherwise Flag <isClosed> defines if the wire is closed or not Flag <mode3d> defines which mode is used (3d or 2d)
 
bool CheckConnected (const double prec=0.0)
 Calls to CheckConnected for each edge Returns: True if at least one pair of disconnected edges (not sharing the same vertex) was detected.
 
bool CheckSmall (const double precsmall=0.0)
 Calls to CheckSmall for each edge Returns: True if at least one small edge was detected.
 
bool CheckEdgeCurves ()
 Checks edges geometry (consistency of 2d and 3d senses, adjasment of curves to the vertices, etc.). The order of the checks : Call ShapeAnalysis_Wire to check: ShapeAnalysis_Edge::CheckCurve3dWithPCurve (1), ShapeAnalysis_Edge::CheckVertcesWithPCurve (2), ShapeAnalysis_Edge::CheckVertcesWithCurve3d (3), CheckSeam (4) Additional: CheckGap3d (5), CheckGap2d (6), ShapeAnalysis_Edge::CheckSameParameter (7) Returns: True if at least one check returned True Remark: The numbers in brackets show with what DONEi or FAILi the status can be queried.
 
bool CheckDegenerated ()
 Calls to CheckDegenerated for each edge Returns: True if at least one incorrect degenerated edge was detected.
 
bool CheckClosed (const double prec=0.0)
 Checks if wire is closed, performs CheckConnected, CheckDegenerated and CheckLacking for the first and the last edges Returns: True if at least one check returned True Status: FAIL1 or DONE1: see CheckConnected FAIL2 or DONE2: see CheckDegenerated.
 
bool CheckSelfIntersection ()
 Checks self-intersection of the wire (considering pcurves) Looks for self-intersecting edges and each pair of intersecting edges. Warning: It does not check each edge with any other one (only each two adjacent edges) The order of the checks : CheckSelfIntersectingEdge, CheckIntersectingEdges Returns: True if at least one check returned True Status: FAIL1 or DONE1 - see CheckSelfIntersectingEdge FAIL2 or DONE2 - see CheckIntersectingEdges.
 
bool CheckLacking ()
 Calls to CheckLacking for each edge Returns: True if at least one lacking edge was detected.
 
bool CheckGaps3d ()
 
bool CheckGaps2d ()
 
bool CheckCurveGaps ()
 
bool CheckOrder (ShapeAnalysis_WireOrder &sawo, bool isClosed=true, bool theMode3D=true, bool theModeBoth=false)
 Analyzes the order of the edges in the wire, uses class WireOrder for that purpose. Flag <isClosed> defines if the wire is closed or not Flag <theMode3D> defines 3D or 2d mode. Flag <theModeBoth> defines miscible mode and the flag <theMode3D> is ignored. Returns False if wire is already ordered (tail-to-head), True otherwise. Use returned WireOrder object for deeper analysis. Status: OK : the same edges orientation, the same edges sequence DONE1: the same edges orientation, not the same edges sequence DONE2: as DONE1 and gaps more than myPrecision DONE3: not the same edges orientation (some need to be reversed) DONE4: as DONE3 and gaps more than myPrecision FAIL : algorithm failed (could not detect order)
 
bool CheckConnected (const int num, const double prec=0.0)
 Checks connected edges (num-th and preceding). Tests with starting preci from <SBWD> or with <prec> if it is greater. Considers Vertices. Returns: False if edges are connected by the common vertex, else True Status : OK : Vertices (end of num-1 th edge and start on num-th one) are already the same DONE1 : Absolutely confused (gp::Resolution) DONE2 : Confused at starting <preci> from <SBWD> DONE3 : Confused at <prec> but not <preci> FAIL1 : Not confused FAIL2 : Not confused but confused with <preci> if reverse num-th edge.
 
bool CheckSmall (const int num, const double precsmall=0.0)
 Checks if an edge has a length not greater than myPreci or precsmall (if it is smaller) Returns: False if its length is greater than precision Status: OK : edge is not small or degenerated DONE1: edge is small, vertices are the same DONE2: edge is small, vertices are not the same FAIL : no 3d curve and pcurve.
 
bool CheckSeam (const int num, occ::handle< Geom2d_Curve > &C1, occ::handle< Geom2d_Curve > &C2, double &cf, double &cl)
 Checks if a seam pcurves are correct oriented Returns: False (status OK) if given edge is not a seam or if it is OK C1 - current pcurve for FORWARD edge, C2 - current pcurve for REVERSED edge (if returns True they should be swapped for the seam), cf, cl - first and last parameters on curves Status: OK : Pcurves are correct or edge is not seam DONE : Seam pcurves should be swapped.
 
bool CheckSeam (const int num)
 Checks if a seam pcurves are correct oriented See previous functions for details.
 
bool CheckDegenerated (const int num, gp_Pnt2d &dgnr1, gp_Pnt2d &dgnr2)
 Checks for degenerated edge between two adjacent ones. Fills parameters dgnr1 and dgnr2 with points in parametric space that correspond to the singularity (either gap that needs to be filled by degenerated edge or that already filled) Returns: False if no singularity or edge is already degenerated, otherwise True Status: OK : No surface singularity, or edge is already degenerated DONE1: Degenerated edge should be inserted (gap in 2D) DONE2: Edge <num> should be made degenerated (recompute pcurve and set the flag) FAIL1: One of edges neighbouring to degenerated one has no pcurve FAIL2: Edge marked as degenerated and has no pcurve but singularity is not detected.
 
bool CheckDegenerated (const int num)
 Checks for degenerated edge between two adjacent ones. Remark : Calls previous function Status : See the function above for details.
 
bool CheckGap3d (const int num=0)
 Checks gap between edges in 3D (3d curves). Checks the distance between ends of 3d curves of the num-th and preceding edge. The distance can be queried by MinDistance3d.
 
bool CheckGap2d (const int num=0)
 Checks gap between edges in 2D (pcurves). Checks the distance between ends of pcurves of the num-th and preceding edge. The distance can be queried by MinDistance2d.
 
bool CheckCurveGap (const int num=0)
 Checks gap between points on 3D curve and points on surface generated by pcurve of the num-th edge. The distance can be queried by MinDistance3d.
 
bool CheckSelfIntersectingEdge (const int num, NCollection_Sequence< IntRes2d_IntersectionPoint > &points2d, NCollection_Sequence< gp_Pnt > &points3d)
 Checks if num-th edge is self-intersecting. Self-intersection is reported only if intersection point lies outside of both end vertices of the edge. Returns: True if edge is self-intersecting. If returns True it also fills the sequences of intersection points and corresponding 3d points (only that are not enclosed by a vertices) Status: FAIL1 : No pcurve FAIL2 : No vertices DONE1 : Self-intersection found.
 
bool CheckSelfIntersectingEdge (const int num)
 
bool CheckIntersectingEdges (const int num, NCollection_Sequence< IntRes2d_IntersectionPoint > &points2d, NCollection_Sequence< gp_Pnt > &points3d, NCollection_Sequence< double > &errors)
 Checks two adjacent edges for intersecting. Intersection is reported only if intersection point is not enclosed by the common end vertex of the edges. Returns: True if intersection is found. If returns True it also fills the sequences of intersection points, corresponding 3d points, and errors for them (half-distances between intersection points in 3d calculated from one and from another edge) Status: FAIL1 : No pcurve FAIL2 : No vertices DONE1 : Self-intersection found.
 
bool CheckIntersectingEdges (const int num)
 Checks two adjacent edges for intersecting. Remark : Calls the previous method Status : See the function above for details.
 
bool CheckIntersectingEdges (const int num1, const int num2, NCollection_Sequence< IntRes2d_IntersectionPoint > &points2d, NCollection_Sequence< gp_Pnt > &points3d, NCollection_Sequence< double > &errors)
 Checks i-th and j-th edges for intersecting. Remark : See the previous method for details.
 
bool CheckIntersectingEdges (const int num1, const int num2)
 Checks i-th and j-th edges for intersecting. Remark : Calls previous method. Status : See the function above for details.
 
bool CheckLacking (const int num, const double Tolerance, gp_Pnt2d &p2d1, gp_Pnt2d &p2d2)
 Checks if there is a gap in 2d between edges, not comprised by the tolerance of their common vertex. If <Tolerance> is greater than 0. and less than tolerance of the vertex, then this value is used for check. Returns: True if not closed gap was detected p2d1 and p2d2 are the endpoint of <num-1>th edge and start of the <num>th edge in 2d. Status: OK: No edge is lacking (3d and 2d connection) FAIL1: edges have no vertices (at least one of them) FAIL2: edges are neither connected by common vertex, nor have coincided vertices FAIL1: edges have no pcurves DONE1: the gap is detected which cannot be closed by the tolerance of the common vertex (or with value of <Tolerance>) DONE2: is set (together with DONE1) if gap is detected and the vector (p2d2 - p2d1) goes in direction opposite to the pcurves of the edges (if angle is more than 0.9*PI).
 
bool CheckLacking (const int num, const double Tolerance=0.0)
 Checks if there is a gap in 2D between edges and not comprised by vertex tolerance The value of SBWD.thepreci is used. Returns: False if no edge should be inserted Status: OK : No edge is lacking (3d and 2d connection) DONE1 : The vertex tolerance should be increased only (2d gap is small) DONE2 : Edge can be inserted (3d and 2d gaps are large enough)
 
bool CheckOuterBound (const bool APIMake=true)
 Checks if wire defines an outer bound on the face Uses ShapeAnalysis::IsOuterBound for analysis If <APIMake> is True uses BRepAPI_MakeWire to build the wire, if False (to be used only when edges share common vertices) uses BRep_Builder to build the wire.
 
bool CheckNotchedEdges (const int num, int &shortNum, double &param, const double Tolerance=0.0)
 Detects a notch.
 
bool CheckSmallArea (const TopoDS_Wire &theWire)
 Checks if wire has parametric area less than precision.
 
bool CheckShapeConnect (const TopoDS_Shape &shape, const double prec=0.0)
 Checks with what orientation <shape> (wire or edge) can be connected to the wire. Tests distances with starting <preci> from <SBWD> (close confusion), but if given <prec> is greater, tests with <prec> (coarse confusion). The smallest found distance can be returned by MinDistance3d.
 
bool CheckShapeConnect (double &tailhead, double &tailtail, double &headtail, double &headhead, const TopoDS_Shape &shape, const double prec=0.0)
 The same as previous CheckShapeConnect but is more advanced. It returns the distances between each end of <sbwd> and each end of <shape>. For example, <tailhead> stores distance between tail of <sbwd> and head of <shape> Remark: First method CheckShapeConnect calls this one.
 
bool CheckLoop (NCollection_IndexedMap< TopoDS_Shape, TopTools_ShapeMapHasher > &aMapLoopVertices, NCollection_DataMap< TopoDS_Shape, NCollection_List< TopoDS_Shape >, TopTools_ShapeMapHasher > &aMapVertexEdges, NCollection_Map< TopoDS_Shape, TopTools_ShapeMapHasher > &aMapSmallEdges, NCollection_Map< TopoDS_Shape, TopTools_ShapeMapHasher > &aMapSeemEdges)
 Checks existence of loop on wire and return vertices which are loop vertices (vertices belonging to a few pairs of edges)
 
bool CheckTail (const TopoDS_Edge &theEdge1, const TopoDS_Edge &theEdge2, const double theMaxSine, const double theMaxWidth, const double theMaxTolerance, TopoDS_Edge &theEdge11, TopoDS_Edge &theEdge12, TopoDS_Edge &theEdge21, TopoDS_Edge &theEdge22)
 
bool StatusOrder (const ShapeExtend_Status Status) const
 
bool StatusConnected (const ShapeExtend_Status Status) const
 
bool StatusEdgeCurves (const ShapeExtend_Status Status) const
 
bool StatusDegenerated (const ShapeExtend_Status Status) const
 
bool StatusClosed (const ShapeExtend_Status Status) const
 
bool StatusSmall (const ShapeExtend_Status Status) const
 
bool StatusSelfIntersection (const ShapeExtend_Status Status) const
 
bool StatusLacking (const ShapeExtend_Status Status) const
 
bool StatusGaps3d (const ShapeExtend_Status Status) const
 
bool StatusGaps2d (const ShapeExtend_Status Status) const
 
bool StatusCurveGaps (const ShapeExtend_Status Status) const
 
bool StatusLoop (const ShapeExtend_Status Status) const
 
bool LastCheckStatus (const ShapeExtend_Status Status) const
 Querying the status of the LAST performed 'Advanced' checking procedure.
 
double MinDistance3d () const
 Returns the last lowest distance in 3D computed by CheckOrientation, CheckConnected, CheckContinuity3d, CheckVertex, CheckNewVertex.
 
double MinDistance2d () const
 Returns the last lowest distance in 2D-UV computed by CheckContinuity2d.
 
double MaxDistance3d () const
 Returns the last maximal distance in 3D computed by CheckOrientation, CheckConnected, CheckContinuity3d, CheckVertex, CheckNewVertex, CheckSameParameter.
 
double MaxDistance2d () const
 Returns the last maximal distance in 2D-UV computed by CheckContinuity2d.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
bool IsKind (const char *const theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Protected Attributes

occ::handle< ShapeExtend_WireDatamyWire
 
TopoDS_Face myFace
 
occ::handle< ShapeAnalysis_SurfacemySurf
 
double myPrecision
 
double myMin3d
 
double myMin2d
 
double myMax3d
 
double myMax2d
 
int myStatusOrder
 
int myStatusConnected
 
int myStatusEdgeCurves
 
int myStatusDegenerated
 
int myStatusClosed
 
int myStatusSmall
 
int myStatusSelfIntersection
 
int myStatusLacking
 
int myStatusGaps3d
 
int myStatusGaps2d
 
int myStatusCurveGaps
 
int myStatusLoop
 
int myStatus
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Detailed Description

This class provides analysis of a wire to be compliant to CAS.CADE requirements.

The functionalities provided are the following:

  1. consistency of 2d and 3d edge curve senses
  2. connection of adjacent edges regarding to: a. their vertices b. their pcurves c. their 3d curves
  3. adjacency of the edge vertices to its pcurve and 3d curve
  4. if a wire is closed or not (considering its 3d and 2d contour)
  5. if a wire is outer on its face (considering pcurves)

This class can be used in conjunction with class ShapeFix_Wire, which will fix the problems detected by this class.

The methods of the given class match to ones of the class ShapeFix_Wire, e.g., CheckSmall and FixSmall. This class also includes some auxiliary methods (e.g., CheckOuterBound, etc.), which have no pair in ShapeFix_Wire.

Like methods of ShapeFix_Wire the ones of this class are grouped into two levels:

For analyzing result of Public API checking methods use corresponding Status... method. The 'advanced' functions share the single status field which contains the result of the last performed 'advanced' method. It is queried by the method LastCheckStatus().

In order to prepare an analyzer, it is necessary to load a wire, set face and precision.

Constructor & Destructor Documentation

◆ ShapeAnalysis_Wire() [1/3]

ShapeAnalysis_Wire::ShapeAnalysis_Wire ( )

Empty constructor.

◆ ShapeAnalysis_Wire() [2/3]

ShapeAnalysis_Wire::ShapeAnalysis_Wire ( const TopoDS_Wire & wire,
const TopoDS_Face & face,
const double precision )

Creates object with standard TopoDS_Wire, face and precision.

◆ ShapeAnalysis_Wire() [3/3]

ShapeAnalysis_Wire::ShapeAnalysis_Wire ( const occ::handle< ShapeExtend_WireData > & sbwd,
const TopoDS_Face & face,
const double precision )

Creates the object with WireData object, face and precision.

Member Function Documentation

◆ CheckClosed()

bool ShapeAnalysis_Wire::CheckClosed ( const double prec = 0.0)

Checks if wire is closed, performs CheckConnected, CheckDegenerated and CheckLacking for the first and the last edges Returns: True if at least one check returned True Status: FAIL1 or DONE1: see CheckConnected FAIL2 or DONE2: see CheckDegenerated.

◆ CheckConnected() [1/2]

bool ShapeAnalysis_Wire::CheckConnected ( const double prec = 0.0)

Calls to CheckConnected for each edge Returns: True if at least one pair of disconnected edges (not sharing the same vertex) was detected.

◆ CheckConnected() [2/2]

bool ShapeAnalysis_Wire::CheckConnected ( const int num,
const double prec = 0.0 )

Checks connected edges (num-th and preceding). Tests with starting preci from <SBWD> or with <prec> if it is greater. Considers Vertices. Returns: False if edges are connected by the common vertex, else True Status : OK : Vertices (end of num-1 th edge and start on num-th one) are already the same DONE1 : Absolutely confused (gp::Resolution) DONE2 : Confused at starting <preci> from <SBWD> DONE3 : Confused at <prec> but not <preci> FAIL1 : Not confused FAIL2 : Not confused but confused with <preci> if reverse num-th edge.

◆ CheckCurveGap()

bool ShapeAnalysis_Wire::CheckCurveGap ( const int num = 0)

Checks gap between points on 3D curve and points on surface generated by pcurve of the num-th edge. The distance can be queried by MinDistance3d.

Returns: True if status is DONE Status: OK : Gap is less than myPrecision DONE : Gap is greater than myPrecision FAIL : No 3d curve(s) on the edge(s)

◆ CheckCurveGaps()

bool ShapeAnalysis_Wire::CheckCurveGaps ( )

◆ CheckDegenerated() [1/3]

bool ShapeAnalysis_Wire::CheckDegenerated ( )

Calls to CheckDegenerated for each edge Returns: True if at least one incorrect degenerated edge was detected.

◆ CheckDegenerated() [2/3]

bool ShapeAnalysis_Wire::CheckDegenerated ( const int num)

Checks for degenerated edge between two adjacent ones. Remark : Calls previous function Status : See the function above for details.

◆ CheckDegenerated() [3/3]

bool ShapeAnalysis_Wire::CheckDegenerated ( const int num,
gp_Pnt2d & dgnr1,
gp_Pnt2d & dgnr2 )

Checks for degenerated edge between two adjacent ones. Fills parameters dgnr1 and dgnr2 with points in parametric space that correspond to the singularity (either gap that needs to be filled by degenerated edge or that already filled) Returns: False if no singularity or edge is already degenerated, otherwise True Status: OK : No surface singularity, or edge is already degenerated DONE1: Degenerated edge should be inserted (gap in 2D) DONE2: Edge <num> should be made degenerated (recompute pcurve and set the flag) FAIL1: One of edges neighbouring to degenerated one has no pcurve FAIL2: Edge marked as degenerated and has no pcurve but singularity is not detected.

◆ CheckEdgeCurves()

bool ShapeAnalysis_Wire::CheckEdgeCurves ( )

Checks edges geometry (consistency of 2d and 3d senses, adjasment of curves to the vertices, etc.). The order of the checks : Call ShapeAnalysis_Wire to check: ShapeAnalysis_Edge::CheckCurve3dWithPCurve (1), ShapeAnalysis_Edge::CheckVertcesWithPCurve (2), ShapeAnalysis_Edge::CheckVertcesWithCurve3d (3), CheckSeam (4) Additional: CheckGap3d (5), CheckGap2d (6), ShapeAnalysis_Edge::CheckSameParameter (7) Returns: True if at least one check returned True Remark: The numbers in brackets show with what DONEi or FAILi the status can be queried.

◆ CheckGap2d()

bool ShapeAnalysis_Wire::CheckGap2d ( const int num = 0)

Checks gap between edges in 2D (pcurves). Checks the distance between ends of pcurves of the num-th and preceding edge. The distance can be queried by MinDistance2d.

Returns: True if status is DONE Status: OK : Gap is less than parametric precision out of myPrecision DONE : Gap is greater than parametric precision out of myPrecision FAIL : No pcurve(s) on the edge(s)

◆ CheckGap3d()

bool ShapeAnalysis_Wire::CheckGap3d ( const int num = 0)

Checks gap between edges in 3D (3d curves). Checks the distance between ends of 3d curves of the num-th and preceding edge. The distance can be queried by MinDistance3d.

Returns: True if status is DONE Status: OK : Gap is less than myPrecision DONE : Gap is greater than myPrecision FAIL : No 3d curve(s) on the edge(s)

◆ CheckGaps2d()

bool ShapeAnalysis_Wire::CheckGaps2d ( )

◆ CheckGaps3d()

bool ShapeAnalysis_Wire::CheckGaps3d ( )

◆ CheckIntersectingEdges() [1/4]

bool ShapeAnalysis_Wire::CheckIntersectingEdges ( const int num)

Checks two adjacent edges for intersecting. Remark : Calls the previous method Status : See the function above for details.

◆ CheckIntersectingEdges() [2/4]

bool ShapeAnalysis_Wire::CheckIntersectingEdges ( const int num,
NCollection_Sequence< IntRes2d_IntersectionPoint > & points2d,
NCollection_Sequence< gp_Pnt > & points3d,
NCollection_Sequence< double > & errors )

Checks two adjacent edges for intersecting. Intersection is reported only if intersection point is not enclosed by the common end vertex of the edges. Returns: True if intersection is found. If returns True it also fills the sequences of intersection points, corresponding 3d points, and errors for them (half-distances between intersection points in 3d calculated from one and from another edge) Status: FAIL1 : No pcurve FAIL2 : No vertices DONE1 : Self-intersection found.

◆ CheckIntersectingEdges() [3/4]

bool ShapeAnalysis_Wire::CheckIntersectingEdges ( const int num1,
const int num2 )

Checks i-th and j-th edges for intersecting. Remark : Calls previous method. Status : See the function above for details.

◆ CheckIntersectingEdges() [4/4]

bool ShapeAnalysis_Wire::CheckIntersectingEdges ( const int num1,
const int num2,
NCollection_Sequence< IntRes2d_IntersectionPoint > & points2d,
NCollection_Sequence< gp_Pnt > & points3d,
NCollection_Sequence< double > & errors )

Checks i-th and j-th edges for intersecting. Remark : See the previous method for details.

◆ CheckLacking() [1/3]

bool ShapeAnalysis_Wire::CheckLacking ( )

Calls to CheckLacking for each edge Returns: True if at least one lacking edge was detected.

◆ CheckLacking() [2/3]

bool ShapeAnalysis_Wire::CheckLacking ( const int num,
const double Tolerance,
gp_Pnt2d & p2d1,
gp_Pnt2d & p2d2 )

Checks if there is a gap in 2d between edges, not comprised by the tolerance of their common vertex. If <Tolerance> is greater than 0. and less than tolerance of the vertex, then this value is used for check. Returns: True if not closed gap was detected p2d1 and p2d2 are the endpoint of <num-1>th edge and start of the <num>th edge in 2d. Status: OK: No edge is lacking (3d and 2d connection) FAIL1: edges have no vertices (at least one of them) FAIL2: edges are neither connected by common vertex, nor have coincided vertices FAIL1: edges have no pcurves DONE1: the gap is detected which cannot be closed by the tolerance of the common vertex (or with value of <Tolerance>) DONE2: is set (together with DONE1) if gap is detected and the vector (p2d2 - p2d1) goes in direction opposite to the pcurves of the edges (if angle is more than 0.9*PI).

◆ CheckLacking() [3/3]

bool ShapeAnalysis_Wire::CheckLacking ( const int num,
const double Tolerance = 0.0 )

Checks if there is a gap in 2D between edges and not comprised by vertex tolerance The value of SBWD.thepreci is used. Returns: False if no edge should be inserted Status: OK : No edge is lacking (3d and 2d connection) DONE1 : The vertex tolerance should be increased only (2d gap is small) DONE2 : Edge can be inserted (3d and 2d gaps are large enough)

◆ CheckLoop()

Checks existence of loop on wire and return vertices which are loop vertices (vertices belonging to a few pairs of edges)

◆ CheckNotchedEdges()

bool ShapeAnalysis_Wire::CheckNotchedEdges ( const int num,
int & shortNum,
double & param,
const double Tolerance = 0.0 )

Detects a notch.

◆ CheckOrder() [1/2]

bool ShapeAnalysis_Wire::CheckOrder ( const bool isClosed = true,
const bool mode3d = true )

Calls CheckOrder and returns False if wire is already ordered (tail-to-head), True otherwise Flag <isClosed> defines if the wire is closed or not Flag <mode3d> defines which mode is used (3d or 2d)

◆ CheckOrder() [2/2]

bool ShapeAnalysis_Wire::CheckOrder ( ShapeAnalysis_WireOrder & sawo,
bool isClosed = true,
bool theMode3D = true,
bool theModeBoth = false )

Analyzes the order of the edges in the wire, uses class WireOrder for that purpose. Flag <isClosed> defines if the wire is closed or not Flag <theMode3D> defines 3D or 2d mode. Flag <theModeBoth> defines miscible mode and the flag <theMode3D> is ignored. Returns False if wire is already ordered (tail-to-head), True otherwise. Use returned WireOrder object for deeper analysis. Status: OK : the same edges orientation, the same edges sequence DONE1: the same edges orientation, not the same edges sequence DONE2: as DONE1 and gaps more than myPrecision DONE3: not the same edges orientation (some need to be reversed) DONE4: as DONE3 and gaps more than myPrecision FAIL : algorithm failed (could not detect order)

◆ CheckOuterBound()

bool ShapeAnalysis_Wire::CheckOuterBound ( const bool APIMake = true)

Checks if wire defines an outer bound on the face Uses ShapeAnalysis::IsOuterBound for analysis If <APIMake> is True uses BRepAPI_MakeWire to build the wire, if False (to be used only when edges share common vertices) uses BRep_Builder to build the wire.

◆ CheckSeam() [1/2]

bool ShapeAnalysis_Wire::CheckSeam ( const int num)

Checks if a seam pcurves are correct oriented See previous functions for details.

◆ CheckSeam() [2/2]

bool ShapeAnalysis_Wire::CheckSeam ( const int num,
occ::handle< Geom2d_Curve > & C1,
occ::handle< Geom2d_Curve > & C2,
double & cf,
double & cl )

Checks if a seam pcurves are correct oriented Returns: False (status OK) if given edge is not a seam or if it is OK C1 - current pcurve for FORWARD edge, C2 - current pcurve for REVERSED edge (if returns True they should be swapped for the seam), cf, cl - first and last parameters on curves Status: OK : Pcurves are correct or edge is not seam DONE : Seam pcurves should be swapped.

◆ CheckSelfIntersectingEdge() [1/2]

bool ShapeAnalysis_Wire::CheckSelfIntersectingEdge ( const int num)

◆ CheckSelfIntersectingEdge() [2/2]

bool ShapeAnalysis_Wire::CheckSelfIntersectingEdge ( const int num,
NCollection_Sequence< IntRes2d_IntersectionPoint > & points2d,
NCollection_Sequence< gp_Pnt > & points3d )

Checks if num-th edge is self-intersecting. Self-intersection is reported only if intersection point lies outside of both end vertices of the edge. Returns: True if edge is self-intersecting. If returns True it also fills the sequences of intersection points and corresponding 3d points (only that are not enclosed by a vertices) Status: FAIL1 : No pcurve FAIL2 : No vertices DONE1 : Self-intersection found.

◆ CheckSelfIntersection()

bool ShapeAnalysis_Wire::CheckSelfIntersection ( )

Checks self-intersection of the wire (considering pcurves) Looks for self-intersecting edges and each pair of intersecting edges. Warning: It does not check each edge with any other one (only each two adjacent edges) The order of the checks : CheckSelfIntersectingEdge, CheckIntersectingEdges Returns: True if at least one check returned True Status: FAIL1 or DONE1 - see CheckSelfIntersectingEdge FAIL2 or DONE2 - see CheckIntersectingEdges.

◆ CheckShapeConnect() [1/2]

bool ShapeAnalysis_Wire::CheckShapeConnect ( const TopoDS_Shape & shape,
const double prec = 0.0 )

Checks with what orientation <shape> (wire or edge) can be connected to the wire. Tests distances with starting <preci> from <SBWD> (close confusion), but if given <prec> is greater, tests with <prec> (coarse confusion). The smallest found distance can be returned by MinDistance3d.

Returns: False if status is FAIL (see below) Status: DONE1 : If <shape> follows <SBWD>, direct sense (normal) DONE2 : If <shape> follows <SBWD>, but if reversed DONE3 : If <shape> precedes <SBWD>, direct sense DONE4 : If <shape> precedes <SBWD>, but if reversed FAIL1 : If <shape> is neither an edge nor a wire FAIL2 : If <shape> cannot be connected to <SBWD>

DONE5 : To the tail of <SBWD> the <shape> is closer with direct sense DONE6 : To the head of <SBWD> the <shape> is closer with direct sense

Remark: Statuses DONE1 - DONE4, FAIL1 - FAIL2 are basic and describe the nearest connection of the <shape> to <SBWD>. Statuses DONE5 and DONE6 are advanced and are to be used when analyzing with what sense (direct or reversed) the <shape> should be connected to <SBWD>: For tail of <SBWD> if DONE4 is True <shape> should be direct, otherwise reversed. For head of <SBWD> if DONE5 is True <shape> should be direct, otherwise reversed.

◆ CheckShapeConnect() [2/2]

bool ShapeAnalysis_Wire::CheckShapeConnect ( double & tailhead,
double & tailtail,
double & headtail,
double & headhead,
const TopoDS_Shape & shape,
const double prec = 0.0 )

The same as previous CheckShapeConnect but is more advanced. It returns the distances between each end of <sbwd> and each end of <shape>. For example, <tailhead> stores distance between tail of <sbwd> and head of <shape> Remark: First method CheckShapeConnect calls this one.

◆ CheckSmall() [1/2]

bool ShapeAnalysis_Wire::CheckSmall ( const double precsmall = 0.0)

Calls to CheckSmall for each edge Returns: True if at least one small edge was detected.

◆ CheckSmall() [2/2]

bool ShapeAnalysis_Wire::CheckSmall ( const int num,
const double precsmall = 0.0 )

Checks if an edge has a length not greater than myPreci or precsmall (if it is smaller) Returns: False if its length is greater than precision Status: OK : edge is not small or degenerated DONE1: edge is small, vertices are the same DONE2: edge is small, vertices are not the same FAIL : no 3d curve and pcurve.

◆ CheckSmallArea()

bool ShapeAnalysis_Wire::CheckSmallArea ( const TopoDS_Wire & theWire)

Checks if wire has parametric area less than precision.

◆ CheckTail()

bool ShapeAnalysis_Wire::CheckTail ( const TopoDS_Edge & theEdge1,
const TopoDS_Edge & theEdge2,
const double theMaxSine,
const double theMaxWidth,
const double theMaxTolerance,
TopoDS_Edge & theEdge11,
TopoDS_Edge & theEdge12,
TopoDS_Edge & theEdge21,
TopoDS_Edge & theEdge22 )

◆ ClearStatuses()

void ShapeAnalysis_Wire::ClearStatuses ( )

Unsets all the status and distance fields wire, face and precision are not cleared.

◆ Face()

const TopoDS_Face & ShapeAnalysis_Wire::Face ( ) const

Returns the working face.

◆ Init() [1/2]

void ShapeAnalysis_Wire::Init ( const occ::handle< ShapeExtend_WireData > & sbwd,
const TopoDS_Face & face,
const double precision )

Initializes the object with WireData object, face and precision.

◆ Init() [2/2]

void ShapeAnalysis_Wire::Init ( const TopoDS_Wire & wire,
const TopoDS_Face & face,
const double precision )

Initializes the object with standard TopoDS_Wire, face and precision.

◆ IsLoaded()

bool ShapeAnalysis_Wire::IsLoaded ( ) const

Returns True if wire is loaded and has number of edges >0.

◆ IsReady()

bool ShapeAnalysis_Wire::IsReady ( ) const

Returns True if IsLoaded and underlying face is not null.

◆ LastCheckStatus()

bool ShapeAnalysis_Wire::LastCheckStatus ( const ShapeExtend_Status Status) const

Querying the status of the LAST performed 'Advanced' checking procedure.

◆ Load() [1/2]

void ShapeAnalysis_Wire::Load ( const occ::handle< ShapeExtend_WireData > & sbwd)

Loads the object with WireData object.

◆ Load() [2/2]

void ShapeAnalysis_Wire::Load ( const TopoDS_Wire & wire)

Loads the object with standard TopoDS_Wire.

◆ MaxDistance2d()

double ShapeAnalysis_Wire::MaxDistance2d ( ) const

Returns the last maximal distance in 2D-UV computed by CheckContinuity2d.

◆ MaxDistance3d()

double ShapeAnalysis_Wire::MaxDistance3d ( ) const

Returns the last maximal distance in 3D computed by CheckOrientation, CheckConnected, CheckContinuity3d, CheckVertex, CheckNewVertex, CheckSameParameter.

◆ MinDistance2d()

double ShapeAnalysis_Wire::MinDistance2d ( ) const

Returns the last lowest distance in 2D-UV computed by CheckContinuity2d.

◆ MinDistance3d()

double ShapeAnalysis_Wire::MinDistance3d ( ) const

Returns the last lowest distance in 3D computed by CheckOrientation, CheckConnected, CheckContinuity3d, CheckVertex, CheckNewVertex.

◆ NbEdges()

int ShapeAnalysis_Wire::NbEdges ( ) const

Returns the number of edges in the wire, or 0 if it is not loaded.

◆ Perform()

bool ShapeAnalysis_Wire::Perform ( )

Performs all the checks in the following order : CheckOrder, CheckSmall, CheckConnected, CheckEdgeCurves, CheckDegenerated, CheckSelfIntersection, CheckLacking, CheckClosed Returns: True if at least one method returned True; For deeper analysis use Status...(status) methods.

◆ Precision()

double ShapeAnalysis_Wire::Precision ( ) const

Returns the value of precision.

◆ SetFace() [1/2]

void ShapeAnalysis_Wire::SetFace ( const TopoDS_Face & face)

Loads the face the wire lies on.

◆ SetFace() [2/2]

void ShapeAnalysis_Wire::SetFace ( const TopoDS_Face & theFace,
const occ::handle< ShapeAnalysis_Surface > & theSurfaceAnalysis )

Loads the face the wire lies on and surface analysis object.

◆ SetPrecision()

void ShapeAnalysis_Wire::SetPrecision ( const double precision)

◆ SetSurface() [1/3]

void ShapeAnalysis_Wire::SetSurface ( const occ::handle< Geom_Surface > & surface)

Loads the surface the wire lies on.

◆ SetSurface() [2/3]

void ShapeAnalysis_Wire::SetSurface ( const occ::handle< Geom_Surface > & surface,
const TopLoc_Location & location )

Loads the surface the wire lies on.

◆ SetSurface() [3/3]

void ShapeAnalysis_Wire::SetSurface ( const occ::handle< ShapeAnalysis_Surface > & theSurfaceAnalysis)

Loads the surface analysis object.

◆ StatusClosed()

bool ShapeAnalysis_Wire::StatusClosed ( const ShapeExtend_Status Status) const

◆ StatusConnected()

bool ShapeAnalysis_Wire::StatusConnected ( const ShapeExtend_Status Status) const

◆ StatusCurveGaps()

bool ShapeAnalysis_Wire::StatusCurveGaps ( const ShapeExtend_Status Status) const

◆ StatusDegenerated()

bool ShapeAnalysis_Wire::StatusDegenerated ( const ShapeExtend_Status Status) const

◆ StatusEdgeCurves()

bool ShapeAnalysis_Wire::StatusEdgeCurves ( const ShapeExtend_Status Status) const

◆ StatusGaps2d()

bool ShapeAnalysis_Wire::StatusGaps2d ( const ShapeExtend_Status Status) const

◆ StatusGaps3d()

bool ShapeAnalysis_Wire::StatusGaps3d ( const ShapeExtend_Status Status) const

◆ StatusLacking()

bool ShapeAnalysis_Wire::StatusLacking ( const ShapeExtend_Status Status) const

◆ StatusLoop()

bool ShapeAnalysis_Wire::StatusLoop ( const ShapeExtend_Status Status) const

◆ StatusOrder()

bool ShapeAnalysis_Wire::StatusOrder ( const ShapeExtend_Status Status) const

◆ StatusSelfIntersection()

bool ShapeAnalysis_Wire::StatusSelfIntersection ( const ShapeExtend_Status Status) const

◆ StatusSmall()

bool ShapeAnalysis_Wire::StatusSmall ( const ShapeExtend_Status Status) const

◆ Surface()

const occ::handle< ShapeAnalysis_Surface > & ShapeAnalysis_Wire::Surface ( ) const

Returns the working surface.

◆ WireData()

const occ::handle< ShapeExtend_WireData > & ShapeAnalysis_Wire::WireData ( ) const

Returns wire object being analyzed.

Field Documentation

◆ myFace

TopoDS_Face ShapeAnalysis_Wire::myFace
protected

◆ myMax2d

double ShapeAnalysis_Wire::myMax2d
protected

◆ myMax3d

double ShapeAnalysis_Wire::myMax3d
protected

◆ myMin2d

double ShapeAnalysis_Wire::myMin2d
protected

◆ myMin3d

double ShapeAnalysis_Wire::myMin3d
protected

◆ myPrecision

double ShapeAnalysis_Wire::myPrecision
protected

◆ myStatus

int ShapeAnalysis_Wire::myStatus
protected

◆ myStatusClosed

int ShapeAnalysis_Wire::myStatusClosed
protected

◆ myStatusConnected

int ShapeAnalysis_Wire::myStatusConnected
protected

◆ myStatusCurveGaps

int ShapeAnalysis_Wire::myStatusCurveGaps
protected

◆ myStatusDegenerated

int ShapeAnalysis_Wire::myStatusDegenerated
protected

◆ myStatusEdgeCurves

int ShapeAnalysis_Wire::myStatusEdgeCurves
protected

◆ myStatusGaps2d

int ShapeAnalysis_Wire::myStatusGaps2d
protected

◆ myStatusGaps3d

int ShapeAnalysis_Wire::myStatusGaps3d
protected

◆ myStatusLacking

int ShapeAnalysis_Wire::myStatusLacking
protected

◆ myStatusLoop

int ShapeAnalysis_Wire::myStatusLoop
protected

◆ myStatusOrder

int ShapeAnalysis_Wire::myStatusOrder
protected

◆ myStatusSelfIntersection

int ShapeAnalysis_Wire::myStatusSelfIntersection
protected

◆ myStatusSmall

int ShapeAnalysis_Wire::myStatusSmall
protected

◆ mySurf

occ::handle<ShapeAnalysis_Surface> ShapeAnalysis_Wire::mySurf
protected

◆ myWire

occ::handle<ShapeExtend_WireData> ShapeAnalysis_Wire::myWire
protected

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