Hide menu
Loading...
Searching...
No Matches

Defines a topological face. More...

Inheritance diagram for cadex.ModelData.Face:
cadex.ModelData.Shape cadex.BaseObject

Public Member Functions

 Face (global::System.IntPtr cPtr, bool cMemoryOwn)
 
 Face (cadex.Geom.Surface theSurface, bool theMakeWire)
 
 Face (cadex.Geom.Surface theSurface)
 
 Face (cadex.Geom.Surface theSurface, cadex.ModelData.Wire theWire)
 Constructor.
 
 Face (cadex.Geom.Surface theSurface, double theUMin, double theUMax, double theVMin, double theVMax)
 Constructor.
 
void ParametricDomain (out double theUMin, out double theUMax, out double theVMin, out double theVMax)
 
bool Append (cadex.ModelData.Wire theWire)
 Adds a wire to the face.
 
bool Append (cadex.Collections.WireList theWires)
 Adds a wires to the face.
 
cadex.Geom.Surface Surface ()
 Returns underlying surface.
 
cadex.ModelData.Wire OuterWire ()
 Returns outer wire.
 
cadex.ModelData.IndexedTriangleSet Triangulation ()
 Returns triangulation of the face.
 
- Public Member Functions inherited from cadex.ModelData.Shape
 Shape (global::System.IntPtr cPtr, bool cMemoryOwn)
 
override int GetHashCode ()
 
cadex.ModelData.ShapeType Type ()
 Returns a shape type. For a null object returns Undefined.
 
cadex.ModelData.ShapeOrientation Orientation ()
 Returns orientation flag.
 
cadex.ModelData.Shape Reversed ()
 Returns a shape that shares the same geometry and subshape graph but has opposite orientation.
 
cadex.ModelData.Shape Oriented (cadex.ModelData.ShapeOrientation theOrientation)
 Returns a shape that shares the same geometry and subshape graph and has specified orientation.
 
bool IsEqual (cadex.ModelData.Shape theOther)
 Returns true if the shape shares the same geometry and subshape graph, and has equal orientation.
 
bool IsSame (cadex.ModelData.Shape theOther)
 Returns true if the shape shares the same geometry and subshape graph.
 
void SetName (cadex.UTF16String theName)
 Sets the name.
 
cadex.UTF16String Name ()
 Returns the name.
 
void AddAssociatedPMI (cadex.PMI.Element theElement)
 Adds the PMI element.
 
void AddAssociatedPMI (cadex.Collections.PMIElementList theElements)
 Adds the PMI elements.
 
cadex.Collections.PMIElementList AssociatedPMI ()
 Returns the PMI elements.
 
override bool Equals (System.Object o)
 
- Public Member Functions inherited from cadex.BaseObject
 BaseObject (global::System.IntPtr cPtr, bool cMemoryOwn)
 
void Dispose ()
 
bool IsNull ()
 
ulong Id ()
 Return unique identifier of public object.
 
bool IsEqual (cadex.BaseObject theObj)
 
override int GetHashCode ()
 
override bool Equals (System.Object o)
 

Static Public Member Functions

static cadex.ModelData.Face Cast (cadex.ModelData.Shape theShape)
 Cast operator.
 
static new bool CompareType (cadex.BaseObject theObject)
 Check the type of object. Returns true if the specified object is this class type.
 
- Static Public Member Functions inherited from cadex.ModelData.Shape
static bool CompareType (cadex.BaseObject theObject)
 Check the type of object. Returns true if the specified object is this class type.
 
static cadex.ModelData.Shape Cast (cadex.BaseObject theBase)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from cadex.ModelData.Shape
override void Dispose (bool disposing)
 

Detailed Description

Defines a topological face.

The following image depicts an example of a face:

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 Boundaries

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
Note
Own face orientation must be ignored when defining correct contour orientation (unlike, for instance, ACIS or Parasolid kernels which do take face orientation into account).

The following code snippet demonstrates how to iterate over face edges p-curves:

