Base class for 3D curves. More...

## Public Member Functions

ModelData_Curve ()
Constructor.

ModelData_Curve (const ModelData_Curve &theOther)
Constructor.

ModelData_Curve (ModelData_Curve &&theOther)
Constructor.

~ModelData_Curve ()
Destructor.

ModelData_Curveoperator= (const ModelData_Curve &theOther)
Assignment operator.

ModelData_Curveoperator= (ModelData_Curve &&theOther)
Move assignment operator.

ModelData_CurveType Type () const
Returns a curve type.

bool IsNull () const
Returns true if the object has not been initialized yet. More...

void Nullify ()
Resets the object. More...

operator bool () const
Returns if the object has been initialized. More...

bool IsPeriodic () const
Returns true if the curve is periodic.

double UMin () const
Returns a minimum parameter of a definition domain. More...

double UMax () const
Returns a maximum parameter of a definition domain. More...

void Domain (double &theUMin, double &theUMax) const
Returns a definition domain. More...

ModelData_Point Value (double theParameter) const
Evaluates a point on the curve. More...

ModelData_Curve Reversed () const
Returns a curve with reversed orientation. More...

void Transform (const ModelData_Transformation &theTransformation)
Applies transformation matrix to this object. More...

ModelData_Curve Transformed (const ModelData_Transformation &theTransformation) const
Returns a copy this object after applying transformation. More...

ModelData_Continuity Continuity () const
Returns a continuity type of the curve.

void D0 (double theParameter, ModelData_Point &theValue) const
Returns the point theValue of parameter theParam. More...

void D1 (double theParameter, ModelData_Point &theValue, ModelData_Vector &theD1) const
Returns the point theValue of parameter theParam and the first derivative theD1. More...

void D2 (double theParameter, ModelData_Point &theValue, ModelData_Vector &theD1, ModelData_Vector &theD2) const
Returns the point theValue of parameter theParam and second derivatives theD1 and theD2. More...

bool DN (double theParameter, size_t theDerivativeOrder, ModelData_Point &theValue, ModelData_Vector theD[]) const

double Curvature (double theParameter) const
Returns the curvature value of parameter theParam.

void Normal (double theParameter, ModelData_Direction &theNormal) const
Returns the normal direction theNormal of parameter theParam.

void Mirror (const ModelData_Point &thePoint)
Mirrors the curve relative to the point.

void Mirror (const ModelData_Axis1Placement &theAxis)
Mirrors the curve relative to the axis placement.

void Mirror (const ModelData_Axis2Placement &theAxis)
Mirrors the curve relative to the axis placement.

ModelData_Curve Mirrored (const ModelData_Point &theRef) const
Returns a copy this curve mirrored along the object. More...

ModelData_Curve Mirrored (const ModelData_Axis1Placement &theAxis) const
Returns a copy this curve mirrored along the object. More...

ModelData_Curve Mirrored (const ModelData_Axis2Placement &theAxis) const
Returns a copy this curve mirrored along the object. More...

void Rotate (const ModelData_Axis1Placement &theAxis, double theAngle)
Rotates the curve around the axis.

ModelData_Curve Rotated (const ModelData_Axis1Placement &theAxis, double theAngle) const
Returns a copy this curve rotated along the axis. More...

void Translate (const ModelData_Vector &theVector)
Translates the curve along the vector.

ModelData_Curve Translated (const ModelData_Vector &theVector) const
Returns a copy this curve translated along the vector. More...

void Scale (const ModelData_Point &thePoint, double theScale)
Scales the curve with respect to the point.

ModelData_Curve Scaled (const ModelData_Point &thePoint, double theScale) const
Returns a copy this curve scaled with respect to the point. More...

## Public Attributes

operator Handle_C const

## Detailed Description

Base class for 3D curves.

3D curves are used to represent curves in 3D space. Each non-degenerated edge must refer to a 3D curve.

# Types

Refer to Curve Types for the list of supported curve types. Type() returns a curve type as enumeration value which can be used to downcast to a respective subclass type, for instance:

ModelData_Curve aCurve = ...;
if (aCurve.Type() == ModelData_CT_Circle) {
const ModelData_Circle& aCircle = static_cast<const ModelData_Circle&> (aCurve);
...
}

# Parametric Definition

Curve is defined using parametric definition as $$\mathbf{C}(t)$$ where $$\mathbf{C}$$ is a 3D radius-vector $$(x,y,z)^\top$$ and $$t$$ is a parameter from a definition range $$[a, b]$$.

UMin() and UMax(), and Domain() return parametric definition range. Parametric range can be bounded (e.g. $$[0, 2\pi]$$ for a circle) or unbounded (e.g. $$(-\infty, +\infty)$$ for a line).

# Evaluation

At any parameter $$t$$ within a definition range, the curve can be evaluated as follows:

• Value() and D0() return a 3D point;
• D1(), D2() and DN() return a derivative of a respective order;
• Curvature() returns a curvature;
• Normal() returns a normal to the curve (i.e. perpendicular to its first derivative).

The following example demonstrates computation of a point on a line at parameter t=2:

ModelData_Line aLine = ...;
ModelData_Point aPoint = aLine.Value (2.);

If the curve is periodic (IsPeriodic() returns true) then the curve can be evaluated at any parameter t, otherwise behavior is undefined (e.g. an exception can be thrown or a weird value can be returned).

