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

This operator allows to perform various fixes on face and its wires: fixes provided by ShapeFix_Wire, fixing orientation of wires, addition of natural bounds, fixing of missing seam edge, and detection and removal of null-area wires. More...

#include <ShapeFix_Face.hxx>

Inheritance diagram for ShapeFix_Face:
Inheritance graph
[legend]

Public Member Functions

 ShapeFix_Face ()
 Creates an empty tool.
 
 ShapeFix_Face (const TopoDS_Face &face)
 Creates a tool and loads a face.
 
virtual void ClearModes ()
 Sets all modes to default.
 
void Init (const TopoDS_Face &face)
 Loads a whole face already created, with its wires, sense and location.
 
void Init (const occ::handle< Geom_Surface > &surf, const double preci, const bool fwd=true)
 Starts the creation of the face By default it will be FORWARD, or REVERSED if <fwd> is False.
 
void Init (const occ::handle< ShapeAnalysis_Surface > &surf, const double preci, const bool fwd=true)
 Starts the creation of the face By default it will be FORWARD, or REVERSED if <fwd> is False.
 
void SetMsgRegistrator (const occ::handle< ShapeExtend_BasicMsgRegistrator > &msgreg) override
 Sets message registrator.
 
void SetPrecision (const double preci) override
 Sets basic precision value (also to FixWireTool)
 
void SetMinTolerance (const double mintol) override
 Sets minimal allowed tolerance (also to FixWireTool)
 
void SetMaxTolerance (const double maxtol) override
 Sets maximal allowed tolerance (also to FixWireTool)
 
intFixWireMode ()
 Returns (modifiable) the mode for applying fixes of ShapeFix_Wire, by default True.
 
intFixOrientationMode ()
 Returns (modifiable) the fix orientation mode, by default True. If True, wires oriented to border limited square.
 
intFixAddNaturalBoundMode ()
 Returns (modifiable) the add natural bound mode. If true, natural boundary is added on faces that miss them. Default is False for faces with single wire (they are handled by FixOrientation in that case) and True for others.
 
intFixMissingSeamMode ()
 Returns (modifiable) the fix missing seam mode, by default True. If True, tries to insert seam is missed.
 
intFixSmallAreaWireMode ()
 Returns (modifiable) the fix small area wire mode, by default False. If True, drops small wires.
 
intRemoveSmallAreaFaceMode ()
 Returns (modifiable) the remove face with small area, by default False. If True, drops faces with small outer wires.
 
intFixIntersectingWiresMode ()
 Returns (modifiable) the fix intersecting wires mode by default True.
 
intFixLoopWiresMode ()
 Returns (modifiable) the fix loop wires mode by default True.
 
intFixSplitFaceMode ()
 Returns (modifiable) the fix split face mode by default True.
 
intAutoCorrectPrecisionMode ()
 Returns (modifiable) the auto-correct precision mode by default False.
 
intFixPeriodicDegeneratedMode ()
 Returns (modifiable) the activation flag for periodic degenerated fix. False by default.
 
TopoDS_Face Face () const
 Returns a face which corresponds to the current state Warning: The finally produced face may be another one ... but with the same support.
 
TopoDS_Shape Result () const
 Returns resulting shape (Face or Shell if split) To be used instead of Face() if FixMissingSeam involved.
 
void Add (const TopoDS_Wire &wire)
 Add a wire to current face using BRep_Builder. Wire is added without taking into account orientation of face (as if face were FORWARD).
 
bool Perform (const Message_ProgressRange &theProgress=Message_ProgressRange())
 Performs all the fixes, depending on modes Function Status returns the status of last call to Perform() ShapeExtend_OK : face was OK, nothing done ShapeExtend_DONE1: some wires are fixed ShapeExtend_DONE2: orientation of wires fixed ShapeExtend_DONE3: missing seam added ShapeExtend_DONE4: small area wire removed ShapeExtend_DONE5: natural bounds added ShapeExtend_FAIL1: some fails during fixing wires ShapeExtend_FAIL2: cannot fix orientation of wires ShapeExtend_FAIL3: cannot add missing seam ShapeExtend_FAIL4: cannot remove small area wire.
 
