CAD Exchanger SDK
cadex::ModelData_Edge Class Reference

Defines an edge. More...

Inheritance diagram for cadex::ModelData_Edge:
cadex::ModelData_Shape

Public Member Functions

 ModelData_Edge (const ModelData_Curve &theCurve)
 Constructor. More...
 
 ModelData_Edge (const ModelData_Curve &theCurve, double theFirstParameter, double theLastParameter)
 Constructor. More...
 
 ModelData_Edge (const ModelData_Curve &theCurve, const ModelData_Vertex &theFirstVertex, const ModelData_Vertex &theLastVertex)
 Constructor. More...
 
 ModelData_Edge (const TopoDS_Edge &)
 
 operator const TopoDS_Edge & () const
 Cast operator.
 
 operator TopoDS_Edge & ()
 Cast operator.
 
ModelData_Vertex StartVertex () const
 Returns a start vertex. More...
 
ModelData_Vertex EndVertex () const
 Returns a start vertex. More...
 
ModelData_Curve Curve (double &theFirstParameter, double &theLastParameter) const
 Returns edge 3D curve and its limits. More...
 
ModelData_Curve2d PCurve (const ModelData_Face &theFace, double &theFirstParameter, double &theLastParameter) const
 Returns edge p-curve on a face and its limits. More...
 
double Tolerance () const
 Returns edge tolerance. More...
 
bool IsDegenerated () const
 Returns true if an edge is degenerated. More...
 
bool IsSeam (const ModelData_Face &theFace) const
 Returns true for a seam-edge.
 
- Public Member Functions inherited from cadex::ModelData_Shape
 ModelData_Shape ()
 Constructor.
 
 ModelData_Shape (const ModelData_Shape &theOther)
 Constructor.
 
 ModelData_Shape (ModelData_Shape &&theOther)
 Move constructor.
 
 ~ModelData_Shape ()
 Destructor.
 
ModelData_Shapeoperator= (const ModelData_Shape &theOther)
 Assignment operator.
 
ModelData_Shapeoperator= (ModelData_Shape &&theOther)
 Move assignment operator.
 
 operator const TopoDS_Shape & () const
 Casts this object to TopoDS_Shape. More...
 
ModelData_ShapeType Type () const
 Returns a shape type. More...
 
ModelData_ShapeOrientation Orientation () const
 Returns orientation flag. More...
 
ModelData_Shape Reversed () const
 Returns a shape that shares the same geometry and subshape graph but has opposite orientation. More...
 
ModelData_Shape Oriented (ModelData_ShapeOrientation theOrientation) const
 Returns a shape that shares the same geometry and subshape graph and has specified orientation. More...
 
void Nullify ()
 Nullifies the object. More...
 
bool IsNull () const
 Returns true if the object has not been initialized yet.
 
 operator bool () const
 Returns true if the object is not null. More...
 
bool IsEqual (const ModelData_Shape &theOther) const
 Returns true if the shape shares the same geometry and subshape graph, and has equal orientation. More...
 
bool IsSame (const ModelData_Shape &theOther) const
 Returns true if the shape shares the same geometry and subshape graph. More...
 
internal::ModelData_ShapeImpl * Impl () const
 Returns internal implementation object.
 

Static Public Member Functions

static const ModelData_EdgeCast (const ModelData_Shape &theShape)
 
static ModelData_EdgeCast (ModelData_Shape &theShape)
 

Additional Inherited Members

- Protected Member Functions inherited from cadex::ModelData_Shape
 ModelData_Shape (const TopoDS_Shape &theOther, bool)
 Constructor.
 
 ModelData_Shape (internal::ModelData_ShapeImpl *theImpl)
 Constructor.
 
- Protected Attributes inherited from cadex::ModelData_Shape
internal::Base_Handle myImpl
 Internal implementation object.
 

Detailed Description

Defines an edge.

The following image depicts an example of an edge:

edge_256.png
Edge

An edge resides on a curve (returned by Curve()) and is bounded by two vertices returned by StartVertex() and EndVertex(). StartVertex() corresponds to smaller parameter along the curve and EndVertex() - to greater parameter (regardless of own edge orientation). Vertices must always be explicitly defined.

If an edge has forward Orientation() then it is considered to align with the underlying curve. If Orientation() is reversed, then the edge is considered to have an opposite orientation comparing to its underlying curve.

If an edge is owned by a face (via its wire) then this edge must also have a p-curve (parametric curve) defined in a parametric domain of the face surface. If an edge is shared by two faces in a shell then it must have pcurve on each parent face. P-curves are oriented in the same direction as 3D curve. P-curve(s) must be within a tolerance value (returned by Tolerance()) from the 3D curve, i.e. the tolerance can be considered as a radius of a pipe along the 3D curve, in which p-curves (reconstructed on surfaces) must reside.

