Defines a topological face. More...
Public Member Functions | |
ModelData_Face (const ModelData_Surface &theSurface, bool theMakeWire=false) | |
Constructor. | |
ModelData_Face (const ModelData_Surface &theSurface, const ModelData_Wire &theWire) | |
Constructor. | |
ModelData_Face (const ModelData_Surface &theSurface, double theUMin, double theUMax, double theVMin, double theVMax) | |
Constructor. | |
ModelData_Face (const TopoDS_Face &) | |
Constructor. | |
operator const TopoDS_Face & () const | |
Cast operator. | |
operator TopoDS_Face & () | |
Cast operator. | |
bool | Append (const ModelData_Wire &theWire) |
Adds a wire to the face. | |
ModelData_Surface | Surface () const |
Returns underlying surface. | |
ModelData_Wire | OuterWire () const |
Returns outer wire. | |
![]() | |
ModelData_Shape () | |
Constructor. | |
ModelData_Shape (const ModelData_Shape &theOther) | |
Constructor. | |
ModelData_Shape (ModelData_Shape &&theOther) | |
Move constructor. | |
~ModelData_Shape () | |
Destructor. | |
ModelData_Shape & | operator= (const ModelData_Shape &theOther) |
Assignment operator. | |
ModelData_Shape & | operator= (ModelData_Shape &&theOther) |
Move assignment operator. | |
operator const TopoDS_Shape & () const | |
Casts this object to TopoDS_Shape. | |
ModelData_ShapeType | Type () const |
Returns a shape type. | |
ModelData_ShapeOrientation | Orientation () const |
Returns orientation flag. | |
ModelData_Shape | Reversed () const |
Returns a shape that shares the same geometry and subshape graph but has opposite orientation. | |
ModelData_Shape | Oriented (ModelData_ShapeOrientation theOrientation) const |
Returns a shape that shares the same geometry and subshape graph and has specified orientation. | |
void | Nullify () |
Nullifies the object. | |
bool | IsNull () const |
Returns true if the object has not been initialized yet. | |
operator bool () const | |
Returns true if the object is not null. | |
bool | IsEqual (const ModelData_Shape &theOther) const |
Returns true if the shape shares the same geometry and subshape graph, and has equal orientation. | |
bool | IsSame (const ModelData_Shape &theOther) const |
Returns true if the shape shares the same geometry and subshape graph. | |
internal::ModelData_ShapeImpl * | Impl () const |
Returns internal implementation object. | |
Static Public Member Functions | |
static const ModelData_Face & | Cast (const ModelData_Shape &theShape) |
Cast operator. | |
static ModelData_Face & | Cast (ModelData_Shape &theShape) |
Cast operator. | |
Additional Inherited Members | |
![]() | |
ModelData_Shape (const TopoDS_Shape &theOther, bool) | |
Constructor. | |
ModelData_Shape (internal::ModelData_ShapeImpl *theImpl) | |
Constructor. | |
![]() | |
internal::Base_Handle | myImpl |
Internal implementation object. | |
Defines a topological face.
The following image depicts an example of a face:
Face resides on a geometrical surface (returned by Surface()) and is bounded by one or several wires. A face must always have at least one explicit outer wire even if it corresponds to a naturally bounded surface (e.g. torus or a sphere).
Orientation() defines whether face normal matches the normal of the underlying surface, or is opposite to it.
Face wires must always be closed, both in 3D and in 2D (i.e. parametric space of the underlying surface). Therefore a face lying on a periodical surface on its full period must have an explicit seam-edge (an edge corresponding to surface boundaries).
A face outer wire can be distinguished using the OuterWire() method.
Face wires must be oriented such that they define a closed portion of material. If to look in the direction opposite to a surface normal, p-curves of an outer wire (taking into account edge orientations) must be oriented counter-clockwise, and p-curve of inner wires (if present) - clockwise. This ensures that the face has a finite area.
The following image depicts an example of face with two wires and p-curves in parametric space of the face surface. P-curves of edges with forward orientation are displayed in green, p-curves of edges with reversed orientation are displayed in red:
![]()
Face with two wires | ![]()
P-curves in surface parametric space |
The following code snippet demonstrates how to iterate over face edges p-curves:
Face p-curves define a closed contour (or a set of contours in the case of face with holes) in surface parametric space. A 2D bounding box in this surface parametric space can be returned using the ModelAlgo_BoundingBox::Compute() method (its overload accepting ModelData_Face). The following images demonstrate a face lying on a cylindrical surface and its 2D contour and bounding box:
![]()
Face on cylindrical surface | ![]()
2D bounding box |
The following example demonstrates how to retrieve this bounding box. Note aHeight below would designate a 3D length of this cylindrical face and if it occupied entire U-range of the cylindrical surface (ModelData_CylindricalSurface) then it would correspond to a cylinder's height:
cadex::ModelData_Face::ModelData_Face | ( | const ModelData_Surface & | theSurface, |
bool | theMakeWire = false |
||
) |
Constructor.
Creates a face on entire surface's definition domain:
The surface must have bounded definition domain (see ModelData_Surface::Domain()). This is the case for instance for ModelData_BSplineSurface.
theMakeWire specifies whether the wire must be automatically constructed and added to the face.
cadex::ModelData_Face::ModelData_Face | ( | const ModelData_Surface & | theSurface, |
const ModelData_Wire & | theWire | ||
) |
Constructor.
Creates a face from a surface and explicitly defined wire:
The wire's edge must lie on a surface (within proximity of their tolerances).
cadex::ModelData_Face::ModelData_Face | ( | const ModelData_Surface & | theSurface, |
double | theUMin, | ||
double | theUMax, | ||
double | theVMin, | ||
double | theVMax | ||
) |
Constructor.
Creates a face from a surface and its parametric definition domain:
![]()
Input surface | ![]()
Surface definition domain |
The parameters must be within surface's definition domain (see ModelData_Surface::Domain()) unless it is periodic. theUMax must be greater than theUMin by at least 1e-9.
bool cadex::ModelData_Face::Append | ( | const ModelData_Wire & | theWire | ) |
Adds a wire to the face.
There must be single outer wire and zero, one or more inner wires (i.e. holes). It is strongly recommended (although not required) that the first wire being added is an outer wire.
Returns false if theEdge is null and true otherwise.
|
static |
Cast operator.
Casts theShape to a face. If theShape is not a face then behavior is undefined (assert will be thrown in debug mode).
|
static |
Cast operator.
Casts theShape to a face. If theShape is not a face then behavior is undefined (assert will be thrown in debug mode).
ModelData_Wire cadex::ModelData_Face::OuterWire | ( | ) | const |
Returns outer wire.
Outer wire is not necessarily the first one in the list of wires even if this is often the case. If the face has single wire then returns that wire.