# Continuity

Continuity() returns continuity ( $$C^0$$, $$C^1$$, $$C^2$$, $$C^N$$) of the curve, where $$C^0$$ that only the curve itself is continuous, $$C^1$$ - that the curve is continuous together with its first derivative, and so on.

# Transformation

The curve can be modified using the following operations:

Warning
As the curve data is shared via internal pointer modification of the curve may affect other users of the curve (e.g. an edge referring to it). So you might want to use method returning a modified copy of the curve (such as Transformed()).
Curves, ModelData_Curve2d, ModelData_Edge, ModelData_Surface.
Examples
exploring/brepgeometry/main.cxx, exploring/breprepresentation/main.cxx, and modeling/assembly/main.cxx.

## ◆ D0()

 void cadex::ModelData_Curve::D0 ( double theParam, ModelData_Point & theValue ) const

Returns the point theValue of parameter theParam.

Throws exception only for the ModelData_OffsetCurve if it is not possible to compute the current point. For example when the first derivative on the basis curve and the offset direction are parallel.

## ◆ D1()

 void cadex::ModelData_Curve::D1 ( double theParam, ModelData_Point & theValue, ModelData_Vector & theD1 ) const

Returns the point theValue of parameter theParam and the first derivative theD1.

Throws exception if the continuity of the curve is not $$C^1$$.

## ◆ D2()

 void cadex::ModelData_Curve::D2 ( double theParam, ModelData_Point & theValue, ModelData_Vector & theD1, ModelData_Vector & theD2 ) const

Returns the point theValue of parameter theParam and second derivatives theD1 and theD2.

Throws exception if the continuity of the curve is not $$C^2$$.

## ◆ DN()

 bool cadex::ModelData_Curve::DN ( double theParam, size_t theDerivativeOrder, ModelData_Point & theValue, ModelData_Vector theD[] ) const

Returns true if calculation completed successfully. In this case theD contains values of the derivatives from 0 up to theDerivativeOrder. Otherwise returns false. May throw exception if the continuity of the curve is less than theDerivativeOrder.

Parameters:

• theDerivativeOrder must belong to range [0, 3].
• theD should have size to store theDerivativeOrder derivatives (i.e. theDerivativeOrder or more).

## ◆ Domain()

 void cadex::ModelData_Curve::Domain ( double & theUMin, double & theUMax ) const

Returns a definition domain.

UMin(), UMax().

## ◆ IsNull()

Returns true if the object has not been initialized yet.

Nullify().

## ◆ Mirrored() [1/3]

 ModelData_Curve cadex::ModelData_Curve::Mirrored ( const ModelData_Axis1Placement & theAxis ) const

Returns a copy this curve mirrored along the object.

The contents of this object is not modified.

Mirror().

## ◆ Mirrored() [2/3]

 ModelData_Curve cadex::ModelData_Curve::Mirrored ( const ModelData_Axis2Placement & theAxis ) const

Returns a copy this curve mirrored along the object.

The contents of this object is not modified.

Mirror().

## ◆ Mirrored() [3/3]

 ModelData_Curve cadex::ModelData_Curve::Mirrored ( const ModelData_Point & theRef ) const

Returns a copy this curve mirrored along the object.

The contents of this object is not modified.

Mirror().

## ◆ Nullify()

Resets the object.

IsNull() will return true after calling this method.

## ◆ operator bool()

inline

Returns if the object has been initialized.

Returns the value opposite to IsNull().

## ◆ Reversed()

Returns a curve with reversed orientation.

Creates a deep copy of the curve which does not share any definition with this object.

## ◆ Rotated()

 ModelData_Curve cadex::ModelData_Curve::Rotated ( const ModelData_Axis1Placement & theAxis, double theAngle ) const

Returns a copy this curve rotated along the axis.

The contents of this object is not modified.

Rotate().

## ◆ Scaled()

 ModelData_Curve cadex::ModelData_Curve::Scaled ( const ModelData_Point & thePoint, double theScale ) const

Returns a copy this curve scaled with respect to the point.

The contents of this object is not modified.

Scale().

## ◆ Transform()

 void cadex::ModelData_Curve::Transform ( const ModelData_Transformation & theTransformation )

Applies transformation matrix to this object.

Results depends on the actual curve type.

Transformed().

## ◆ Transformed()

 ModelData_Curve cadex::ModelData_Curve::Transformed ( const ModelData_Transformation & theTransformation ) const

Returns a copy this object after applying transformation.

The contents of this object is not modified.

Transform().

## ◆ Translated()

 ModelData_Curve cadex::ModelData_Curve::Translated ( const ModelData_Vector & theVector ) const

Returns a copy this curve translated along the vector.

The contents of this object is not modified.

Translate().

## ◆ UMax()

Returns a maximum parameter of a definition domain.

UMin(), Domain().
Examples
exploring/brepgeometry/main.cxx.

## ◆ UMin()

Returns a minimum parameter of a definition domain.

UMax(), Domain().
Examples
exploring/brepgeometry/main.cxx.

## ◆ Value()

 ModelData_Point cadex::ModelData_Curve::Value ( double theParameter ) const

Evaluates a point on the curve.

theParameter must be within Domain() if the curve is not periodic.

ModelData_Curve()
Constructor.
Definition: ModelData_Curve.cxx:134