When importing models from external files or creating from scratch CAD Exchanger also tries to ensure two more strict requirements:

  • "same range": all curve representations (3D curve and all p-curves) have the same definition parametric range (e.g. [a, b]);
  • "same parameter": for any parameter t from range [a, b] a 3D point computed from 3D curve must be within an edge tolerance from a 3D point computed from p-curve and corresponding surface, i.e. |C(t) - S(p(t))| <= tolerance.

Edge tolerance should not exceed vertices tolerances.

Special Types of Edges

Degenerated Edge

An edge is called degenerated if it corresponds to a degenerated curve, e.g. a sphere pole, a cone apex or a B-Spline singularity point. In this case it does not have a 3D curve and only has a pcurve. For instance in the case of a sphere 'north' pole the pcurve is V-isoline V=PI/2.

IsDegenerated() returns true for a degenerated edge.

Seam-edge

An edge is called seam-edge if it corresponds to a curve on a periodical suface that has two pcurve representations in the surface parametric domain. Examples include a curve corresponding to U-isolines of a cylindrical surface with U=0 and U=2*PI.

Although, such seam-edges typically have pcurves corresponding to surface boundary iso-lines (e.g. one corresponding to surface UMin and another to UMax), this is not always the case. Some seam-edges may have pcurves corresponding to arbitrary pairs of isolines shifted by surface period (e.g. one is V* and another V* + V_period). Some seam-edges may have even a pair of free-form pcurves, one shifted by surface period from another. This often happens when importing a file generated by CAD systems/kernels which do not explicitly support seam-edges.

A seam edge occured twice in its parent wire - with forward and reversed orientations. Edge orientation defines which pcurve will be returned by PCurve(). IsSeam() returns true for the seam-edge.

Examples:
brepmodeling/main.cxx, and modelexplorer/main.cxx.

Constructor & Destructor Documentation

◆ ModelData_Edge() [1/3]

cadex::ModelData_Edge::ModelData_Edge ( const ModelData_Curve theCurve)

Constructor.

Creates an edge on entire curve's definition range:

edge_ctor_curve.png
Constructing edge from curve

The curve must have bounded definition range (see ModelData_Curve::Domain()).

◆ ModelData_Edge() [2/3]

cadex::ModelData_Edge::ModelData_Edge ( const ModelData_Curve theCurve,
double  theFirstParameter,
double  theLastParameter 
)

Constructor.

Creates an edge from a curve and explicitly specified parametric range:

edge_ctor_param.png
Constructing edge from curve and parameters

The parameters must be within curve's definition range (see ModelData_Curve::Domain()) unless it is periodic. theLastParameter must be greater than theFirstParameter by at least 1e-9.

◆ ModelData_Edge() [3/3]

cadex::ModelData_Edge::ModelData_Edge ( const ModelData_Curve theCurve,
const ModelData_Vertex theFirstVertex,
const ModelData_Vertex theLastVertex 
)

Constructor.

Creates an edge from a curve and explicitly specified bounding vertices:

edge_ctor_vertex.png
Constructing edge from curve and vertices

The vertices must lie on the curve within their tolerances and within curve's definition range (see ModelData_Curve::Domain()) unless it is periodic.

Member Function Documentation

◆ Curve()

ModelData_Curve cadex::ModelData_Edge::Curve ( double &  theFirstParameter,
double &  theLastParameter 
) const

Returns edge 3D curve and its limits.

Returns null curve for a degenerated edge (see IsDegenerated()).

Examples:
modelexplorer/main.cxx.

◆ EndVertex()

ModelData_Vertex cadex::ModelData_Edge::EndVertex ( ) const

Returns a start vertex.

End vertex corresponds to a point on a curve with greater parameter (regardless of edge orientation).

◆ IsDegenerated()

bool cadex::ModelData_Edge::IsDegenerated ( ) const

Returns true if an edge is degenerated.

A degenerated edge has no 3D curve.

Examples:
modelexplorer/main.cxx.

◆ PCurve()

ModelData_Curve2d cadex::ModelData_Edge::PCurve ( const ModelData_Face theFace,
double &  theFirstParameter,
double &  theLastParameter 
) const

Returns edge p-curve on a face and its limits.

For a seam-edge (IsSeam() returns true), selects p-curve depending on this edge orientation. For a seam-edge both p-curves have the same definition range.

◆ StartVertex()

ModelData_Vertex cadex::ModelData_Edge::StartVertex ( ) const

Returns a start vertex.

Start vertex corresponds to a point on a curve with smaller parameter (regardless of edge orientation).

◆ Tolerance()

double cadex::ModelData_Edge::Tolerance ( ) const

Returns edge tolerance.

See also
ModelData_Vertex::Tolerance().