MbCurve3D Curve

The MbCurve3D class is declared in the curve3d.h file.

The MbCurve3D curve is derived from the MbSpaceItem and MbNestSyncItem classes:

../../../../_images/O.4.1.1.png

A curve is an abstract class. The C3D geometric kernel implements the following curves derived from the MbCurve3D class:

MbLine3D – a straight line;

MbLineSegment3D – a line segment;

MbArc3D – an elliptical arc;

MbPolyline3D – a polyline;

MbNurbs3D – a B-curve (NonUniform Rational B-Spline);

MbBezier3D – a composite Bezier curve;

MbHermit3D – a Hermite curve;

MbCubicSpline3D – a cubic spline;

MbOffsetCurve3D – an offset curve;

MbTrimmedCurve3D – a trimmed curve;

MbReparamCurve3D – a reparameterized curve;

MbConeSpiral – a conical spiral;

MbCurveSpiral – a spiral with a straight axis and a variable radius;

MbCrookedSpiral – a spiral with an axis in the form of a planar curve;

MbBridgeCurve3D – a Hermite spline joining two curves;

MbContour3D – a contour (a composite curve);

MbPlaneCurve – a planar curve in space;

MbSurfaceCurve – a curve on a surface;

MbSilhouetteCurve – a surface silhouette curve;

MbContourOnSurface – a contour on a surface;

MbContourOnPlane – a contour on a plane;

MbSurfaceIntersectionCurve – a surface intersection curve.

The MbCurve3D curve is a vector function

\[\mathbf{\text{curve}}(t) = \begin{bmatrix} x(t) & y(t) & z(t) \end{bmatrix}\]

of a scalar parameter t taking values within the interval [tmin, tmax]. A curve is a continuous mapping of a part of the numerical axis into three-dimensional space. The range of the curve parameter is the interval [tmin, tmax] in one-dimensional space. The coordinates x(t), y(t), z(t) of the curve point curve(t) are single-valued continuous functions of the parameter t.

The boundary values tmin and tmax of the parameter domain are returned by the curve methods double GetTMin() and double GetTMax(), respectively.

A curve is called periodic if there exists p > 0 such that curve(t ± kp) = curve(t), where k is an integer.

The methods

bool IsPeriodic()

and

bool IsClosed()

of a periodic curve return true.

The method

double GetPeriod()

of a periodic curve or a curve that can be extended to a periodic one returns the period p. The parameter domain of a periodic curve always lies within a single period.

A curve is considered periodic if:

  • The start and end points of the curve coincide. The following 3D curve types are not considered periodic when their start and end points coincide, for example, in the case of a degenerate curve; the IsClosed() and IsPeriodic() methods always return false for them:

  • The derivatives at the start and end points coincide. If a curve can inherently have breaks (a contour or a polyline), the derivatives are allowed not to coincide. For a Bezier curve, the derivatives must coincide in direction but may differ in magnitude.

To check whether the start and end points of a curve coincide with a specified tolerance, use the IsTouch() method, which determines coincidence regardless of the smoothness of the closure.

The primary curve method is

void PointOn( double &        t,
              MbCartPoint3D & r )

It returns the radius-vector r of the curve point for a given parameter t.

The methods

void FirstDer( double &      t,
               MbVector3D & rt )
void SecondDer( double &       t,
                MbVector3D & rtt )
void ThirdDer( double &        t,
               MbVector3D & rttt )

return the first rt, second rtt, and third rttt derivatives, respectively, of the curve radius-vector for a given parameter t. These methods correct the curve parameter when it is outside the parameter domain (except for the MbLine3D line). When the curve parameter t is outside the interval [tmin, tmax], non-periodic curves shift the parameter t to the nearest boundary tmin or tmax, while periodic curves add or subtract the required number of periods.

The method

void _PointOn( double          t,
               MbCartPoint3D & r )

returns the radius-vector r of the curve point for a given parameter t both within and outside the curve parameter domain. In the general case, a non-periodic curve outside its parameter domain is extended along the tangent at the boundary point. The exceptions are periodic curves, the MbArc3D arc, MbSpiral spirals, the MbCharacterCurve3D symbolic curve, and the MbTrimmedCurve3D trimmed curve within its base curve. Periodic curves outside their parameter domain are extended cyclically. The methods

void _FirstDer( double &      t,
                MbVector3D & rt )
void _SecondDer( double &       t,
                 MbVector3D & rtt )
void _ThirdDer( double &        t,
                MbVector3D & rttt )

return the first rt, second rtt, and third rttt derivatives, respectively, of the curve radius-vector for a given parameter t both within and outside the curve domain.

Curves override the following methods of a three-dimensional geometric object:

methods for transforming a geometric object:

void Move( const MbVector3D &      to,
                 MbRegTransform *  iReg = nullptr )
void Rotate( const MbAxis3D &       axis,
                   double           angle,
                   MbRegTransform * iReg = nullptr )
void Transform( const MbMatrix3D &     matr,
                     MbRegTransform *  iReg = nullptr )

methods for copying objects, checking equality and similarity, and making objects equal:

MbSpaceItem & Duplicate( MbRegDuplicate * iReg = nullptr )
bool IsSame( const MbSpaceItem & other,
                   double        accuracy = LENGTH_EPSILON )
bool IsSimilar( const MbSpaceItem & item )
bool SetEqual( const MbSpaceItem & item )

methods that return a type from the geometric object enumeration:

MbeSpaceType IsA()
MbeSpaceType Type()
MbeSpaceType Family()

methods for retrieving and editing the internal object data:

MbProperty & CreateProperty( MbePrompt name )
void GetProperties( MbProperties & properties )
void SetProperties( MbProperties & properties )

the method that builds a polygonal copy of a geometric object:

void CalculateMesh( const MbStepData & stepData,
                    const MbFormNote & note,
                          MbMesh &     mesh ) const;

All curves, except for MbContour3D, MbContourOnSurface, and MbContourOnPlane, usually do not have breaks. MbContour3D, MbContourOnSurface, and MbContourOnPlane are composite curves and can have breaks at the junctions of their constituent segments.