// always use forward orientation when analyzing pcurves orientation
ModelData::Face aFwdFace = ModelData::Face::Cast (aFace.Oriented (ModelData::ShapeOrientation::Forward));
ModelData::Wire anOuterWire = aFwdFace.OuterWire();
while (i.HasNext()) {
const ModelData::Shape& aWire = i.Next(); // wire
assert (aWire.Type() == ModelData::ShapeType::Wire);
if (aWire.IsSame (anOuterWire)) {
// we are exploring an outer wire
} else {
// we are exploring a hole
}
while (j.HasNext()) {
const ModelData::Shape& aShape = j.Next(); // edge
const ModelData::Edge& anEdge = ModelData::Edge::Cast (aShape);
double aF, aL;
Geom::Curve2d aPCurve = anEdge.PCurve (aFwdFace, aF, aL);
if (anEdge.Orientation() == ModelData::ShapeOrientation::Forward) {
// face material is on the left from the pcurve
} else {
// face material is on the right from the pcurve
}
}
}
Base class for 2D curves.
Definition Curve2d.cs:25
Defines an edge.
Definition Edge.cs:146
static cadex.ModelData.Edge Cast(cadex.ModelData.Shape theShape)
Casts a base class object to Edge.
Definition Edge.cs:448
Defines a topological face.
Definition Face.cs:120
static cadex.ModelData.Face Cast(cadex.ModelData.Shape theShape)
Cast operator.
Definition Face.cs:250
cadex.ModelData.Wire OuterWire()
Returns outer wire.
Definition Face.cs:226
Base class of topological shapes.
Definition Shape.cs:178
cadex.ModelData.ShapeOrientation Orientation()
Returns orientation flag.
Definition Shape.cs:230
cadex.ModelData.Shape Oriented(cadex.ModelData.ShapeOrientation theOrientation)
Returns a shape that shares the same geometry and subshape graph and has specified orientation.
Definition Shape.cs:248
cadex.ModelData.ShapeType Type()
Returns a shape type. For a null object returns Undefined.
Definition Shape.cs:222
bool IsSame(cadex.ModelData.Shape theOther)
Returns true if the shape shares the same geometry and subshape graph.
Definition Shape.cs:266
Iterates over subshapes in a shape.
Definition ShapeIterator.cs:58
Defines a connected set of edges.
Definition Wire.cs:30

2D Bounding Box

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 Measurements.ComputeBoundingBox() 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 (Geom.CylindricalSurface) then it would correspond to a cylinder's height:

Measurements::ComputeBoundingBox(aFace, Geom::Transformation(), aBox);
double aHeight = aBox.YRange(); // cylindrical surface is parametrized by length in V-range
Defines a transformation matrix.
Definition Transformation.cs:23
Defines a 3D axis-aligned bounding box.
Definition Box.cs:50
double YRange()
Returns the length of range along Y axis.
Definition Box.cs:218
Examples
exploring/brep_geometry/Program.cs, exploring/brep_geometry/main.cxx, exploring/brep_topology/Program.cs, exploring/brep_topology/main.cxx, meshing/mesh_generation/Program.cs, and meshing/mesh_generation/main.cxx.

Constructor & Destructor Documentation

◆ Face() [1/2]

cadex.ModelData.Face.Face ( cadex.Geom.Surface theSurface,
cadex.ModelData.Wire theWire )
inline

Constructor.

Creates a face from a surface and explicitly defined wire:

Constructing face from surface and wire

The wire's edge must lie on a surface (within proximity of their tolerances).

◆ Face() [2/2]

cadex.ModelData.Face.Face ( cadex.Geom.Surface theSurface,
double theUMin,
double theUMax,
double theVMin,
double theVMax )
inline

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.

Member Function Documentation

◆ Append() [1/2]

bool cadex.ModelData.Face.Append ( cadex.Collections.WireList theWires)
inline

Adds a wires 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 one of the theWires is null and true otherwise.

◆ Append() [2/2]

bool cadex.ModelData.Face.Append ( cadex.ModelData.Wire theWire)
inline

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 theWire is null and true otherwise.

◆ Cast()

static cadex.ModelData.Face cadex.ModelData.Face.Cast ( cadex.ModelData.Shape theShape)
inlinestatic

Cast operator.

Casts theShape to a face. If theShape is not a face then behavior is undefined (assert will be thrown in debug mode).

Examples
exploring/brep_geometry/Program.cs, exploring/brep_topology/Program.cs, and meshing/mesh_generation/Program.cs.

◆ Dispose()

override void cadex.ModelData.Face.Dispose ( bool disposing)
inlineprotectedvirtual

Reimplemented from cadex.BaseObject.

◆ Triangulation()

cadex.ModelData.IndexedTriangleSet cadex.ModelData.Face.Triangulation ( )
inline

Returns triangulation of the face.

An empty object may be returned.

Examples
meshing/mesh_generation/Program.cs, and meshing/mesh_generation/main.cxx.