bool FixOrientation ()
 Fixes orientation of wires on the face It tries to make all wires lie outside all others (according to orientation) by reversing orientation of some of them. If face lying on sphere or torus has single wire and AddNaturalBoundMode is True, that wire is not reversed in any case (supposing that natural bound will be added). Returns True if wires were reversed.
 
bool FixOrientation (NCollection_DataMap< TopoDS_Shape, NCollection_List< TopoDS_Shape >, TopTools_ShapeMapHasher > &MapWires)
 Fixes orientation of wires on the face It tries to make all wires lie outside all others (according to orientation) by reversing orientation of some of them. If face lying on sphere or torus has single wire and AddNaturalBoundMode is True, that wire is not reversed in any case (supposing that natural bound will be added). Returns True if wires were reversed OutWires return information about out wires + list of internal wires for each (for performing split face).
 
bool FixAddNaturalBound ()
 Adds natural boundary on face if it is missing. Two cases are supported:
 
bool FixMissingSeam ()
 Detects and fixes the special case when face on a closed surface is given by two wires closed in 3d but with gap in 2d. In that case it creates a new wire from the two, and adds a missing seam edge Returns True if missing seam was added.
 
bool FixSmallAreaWire (const bool theIsRemoveSmallFace)
 Detects wires with small area (that is less than 100*Precision::PConfusion(). Removes these wires if they are internal. Returns : True if at least one small wire removed, False if does nothing.
 
bool FixLoopWire (NCollection_Sequence< TopoDS_Shape > &aResWires)
 Detects if wire has a loop and fixes this situation by splitting on the few parts. if wire has a loops and it was split Status was set to value ShapeExtend_DONE6.
 
bool FixIntersectingWires ()
 Detects and fixes the special case when face has more than one wire and this wires have intersection point.
 
bool FixWiresTwoCoincEdges ()
 If wire contains two coincidence edges it must be removed Queries on status after Perform()
 
bool FixSplitFace (const NCollection_DataMap< TopoDS_Shape, NCollection_List< TopoDS_Shape >, TopTools_ShapeMapHasher > &MapWires)
 Split face if there are more than one out wire using inrormation after FixOrientation()
 
bool FixPeriodicDegenerated ()
 Fixes topology for a specific case when face is composed by a single wire belting a periodic surface. In that case a degenerated edge is reconstructed in the degenerated pole of the surface. Initial wire gets consistent orientation. Must be used in couple and before FixMissingSeam routine.
 
bool Status (const ShapeExtend_Status status) const
 Returns the status of last call to Perform() ShapeExtend_OK : face was OK, nothing done ShapeExtend_DONE1: some wires are fixed ShapeExtend_DONE2: orientation of wires fixed ShapeExtend_DONE3: missing seam added ShapeExtend_DONE4: small area wire removed ShapeExtend_DONE5: natural bounds added ShapeExtend_DONE8: face may be splited ShapeExtend_FAIL1: some fails during fixing wires ShapeExtend_FAIL2: cannot fix orientation of wires ShapeExtend_FAIL3: cannot add missing seam ShapeExtend_FAIL4: cannot remove small area wire.
 
occ::handle< ShapeFix_WireFixWireTool ()
 Returns tool for fixing wires.
 
- Public Member Functions inherited from ShapeFix_Root
 ShapeFix_Root ()
 Empty Constructor (no context is created)
 
virtual void Set (const occ::handle< ShapeFix_Root > &Root)
 Copy all fields from another Root object.
 
virtual void SetContext (const occ::handle< ShapeBuild_ReShape > &context)
 Sets context.
 
occ::handle< ShapeBuild_ReShapeContext () const
 Returns context.
 
occ::handle< ShapeExtend_BasicMsgRegistratorMsgRegistrator () const
 Returns message registrator.
 
double Precision () const
 Returns basic precision value.
 
double MinTolerance () const
 Returns minimal allowed tolerance.
 
double MaxTolerance () const
 Returns maximal allowed tolerance.
 
double LimitTolerance (const double toler) const
 Returns tolerance limited by [myMinTol,myMaxTol].
 
void SendMsg (const TopoDS_Shape &shape, const Message_Msg &message, const Message_Gravity gravity=Message_Info) const
 Sends a message to be attached to the shape. Calls corresponding message of message registrator.
 
void SendMsg (const Message_Msg &message, const Message_Gravity gravity=Message_Info) const
 Sends a message to be attached to myShape. Calls previous method.
 
void SendWarning (const TopoDS_Shape &shape, const Message_Msg &message) const
 Sends a warning to be attached to the shape. Calls SendMsg with gravity set to Message_Warning.
 
void SendWarning (const Message_Msg &message) const
 Calls previous method for myShape.
 
void SendFail (const TopoDS_Shape &shape, const Message_Msg &message) const
 Sends a fail to be attached to the shape. Calls SendMsg with gravity set to Message_Fail.
 
void SendFail (const Message_Msg &message) const
 Calls previous method for myShape.
 
- 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< ShapeAnalysis_SurfacemySurf
 
TopoDS_Face myFace
 
TopoDS_Shape myResult
 
occ::handle< ShapeFix_WiremyFixWire
 
bool myFwd
 
int myStatus
 
- Protected Attributes inherited from ShapeFix_Root
TopoDS_Shape myShape
 

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.
 
- Static Protected Member Functions inherited from ShapeFix_Root
static bool NeedFix (const int flag, const bool def=true)
 Auxiliary method for work with three-position (on/off/default) flags (modes) in ShapeFix.
 

Detailed Description

This operator allows to perform various fixes on face and its wires: fixes provided by ShapeFix_Wire, fixing orientation of wires, addition of natural bounds, fixing of missing seam edge, and detection and removal of null-area wires.

Constructor & Destructor Documentation

◆ ShapeFix_Face() [1/2]

ShapeFix_Face::ShapeFix_Face ( )

Creates an empty tool.

◆ ShapeFix_Face() [2/2]

ShapeFix_Face::ShapeFix_Face ( const TopoDS_Face & face)

Creates a tool and loads a face.

Member Function Documentation

◆ Add()

void ShapeFix_Face::Add ( const TopoDS_Wire & wire)

Add a wire to current face using BRep_Builder. Wire is added without taking into account orientation of face (as if face were FORWARD).

◆ AutoCorrectPrecisionMode()

int & ShapeFix_Face::AutoCorrectPrecisionMode ( )

Returns (modifiable) the auto-correct precision mode by default False.

◆ ClearModes()

virtual void ShapeFix_Face::ClearModes ( )
virtual

Sets all modes to default.

◆ Face()

TopoDS_Face ShapeFix_Face::Face ( ) const

Returns a face which corresponds to the current state Warning: The finally produced face may be another one ... but with the same support.

◆ FixAddNaturalBound()

bool ShapeFix_Face::FixAddNaturalBound ( )

Adds natural boundary on face if it is missing. Two cases are supported:

  • face has no wires
  • face lies on geometrically double-closed surface (sphere or torus) and none of wires is left-oriented Returns True if natural boundary was added

◆ FixAddNaturalBoundMode()

int & ShapeFix_Face::FixAddNaturalBoundMode ( )

Returns (modifiable) the add natural bound mode. If true, natural boundary is added on faces that miss them. Default is False for faces with single wire (they are handled by FixOrientation in that case) and True for others.

◆ FixIntersectingWires()

bool ShapeFix_Face::FixIntersectingWires ( )

Detects and fixes the special case when face has more than one wire and this wires have intersection point.

◆ FixIntersectingWiresMode()

int & ShapeFix_Face::FixIntersectingWiresMode ( )

Returns (modifiable) the fix intersecting wires mode by default True.

◆ FixLoopWire()

bool ShapeFix_Face::FixLoopWire ( NCollection_Sequence< TopoDS_Shape > & aResWires)

Detects if wire has a loop and fixes this situation by splitting on the few parts. if wire has a loops and it was split Status was set to value ShapeExtend_DONE6.

◆ FixLoopWiresMode()

int & ShapeFix_Face::FixLoopWiresMode ( )

Returns (modifiable) the fix loop wires mode by default True.

◆ FixMissingSeam()

bool ShapeFix_Face::FixMissingSeam ( )

Detects and fixes the special case when face on a closed surface is given by two wires closed in 3d but with gap in 2d. In that case it creates a new wire from the two, and adds a missing seam edge Returns True if missing seam was added.

◆ FixMissingSeamMode()

int & ShapeFix_Face::FixMissingSeamMode ( )

Returns (modifiable) the fix missing seam mode, by default True. If True, tries to insert seam is missed.

◆ FixOrientation() [1/2]

bool ShapeFix_Face::FixOrientation ( )

Fixes orientation of wires on the face It tries to make all wires lie outside all others (according to orientation) by reversing orientation of some of them. If face lying on sphere or torus has single wire and AddNaturalBoundMode is True, that wire is not reversed in any case (supposing that natural bound will be added). Returns True if wires were reversed.

◆ FixOrientation() [2/2]

bool ShapeFix_Face::FixOrientation ( NCollection_DataMap< TopoDS_Shape, NCollection_List< TopoDS_Shape >, TopTools_ShapeMapHasher > & MapWires)

Fixes orientation of wires on the face It tries to make all wires lie outside all others (according to orientation) by reversing orientation of some of them. If face lying on sphere or torus has single wire and AddNaturalBoundMode is True, that wire is not reversed in any case (supposing that natural bound will be added). Returns True if wires were reversed OutWires return information about out wires + list of internal wires for each (for performing split face).

◆ FixOrientationMode()

int & ShapeFix_Face::FixOrientationMode ( )

Returns (modifiable) the fix orientation mode, by default True. If True, wires oriented to border limited square.

◆ FixPeriodicDegenerated()

bool ShapeFix_Face::FixPeriodicDegenerated ( )

Fixes topology for a specific case when face is composed by a single wire belting a periodic surface. In that case a degenerated edge is reconstructed in the degenerated pole of the surface. Initial wire gets consistent orientation. Must be used in couple and before FixMissingSeam routine.

◆ FixPeriodicDegeneratedMode()

int & ShapeFix_Face::FixPeriodicDegeneratedMode ( )

Returns (modifiable) the activation flag for periodic degenerated fix. False by default.

◆ FixSmallAreaWire()

bool ShapeFix_Face::FixSmallAreaWire ( const bool theIsRemoveSmallFace)

Detects wires with small area (that is less than 100*Precision::PConfusion(). Removes these wires if they are internal. Returns : True if at least one small wire removed, False if does nothing.

◆ FixSmallAreaWireMode()

int & ShapeFix_Face::FixSmallAreaWireMode ( )

Returns (modifiable) the fix small area wire mode, by default False. If True, drops small wires.

◆ FixSplitFace()

bool ShapeFix_Face::FixSplitFace ( const NCollection_DataMap< TopoDS_Shape, NCollection_List< TopoDS_Shape >, TopTools_ShapeMapHasher > & MapWires)

Split face if there are more than one out wire using inrormation after FixOrientation()

◆ FixSplitFaceMode()

int & ShapeFix_Face::FixSplitFaceMode ( )

Returns (modifiable) the fix split face mode by default True.

◆ FixWireMode()

int & ShapeFix_Face::FixWireMode ( )

Returns (modifiable) the mode for applying fixes of ShapeFix_Wire, by default True.

◆ FixWiresTwoCoincEdges()

bool ShapeFix_Face::FixWiresTwoCoincEdges ( )

If wire contains two coincidence edges it must be removed Queries on status after Perform()

◆ FixWireTool()

occ::handle< ShapeFix_Wire > ShapeFix_Face::FixWireTool ( )

Returns tool for fixing wires.

◆ Init() [1/3]

void ShapeFix_Face::Init ( const occ::handle< Geom_Surface > & surf,
const double preci,
const bool fwd = true )

Starts the creation of the face By default it will be FORWARD, or REVERSED if <fwd> is False.

◆ Init() [2/3]

void ShapeFix_Face::Init ( const occ::handle< ShapeAnalysis_Surface > & surf,
const double preci,
const bool fwd = true )

Starts the creation of the face By default it will be FORWARD, or REVERSED if <fwd> is False.

◆ Init() [3/3]

void ShapeFix_Face::Init ( const TopoDS_Face & face)

Loads a whole face already created, with its wires, sense and location.

◆ Perform()

bool ShapeFix_Face::Perform ( const Message_ProgressRange & theProgress = Message_ProgressRange())

Performs all the fixes, depending on modes Function Status returns the status of last call to Perform() ShapeExtend_OK : face was OK, nothing done ShapeExtend_DONE1: some wires are fixed ShapeExtend_DONE2: orientation of wires fixed ShapeExtend_DONE3: missing seam added ShapeExtend_DONE4: small area wire removed ShapeExtend_DONE5: natural bounds added ShapeExtend_FAIL1: some fails during fixing wires ShapeExtend_FAIL2: cannot fix orientation of wires ShapeExtend_FAIL3: cannot add missing seam ShapeExtend_FAIL4: cannot remove small area wire.

◆ RemoveSmallAreaFaceMode()

int & ShapeFix_Face::RemoveSmallAreaFaceMode ( )

Returns (modifiable) the remove face with small area, by default False. If True, drops faces with small outer wires.

◆ Result()

TopoDS_Shape ShapeFix_Face::Result ( ) const

Returns resulting shape (Face or Shell if split) To be used instead of Face() if FixMissingSeam involved.

◆ SetMaxTolerance()

void ShapeFix_Face::SetMaxTolerance ( const double maxtol)
overridevirtual

Sets maximal allowed tolerance (also to FixWireTool)

Reimplemented from ShapeFix_Root.

◆ SetMinTolerance()

void ShapeFix_Face::SetMinTolerance ( const double mintol)
overridevirtual

Sets minimal allowed tolerance (also to FixWireTool)

Reimplemented from ShapeFix_Root.

◆ SetMsgRegistrator()

void ShapeFix_Face::SetMsgRegistrator ( const occ::handle< ShapeExtend_BasicMsgRegistrator > & msgreg)
overridevirtual

Sets message registrator.

Reimplemented from ShapeFix_Root.

◆ SetPrecision()

void ShapeFix_Face::SetPrecision ( const double preci)
overridevirtual

Sets basic precision value (also to FixWireTool)

Reimplemented from ShapeFix_Root.

◆ Status()

bool ShapeFix_Face::Status ( const ShapeExtend_Status status) const

Returns the status of last call to Perform() ShapeExtend_OK : face was OK, nothing done ShapeExtend_DONE1: some wires are fixed ShapeExtend_DONE2: orientation of wires fixed ShapeExtend_DONE3: missing seam added ShapeExtend_DONE4: small area wire removed ShapeExtend_DONE5: natural bounds added ShapeExtend_DONE8: face may be splited ShapeExtend_FAIL1: some fails during fixing wires ShapeExtend_FAIL2: cannot fix orientation of wires ShapeExtend_FAIL3: cannot add missing seam ShapeExtend_FAIL4: cannot remove small area wire.

Field Documentation

◆ myFace

TopoDS_Face ShapeFix_Face::myFace
protected

◆ myFixWire

occ::handle<ShapeFix_Wire> ShapeFix_Face::myFixWire
protected

◆ myFwd

bool ShapeFix_Face::myFwd
protected

◆ myResult

TopoDS_Shape ShapeFix_Face::myResult
protected

◆ myStatus

int ShapeFix_Face::myStatus
protected

◆ mySurf

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

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