C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
Construction of uv-Curves in Two-Dimensional Space
+ Collaboration diagram for Construction of uv-Curves in Two-Dimensional Space:

Enumerations

enum  MbeArcCreateWay {
  acw_CircleByCenterAndRadius , acw_ArcByCenterAnd2Points , acw_ArcByCenterAnd2Angles , acw_ArcBy3Points ,
  acw_EllipseByCenterAndSemiaxis , acw_EllipseByCenterAnd3Points , acw_EArcByCenterAnd2Points
}
 Enumeration of ways to create an ellipse (circle) or their arcs in two-dimensional space. More...
 
enum class  MbeCurveExtensionWays : unsigned int {
  cew_Linear = 0 , cew_Circular = 1 , cew_CommonNatural = 2 , cew_BaseNatural = 3 ,
  cew_Undefined
}
 Enumeration of ways to extend the curve. More...
 

Functions

MbResultType Line (const MbCartPoint &point1, const MbCartPoint &point2, MbCurve *&result)
 Create a line. More...
 
MbResultType Segment (const MbCartPoint &point1, const MbCartPoint &point2, MbCurve *&result)
 Create a line segment. More...
 
MbResultType Arc (MbeArcCreateWay createWay, const MbCartPoint &center, const c3d::ParamPointsVector &points, double &a, double &b, double &c, bool option, MbCurve *&result)
 Create an ellipse (circle) or an elliptical (circular) arc in the specified way. More...
 
MbResultType SplineCurve (const SArray< MbCartPoint > &pointList, bool curveClosed, MbePlaneType curveType, MbCurve *&result)
 Create a curve passing through a set of points. More...
 
MbResultType NurbsCurve (const SArray< MbCartPoint > &pointList, const SArray< double > &weightList, size_t degree, const SArray< double > &knotList, bool curveClosed, MbCurve *&result)
 Create a NURBS-curve. More...
 
double FittingCurve (const std::vector< MbCartPoint > &pointList, bool curveClosed, size_t degree, size_t mode, double &accuracy, MbCurve *&result)
 Create a Nurbs curve with sorting points by distance passing through a set of points. More...
 
MbResultType NurbsCopy (const MbCurve &curve, MbCurve *&result)
 Create a copy of a curve as a NURBS-curve. More...
 
MbResultType RegularPolygon (const MbCartPoint &centre, const MbCartPoint &point, size_t vertexCount, bool describe, MbCurve *&result)
 Create a regular polygon inscribed in a circle or circumscribed around a circle. More...
 
MbResultType Cosinusoid (const MbCartPoint &point0, const MbCartPoint &point1, const MbCartPoint &point2, double phase, double waveLength, MbCurve *&result)
 Create a cosine curve. More...
 
MbResultType Cosinusoid (const MbCartPoint &origin, double amplitude, double waveLength, double wavesCount, double phase, MbCurve *&result)
 Create a cosine curve. More...
 
MbResultType CreateContour (MbCurve &curve, MbContour *&result)
 Create a composite curve (contour). More...
 
MbCurveDuplicateCurve (const MbCurve &curve, VERSION version=Math::DefaultMathVersion())
 Create a copy of a curve. More...
 
MbContourDuplicateContour (const MbContour &cntr, bool modifySegments, VERSION version, MbSNameMaker *names=nullptr)
 Create a copy of a contour. More...
 
MbCurveOffsetCurve (const MbCurve &curve, double offset1, double offset2, MbeOffsetType type)
 Create an offset curve. More...
 
MbContourOffsetContour (const MbContour &cntr, double rad, double xEpsilon, double yEpsilon, bool modifySegments, VERSION version=Math::DefaultMathVersion())
 Create an offset contour. More...
 
MbContourAxisOffsetOpenContour (const MbContour &cntr, const MbCartPoint &q1, const MbCartPoint &q2, double rad, double xEpsilon, double yEpsilon, VERSION version)
 Create an offset contour with start and end points on the rotation axis. More...
 
bool CurveTrim (MbCurve &curve, double t1, double t2, double eps=METRIC_PRECISION)
 Initialize a curve with new parameters. More...
 
MbResultType AddCurveToContour (MbCurve &curve, MbContour &contour, bool toEnd, double epsilon=METRIC_REGION)
 Add a curve to a composite curve (a contour). More...
 
MbContourMakeContour (std::vector< MbCurve * > &curves, double accuracy, VERSION version=Math::DefaultMathVersion())
 Create a contour by curves. More...
 
void CurveSection (const MbCurve3D &curve, const MbPlacement3D &place, SArray< MbCartPoint > &result, RPArray< MbCurve > &resultCurve, VERSION version=Math::DefaultMathVersion())
 Calculate the intersections of a curve and a surface. More...
 
void SurfaceSection (const MbSurface &surface, const MbPlacement3D &place, RPArray< MbCurve > &result, VERSION version=Math::DefaultMathVersion())
 Calculate the intersections of a surface and a plane. More...
 
MbResultType FaceBoundSegment (const MbFace &face, size_t loopInd, size_t edgeInd, const MbSurface &surface, VERSION version, MbCurve *&result)
 Create a two-dimensional segment on a surface by projection of an oriented edge. More...
 
MbResultType SurfaceBoundContour (const MbSurface &surface, const MbCurve3D &spaceCurve, VERSION version, MbContour *&result)
 Create a two-dimension boundary of a surface by projection of a space curve. More...
 
bool IsLikeStraightLine (const MbCurve &curve, double eps)
 Whether the curve is like straight-line regardless of its parameterization. More...
 
MbContourDeleteDegenerateSegments (const MbContour &cntr, bool modifySegments, VERSION verison, MbSNameMaker *names=nullptr)
 Delete degenerate segments from contour. More...
 
bool CreateCenterLineCurves (const MbFace &face, std::vector< MbCurve3D * > &clCurves)
 Create center lines of shell face. More...
 
ptrdiff_t CircleTanLineLineRad (const MbLine &pl1, const MbLine &pl2, double rad, MbTempCircle *pc)
 Calculate centers of circles. More...
 
ptrdiff_t CircleTanLineCircleRadius (const MbLine &pl1, const MbArc &pc1, double rad, MbTempCircle *pc)
 Calculate centers of circles. More...
 
ptrdiff_t CircleTanCircleCircleRad (const MbArc &pc1, const MbArc &pc2, double rad, MbTempCircle *pc)
 Calculate centers of circles. More...
 
void CircleTanCurveCentre (const MbCurve &pCurve, const MbCartPoint &pnt, PArray< MbTempCircle > &pCircle)
 Create circles. More...
 
void CircleTangentCurveTwoPoints (const MbCurve &pCurve, const MbCartPoint &on1, const MbCartPoint &on2, PArray< MbTempCircle > &pCircle)
 Create circles. More...
 
void CircleTangentCurveRPointOn (const MbCurve &pCurve, double radius, const MbCartPoint &on, PArray< MbTempCircle > &pCircle)
 Create circles. More...
 
void CircleTanTwoCurvesRadius (const MbCurve &pCurve1, const MbCurve &pCurve2, double rad, PArray< MbTempCircle > &pCircle)
 Create circles. More...
 
void CircleTanTwoCurvesPointOn (const MbCurve &pCurve1, const MbCurve &pCurve2, const MbCartPoint &pOn, PArray< MbTempCircle > &pCircle)
 Create circles. More...
 
void CircleOriginOneTangentTwo (const MbCurve &pCurve1, const MbCurve &pCurve2, const MbCartPoint &pp, RPArray< MbTempCircle > &pCircle)
 Create circles. More...
 
void CircleTanCurvePointOnAngle (const MbCurve &curve, const MbCartPoint &p1, double angle, PArray< MbTempCircle > &circles)
 Create circles. More...
 
void ArcTangentCurveTwoPoints (const MbCurve &pCurve, const MbCartPoint &on1, const MbCartPoint &on2, PArray< MbArc > &arc)
 Create arcs of circles. More...
 
void ArcTangentCurveRPointOn (const MbCurve &pCurve, double radius, const MbCartPoint &on, PArray< MbArc > &arc)
 Create arcs of circles. More...
 
void ArcTangentCurveContinue (const MbLine &line, const MbCartPoint &p2, PArray< MbArc > &arc)
 Create a circle arc. More...
 
void ArcTangentCurveRadContinue (const MbLine &line, double rad, const MbCartPoint &p2, PArray< MbArc > &arc)
 Create a circle arc. More...
 
void CircleTanThreeCurves (const MbCurve *curve1, const MbCurve *curve2, const MbCurve *curve3, const MbCartPoint &pnt, PArray< MbTempCircle > &circle)
 Create circles. More...
 
void CreateNewCircles (PArray< MbTempCircle > &cTmp, PArray< MbArc > &pCircle)
 Copy temporary circles. More...
 
void LineParallelPoint (const MbCartPoint &p, const MbLine &pl, MbLine &pl_par)
 Construct a line parallel to a given line. More...
 
void LineParallelDistance (double delta, const MbLine &pl, MbLine &pl_par)
 Construct a line parallel to a given line. More...
 
int LineBisector (const MbCartPoint &p, const MbLine &pl1, const MbLine &pl2, MbLine &pl3)
 Construct a line passing through a given point. More...
 
void LinePointAngle (double angle, const MbCartPoint &p, const MbLine &pl, MbLine &pl_new)
 Construct a line passing at angle. More...
 
bool EllipsePntPntDist (const MbCartPoint &p1, const double &l1, const MbCartPoint &p2, double &l2, MbCartPoint &pc, double &angle)
 Construct an ellipse. More...
 
void LinePointPerpCurve (const MbCartPoint &pnt, const MbCurve &pCurve, PArray< MbLine > &pLine)
 Construct a line passing through a given point. More...
 
int LinePointTangentCircle (const MbCartPoint &p, const MbCartPoint &centre, double radius, MbLine *pl)
 Construct a line passing through a given point. More...
 
void CircleCentreOnCurveRadPointOn (const MbCurve &pCurve, double radius, const MbCartPoint &on, PArray< MbTempCircle > &pCircle)
 Construct a circle. More...
 
void CircleCentreOnCurveTwoPoints (const MbCurve &pCurve, const MbCartPoint &on1, const MbCartPoint &on2, PArray< MbTempCircle > &pCircle)
 Construct a circle. More...
 
int Arc2PointsRadius (const MbCartPoint &p1, const MbCartPoint &p2, double rad, bool clockwise, MbArc *arc)
 Construct a circle arc. More...
 
MbCurveCanonicToParametricConic (double A, double B, double C, double D, double E, double F, double X1, double Y1, double X2, double Y2)
 Construct curves. More...
 
void LinePointTangentCurve (const MbCartPoint &pnt, const MbCurve &pCurve, PArray< MbLine > &pLine, bool lineAsCurve=false)
 Construct a line. More...
 
void LineAngleTangentCurve (double angle, const MbCurve &pCurve, PArray< MbLine > &pLine)
 Construct lines passing at angle. More...
 
ptrdiff_t LineTan2Circles (const MbCartPoint &centre1, double radius1, const MbCartPoint &centre2, double radius2, MbLine *pl, MbCartPoint *sp)
 Construct lines tangent to circles. More...
 
void LineTangentTwoCurves (const MbCurve *pCurve1, const MbCurve *pCurve2, PArray< MbLine > *pLine, SArray< MbCartPoint > *secodnPnt)
 Construct a tangent line. More...
 
ptrdiff_t LineAngleTanCircle (double angle, const MbCartPoint &centre, double radius, MbLine *pLine)
 Construct lines passing at angle. More...
 
void SwapLines (MbLine &l1, MbLine &l2)
 Swap lines. More...
 
MbCurveNurbsConic_1 (const MbCartPoint &mbPoint0, const MbCartPoint &mbPoint1, const MbCartPoint &mbPoint2, double fDiscr)
 Construct a conic section by two points, an angle vertex and a discriminant. More...
 
MbCurveNurbsConic_2 (std::vector< MbCartPoint > &vmbConicPoints, const MbCartPoint &mbVertex)
 Construct a conic section by three points, and an angle vertex. More...
 
MbCurveNurbsConic_3 (const std::vector< MbCartPoint > &vmbConicPoints, MbVector &mbTangent1, MbVector &mbTangent2)
 Construct a conic section by three points and two inclinations. More...
 
MbCurveNurbsConic_4 (const MbCartPoint &mbPoint1, const MbCartPoint &mbPoint2, const MbVector &mbTangent1, const MbVector &mbTangent2, double fDiscr)
 Construct a conic section by two points, two inclinations and a discriminant. More...
 
MbCurveNurbsConic_5 (const std::vector< MbCartPoint > &vmbConicPoints, MbVector &mbTangent1, size_t tanPntNb=1)
 Construct a conic section by four points, and an inclination. More...
 
MbCurveNurbsConic_6 (const std::vector< MbCartPoint > &vmbConicPoints)
 Construct a conic section by five points. More...
 
void CreateSmoothFromBezier (const MbBezier &bez, RPArray< MbCurve > &arCurve, bool bline)
 Create a smooth curve from a Bezier curve. More...
 
MbCurveConvertNurbsToCurveOfType (const MbNurbs &nurbs, MbePlaneType type, double eps)
 Create a curve of a given type as NURBS-curve. More...
 
void CreateSurfaceHide (const MbSurface &surf, const MbPlacement3D &eyePlace, double sag, RPArray< MbCurve > &hideCurves, VERSION version=Math::DefaultMathVersion())
 Get the array of surface silhouette curves of planar projection. More...
 
template<class Nurbs , class PointsVector , class DoubleVector >
bool CreateNurbsLSMClosed (SPtr< Nurbs > &nurbs, const ptrdiff_t degree, const ptrdiff_t pCount, const PointsVector &aPoints, const DoubleVector &aKnots, const DoubleVector *aParams=nullptr)
 Construction of closed spline. More...
 
template<class Nurbs , class PointsVector , class DoubleVector >
bool CreateNurbsLSM (SPtr< Nurbs > &nurbs, const ptrdiff_t degree, const ptrdiff_t pCount, const PointsVector &aPoints, const DoubleVector &aKnots, const DoubleVector *aParams=nullptr)
 Construction of non-closed spline. More...
 
MbResultType ApproximatePolylineByNurbs (const MbApproxNurbsParameters< MbCartPoint, MbVector, MbNurbs > &param, MbApproxNurbsCurveResult< MbNurbs > &result)
 Approximate 2D points by NURBS curve. More...
 

Detailed Description

Enumeration Type Documentation

◆ MbeArcCreateWay

Enumeration of ways to create an ellipse (circle) or their arcs in two-dimensional space.

Enumerator
acw_CircleByCenterAndRadius 

Circle by center and radius, set the 'center' and radius in 'c'.

acw_ArcByCenterAnd2Points 

Circular arc by center and two points. Set: 'center', two points in 'points', direction in 'option' (true - clockwise direction). Return: start angle in 'a', end in 'b', radius in 'c'.

acw_ArcByCenterAnd2Angles 

Circular arc by center and two angles, Set: 'center', start angle in 'a', end in 'b', radius in 'c', direction in 'option' (true - clockwise direction). The angles are given in radians.

acw_ArcBy3Points 

Circular arc by three points specified in 'points', points[0] and points[2] are the end point. Return: start angle in 'a', end in 'b', radius in 'c'.

acw_EllipseByCenterAndSemiaxis 

Ellipse by semiaxes and angle. Set : 'center', X semiaxis in 'a', Y semiaxis in 'b', angle in 'c'. The angle are given in radians.

acw_EllipseByCenterAnd3Points 

Ellipse by centre and three points on ellipse. Set: 'center', 3 points in 'points'. Return: X semiaxis in 'a', Y semiaxis in 'b', angle in 'c'. The angle are given in radians.

acw_EArcByCenterAnd2Points 

Elliptical arc is trimmed by two rays, starting from the center and passing through points. Set: 'center', 2 points in 'points', X semiaxis in 'a', Y semiaxis in 'b', angle in 'c', direction in 'option' (true - clockwise direction). The angle are given in radians.

◆ MbeCurveExtensionWays

enum MbeCurveExtensionWays : unsigned int
strong

Enumeration of ways to extend the curve.

Enumerator
cew_Linear 

The curve is extended by tangent at the boundary point.

cew_Circular 

The curve is extended by an osculating circle at the boundary point.

cew_CommonNatural 

The curve is extended with keeping its parametric equation (if the curve is piecewise-defined then the definition in the neighborhood at the boundary point is meant). If the curve does not have an analytical representation (e.g. its points are specified by the Newton method) then the extending segment will be computed in order to provide a smoothness at the joining point not worse C3. ~.

cew_BaseNatural 

Currently, it is not implemented.

cew_Undefined 

Not set.

Function Documentation

◆ Line()

MbResultType Line ( const MbCartPoint point1,
const MbCartPoint point2,
MbCurve *&  result 
)

Create a line.

Create a line given two points.

Parameters
[in]point1- The first point.
[in]point2- The second point.
[out]result- The line.
Returns
Returns operation result code.

◆ Segment()

MbResultType Segment ( const MbCartPoint point1,
const MbCartPoint point2,
MbCurve *&  result 
)

Create a line segment.

Create a line segment given two points.

Parameters
[in]point1- The first point.
[in]point2- The second point.
[out]result- The segment.
Returns
Returns operation result code.

◆ Arc()

MbResultType Arc ( MbeArcCreateWay  createWay,
const MbCartPoint center,
const c3d::ParamPointsVector points,
double &  a,
double &  b,
double &  c,
bool  option,
MbCurve *&  result 
)

Create an ellipse (circle) or an elliptical (circular) arc in the specified way.

Create an ellipse (circle) or an elliptical (circular) arc in the specified way.
The input parameters are interpreted according to the selected create way.

Parameters
[in]createWay- Create way. Defines how to interpret the input parameters.
[in]center- Center.
[in]points- Endpoints or points through which the curve passes.
[in,out]a- Interpretation of parameter depends on a way of creation of an arc, see enum #ArcCreateWay.
[in,out]b- Interpretation of parameter depends on a way of creation of an arc, see enum #ArcCreateWay.
[in,out]с- Interpretation of parameter depends on a way of creation of an arc, see enum #ArcCreateWay.
[in]option- Interpretation of parameter depends on a way of creation of an arc, see enum #ArcCreateWay.
[out]result- The ellipse (circle) or the elliptical (circular) arc.
Returns
Returns operation result code.

◆ SplineCurve()

MbResultType SplineCurve ( const SArray< MbCartPoint > &  pointList,
bool  curveClosed,
MbePlaneType  curveType,
MbCurve *&  result 
)

Create a curve passing through a set of points.

Create a curve passing through a set of points that has the following type:

  • curveType == pt_LineSegment - a line segment,
  • curveType == pt_Arc - a circle or an arc,
  • curveType == pt_Polyline - a polyline,
  • curveType == pt_Bezier - a Bezier curve,
  • curveType == pt_CubicSpline - a cubic spline,
  • curveType == pt_Hermit - a cubic Hermite spline,
  • curveType == pt_Nurbs - a nonuniform rational B-spline of fourth order (cubic).
    Parameters
    [in]pointList- A point set.
    [in]curveClosed- A curve closedness.
    [in]curveType- A curve type.
    [out]result- The curve.
    Returns
    Returns operation result code.

◆ NurbsCurve()

MbResultType NurbsCurve ( const SArray< MbCartPoint > &  pointList,
const SArray< double > &  weightList,
size_t  degree,
const SArray< double > &  knotList,
bool  curveClosed,
MbCurve *&  result 
)

Create a NURBS-curve.

Create a NURBS-curve given a sequence of control points.
Container 'weightList' can be empty.
Container 'knotList' can be empty.

Parameters
[in]pointList- An array of points.
[in]weightList- An array of weights.
[in]degree- A spline degree.
[in]knotList- An array of parametric knots (A knot vector).
[in]curveClosed- A curve closedness.
[out]result- The spline curve.
Returns
Returns operation result code.

◆ FittingCurve()

double FittingCurve ( const std::vector< MbCartPoint > &  pointList,
bool  curveClosed,
size_t  degree,
size_t  mode,
double &  accuracy,
MbCurve *&  result 
)

Create a Nurbs curve with sorting points by distance passing through a set of points.

Create a Nurbs curve with sorting points by distance passing through a set of points that has the following type:

Parameters
[in]pointList- The initial curve.
[in]curveClosed- Closure of the curve.
[in]degree- A curve degree (for Nurbs).
[in]mode- A Curve construction option.
[in/out]accuracy - Thye desired accuracy / max deviation of constructed curve.
[out]result- The constructed curve.
Returns
Returns average deviation of constructed curve.

◆ NurbsCopy()

MbResultType NurbsCopy ( const MbCurve curve,
MbCurve *&  result 
)

Create a copy of a curve as a NURBS-curve.

Create a copy of a curve as a NURBS-curve.

Parameters
[in]curve- The initial curve.
[out]result- The spline copy of the curve.
Returns
Returns operation result code.

◆ RegularPolygon()

MbResultType RegularPolygon ( const MbCartPoint centre,
const MbCartPoint point,
size_t  vertexCount,
bool  describe,
MbCurve *&  result 
)

Create a regular polygon inscribed in a circle or circumscribed around a circle.

Create a regular polygon inscribed in a circle (describe == false) or circumscribed around a circle (describe == true) with the specified centre and passing through the given point:

  • if vertexCount == 0, a circle with center 'center' passing through 'point' is created,
  • if vertexCount == 1, a line segment with end points at 'centre' and 'point' is created,
  • if vertexCount, == 2 a rectangle aligned with the global axes with the opposite vertices at points 'centre' and 'point' is created,
  • if vertexCount >= 3, a regular polygon is created with a given number of sides, inscribed in a circle (describe == false) or circumscribed around a circle (describe == true) with the specified centre and passing through the given point:
    Parameters
    [in]centre- A figure centre.
    [in]point- A point for the curve construction.
    [in]vertexCount- The number of vertices of a regular polygon.
    [in]describe- A polygon construction flag: circumscribe the polygon around the circle, inscribe the polygon in the circle (false).
    [out]result- The curve creation result.
    Returns
    Returns operation result code.

◆ Cosinusoid() [1/2]

MbResultType Cosinusoid ( const MbCartPoint point0,
const MbCartPoint point1,
const MbCartPoint point2,
double  phase,
double  waveLength,
MbCurve *&  result 
)

Create a cosine curve.

Create a cosine curve given the points, phase and wave length.

Parameters
[in]point0- The origin of local coordinate system (LCS).
[in]point1- A point on the X-axis of LCS.
[in]point2- A point on the Y-axis of LCS.
[in]phase- The phase.
[in]waveLength- The wave length.
[out]result- The cosine curve.
Returns
Returns operation result code.

◆ Cosinusoid() [2/2]

MbResultType Cosinusoid ( const MbCartPoint origin,
double  amplitude,
double  waveLength,
double  wavesCount,
double  phase,
MbCurve *&  result 
)

Create a cosine curve.

Create a cosine curve given the points, phase and wave length.

Parameters
[in]origin- The origin of local coordinate system (LCS).
[in]amplitude- The amplitude of the wave.
[in]waveLength- The wave length.
[in]wavesCount- The number of waves.
[in]phase- The phase.
[out]result- The cosine curve.
Returns
Returns operation result code.

◆ CreateContour()

MbResultType CreateContour ( MbCurve curve,
MbContour *&  result 
)

Create a composite curve (contour).

Create a composite curve (contour) on the basis of the given curve.

Parameters
[in]curve- The initial curve.
[out]result- The contour created on the basis of the curve.
Returns
Returns operation result code.

◆ DuplicateCurve()

MbCurve* DuplicateCurve ( const MbCurve curve,
VERSION  version = Math::DefaultMathVersion() 
)

Create a copy of a curve.

Create a copy of a curve with substitution of some curves.

Parameters
[in]curve- The initial curve.
[in]version- The version.
Returns
Returns a modified copy of the curve if it has been successfully created.

◆ DuplicateContour()

MbContour* DuplicateContour ( const MbContour cntr,
bool  modifySegments,
VERSION  version,
MbSNameMaker names = nullptr 
)

Create a copy of a contour.

Create a copy of a contour with substitution of some curves and its modification according to the flag. Modification is a merging of similar curves and deleting of degenerate ones.

Parameters
[in]cntr- The initial contour.
[in]modifySegments- The flag determines whether segments can be replaced or merged.
[in]version- The version.
[in]names- An object defining the names synchronized with contour.
Returns
Returns a modified copy of the contour if it has been successfully created.

◆ OffsetCurve()

MbCurve* OffsetCurve ( const MbCurve curve,
double  offset1,
double  offset2,
MbeOffsetType  type 
)

Create an offset curve.

Create the offset curve for a given curve with offset in the begin and the end points.

Parameters
[in]curve- Base curve.
[in]offset1- Offset distance on point Tmin of base curve.
[in]offset2- Offset distance on point Tmax of base curve.
[in]type- The offset type: constant, or linear, or cubic.
Returns
Returns the offset curve.

◆ OffsetContour()

MbContour* OffsetContour ( const MbContour cntr,
double  rad,
double  xEpsilon,
double  yEpsilon,
bool  modifySegments,
VERSION  version = Math::DefaultMathVersion() 
)

Create an offset contour.

Create the offset contour for a given contour.

Parameters
[in]cntr- The initial contour.
[in]rad- The offset value.
[in]xEpsilon- Tolerance in x direction.
[in]yEpsilon- Tolerance in y direction.
[in]modifySegments- The flag determines whether segments can be replaced or merged.
[in]version- The version.
Returns
Returns the offset contour if it has been successfully created.

◆ AxisOffsetOpenContour()

MbContour* AxisOffsetOpenContour ( const MbContour cntr,
const MbCartPoint q1,
const MbCartPoint q2,
double  rad,
double  xEpsilon,
double  yEpsilon,
VERSION  version 
)

Create an offset contour with start and end points on the rotation axis.

Create an open offset contour with start and end points on the rotation axis.
It is considered that if one closes the contour, it will be oriented counterclockwise.

Parameters
[in]cntr- The initial contour.
[in]q1- The start point of the rotation axis.
[in]q2- The end point of the rotation axis.
[in]rad- The offset value.
[in]xEpsilon- Tolerance in x direction.
[in]yEpsilon- Tolerance in y direction.
[in]version- The version.
Returns
Returns the offset contour if it has been successfully created.

◆ CurveTrim()

bool CurveTrim ( MbCurve curve,
double  t1,
double  t2,
double  eps = METRIC_PRECISION 
)

Initialize a curve with new parameters.

Initialize a curve with new parameters.

Parameters
[in,out]curve- The curve to be modified.
[in]t1- A new start parameter.
[in]t2- A new end parameter.
[in]eps- Tolerance.
Returns
Returns 'true' if the curve has been successfully modified.

◆ AddCurveToContour()

MbResultType AddCurveToContour ( MbCurve curve,
MbContour contour,
bool  toEnd,
double  epsilon = METRIC_REGION 
)

Add a curve to a composite curve (a contour).

Add a curve to a composite curve (a contour) 'contour'.
If toEnd == true, the curve is to be added to the end.
If toEnd == false, the curve is to be added to the beginning.

Parameters
[in]curve- A curve to be added.
[in,out]contour- A contour to be modified.
[in]toEnd- The flag determines the place of the curve in the contour.
[in]epsilon- The Proximity of the junction points.
Returns
Returns operation result code.

◆ MakeContour()

MbContour* MakeContour ( std::vector< MbCurve * > &  curves,
double  accuracy,
VERSION  version = Math::DefaultMathVersion() 
)

Create a contour by curves.

Curves will be added to the contour, it is possible to invert the direction of some curves. Unused curves will be deleted.

Parameters
[in]curve- Curves of the contour.
[in]accuracy- The maximum distance of segment points at the junction.
Returns
Returns contour or nullptr.

◆ CurveSection()

void CurveSection ( const MbCurve3D curve,
const MbPlacement3D place,
SArray< MbCartPoint > &  result,
RPArray< MbCurve > &  resultCurve,
VERSION  version = Math::DefaultMathVersion() 
)

Calculate the intersections of a curve and a surface.

Calculate the intersections of a curve and a surface.
The result is an array of points or an array of two-dimensional curves on the plane.

Parameters
[in]curve- The curve.
[in]place- The plane coordinate system.
[out]result- The array of points on the plane.
[out]resultCurve- The array of curves on the plane.
[in]version- The version.

◆ SurfaceSection()

void SurfaceSection ( const MbSurface surface,
const MbPlacement3D place,
RPArray< MbCurve > &  result,
VERSION  version = Math::DefaultMathVersion() 
)

Calculate the intersections of a surface and a plane.

Calculate the intersections of a surface and a plane.
The result is an array of curves on the surface and two-dimensional curves on the plane.

Parameters
[in]surface- A surface.
[in]place- The plane coordinate system.
[out]result- The array of curves on the plane.
[in]version- The version.

◆ FaceBoundSegment()

MbResultType FaceBoundSegment ( const MbFace face,
size_t  loopInd,
size_t  edgeInd,
const MbSurface surface,
VERSION  version,
MbCurve *&  result 
)

Create a two-dimensional segment on a surface by projection of an oriented edge.

Create a two-dimensional segment on a surface by projection of an oriented edge.
The result is a two-dimensional curve in the parametric domain of the given surface.

Parameters
[in]face- A face defined on the surface.
[in]loopInd- The number of a loop in the face.
[in]edgeInd- Index of the edge in the loop to be projected.
[in]surface- A surface to project on.
[in]version- Version.
[out]result- A two-dimensional curve.
Returns
Returns operation result code.

◆ SurfaceBoundContour()

MbResultType SurfaceBoundContour ( const MbSurface surface,
const MbCurve3D spaceCurve,
VERSION  version,
MbContour *&  result 
)

Create a two-dimension boundary of a surface by projection of a space curve.

Create a two-dimension boundary of a surface by projection of a space curve
(the boundary space curves are considered to belong to the surface)

Parameters
[in]surface- A surface.
[in]spaceCurve- A space curve.
[in]version- Version.
[out]result- The two-dimensional contour on the surface.
Returns
Returns operation result code.

◆ IsLikeStraightLine()

bool IsLikeStraightLine ( const MbCurve curve,
double  eps 
)

Whether the curve is like straight-line regardless of its parameterization.

Whether the curve is like straight-line regardless of its parameterization.

Parameters
[in]curve- Curve.
[in]eps- Accuracy.
Returns
Returns true, if a curve is geometrically straight.

◆ DeleteDegenerateSegments()

MbContour* DeleteDegenerateSegments ( const MbContour cntr,
bool  modifySegments,
VERSION  verison,
MbSNameMaker names = nullptr 
)

Delete degenerate segments from contour.

Delete degenerate segments from contour with substitution of some curves and its modification according to the flag.

Parameters
[in]cntr- The initial contour.
[in]modifySegments- The flag determines whether segments can be replaced.
[in]version- The version.
[in]names- An object defining the names synchronized with contour.
Returns
Returns a modified copy of the contour if it has been successfully created.

◆ CreateCenterLineCurves()

bool CreateCenterLineCurves ( const MbFace face,
std::vector< MbCurve3D * > &  clCurves 
)

Create center lines of shell face.

Create center lines of shell face.

Parameters
[in]face- The initial face.
[out]clCurves- The set of created center lines.
Returns
Returns true if the center lines was created.

◆ CircleTanLineLineRad()

ptrdiff_t CircleTanLineLineRad ( const MbLine pl1,
const MbLine pl2,
double  rad,
MbTempCircle pc 
)

Calculate centers of circles.

Calculate centers of circles with fixed radius rad, that touches two given lines pl1 and pl2.

Parameters
[in]pl1- First line.
[in]pl2- Second line
[in]rad- Radius of circle.
[out]pc- Result - set of circles with required center.
Returns
The number of circles in array.

◆ CircleTanLineCircleRadius()

ptrdiff_t CircleTanLineCircleRadius ( const MbLine pl1,
const MbArc pc1,
double  rad,
MbTempCircle pc 
)

Calculate centers of circles.

Calculate centers of circles with fixed radius rad, that touches given line pl1 and circle pc1.

Parameters
[in]pl1- Line.
[in]pc1- Circle.
[in]rad- Result - set of circles with the required center.
[out]pc- Result - set of circles with the required center.
Returns
The number of circles in array.

◆ CircleTanCircleCircleRad()

ptrdiff_t CircleTanCircleCircleRad ( const MbArc pc1,
const MbArc pc2,
double  rad,
MbTempCircle pc 
)

Calculate centers of circles.

Calculate centers of circles with fixed radius rad, that touches given circles pc1 and pc2.

Parameters
[in]pc1- First circle.
[in]pc2- Second circle.
[in]rad- Radius of circles with the required center.
[out]pc- Result - set of circles with the required center.
Returns
Count of circles in set.

◆ CircleTanCurveCentre()

void CircleTanCurveCentre ( const MbCurve pCurve,
const MbCartPoint pnt,
PArray< MbTempCircle > &  pCircle 
)

Create circles.

Create circles with given center, that touches given curve.

Parameters
[in]pCurve- Curve, that touches circle.
[in]pnt- Center of circle.
[out]pCircle- Set of circles.

◆ CircleTangentCurveTwoPoints()

void CircleTangentCurveTwoPoints ( const MbCurve pCurve,
const MbCartPoint on1,
const MbCartPoint on2,
PArray< MbTempCircle > &  pCircle 
)

Create circles.

Create circles that touch given curve and pass through given two points.

Parameters
[in]pCurve- Curve, that touches circle.
[in]on1- Point on circle.
[in]on2- Point on circle.
[out]pCircle- Set of circles.

◆ CircleTangentCurveRPointOn()

void CircleTangentCurveRPointOn ( const MbCurve pCurve,
double  radius,
const MbCartPoint on,
PArray< MbTempCircle > &  pCircle 
)

Create circles.

Create circles that touch given curve and with a given radius, passing through a given point.

Parameters
[in]pCurve- Curve that touches circle.
[in]radius- Radius.
[in]on- Point on circle.
[out]pCircle- A set of circles.

◆ CircleTanTwoCurvesRadius()

void CircleTanTwoCurvesRadius ( const MbCurve pCurve1,
const MbCurve pCurve2,
double  rad,
PArray< MbTempCircle > &  pCircle 
)

Create circles.

Create circles with a given radius that touch two curves.

Parameters
[in]pCurve1- The first curve that touches circle.
[in]pCurve2- The second curve, that touches circle.
[in]rad- Radius.
[out]pCircle- A set of circles.

◆ CircleTanTwoCurvesPointOn()

void CircleTanTwoCurvesPointOn ( const MbCurve pCurve1,
const MbCurve pCurve2,
const MbCartPoint pOn,
PArray< MbTempCircle > &  pCircle 
)

Create circles.

Create circles that pass through given point and touch two curves.

Parameters
[in]pCurve1- The first curve, that touches circle.
[in]pCurve2- The second curve that touches circle.
[in]pOn- Point on circle.
[out]pCircle- A set of circles.

◆ CircleOriginOneTangentTwo()

void CircleOriginOneTangentTwo ( const MbCurve pCurve1,
const MbCurve pCurve2,
const MbCartPoint pp,
RPArray< MbTempCircle > &  pCircle 
)

Create circles.

Create circles with center on the first curve that touches second curve and passes through the given point.

Parameters
[in]pCurve1- The first curve which contains center of circle.
[in]pCurve2- The second curve that touches circle.
[in]pp- Point on circle.
[out]pCircle- A set of circles.

◆ CircleTanCurvePointOnAngle()

void CircleTanCurvePointOnAngle ( const MbCurve curve,
const MbCartPoint p1,
double  angle,
PArray< MbTempCircle > &  circles 
)

Create circles.

Create circles that touch given curve and pass through given point, with angle(p1, centre, ptan) at tangent point that equal to the given one.

Parameters
[in]curve- Curve that touches the circle.
[in]p1- Point on circle.
[in]angle- Angle formed by three points:
given point on circle p1,
center of circle,
tangent point.
[out]circles- A set of circles.

◆ ArcTangentCurveTwoPoints()

void ArcTangentCurveTwoPoints ( const MbCurve pCurve,
const MbCartPoint on1,
const MbCartPoint on2,
PArray< MbArc > &  arc 
)

Create arcs of circles.

Create arcs of circles by two points that touches given curve.

Parameters
[in]pCurve- Curve that touches arcs.
[in]on1- First point on arc.
[in]on2- Second point on arc.
[out]arc- Set of arcs.

◆ ArcTangentCurveRPointOn()

void ArcTangentCurveRPointOn ( const MbCurve pCurve,
double  radius,
const MbCartPoint on,
PArray< MbArc > &  arc 
)

Create arcs of circles.

Create arcs of circles by radius and point that touch given curve.

Parameters
[in]pCurve- Curve that touches arcs.
[in]radius- Radius.
[in]on- Point on arc.
[out]arc- Set of arcs.

◆ ArcTangentCurveContinue()

void ArcTangentCurveContinue ( const MbLine line,
const MbCartPoint p2,
PArray< MbArc > &  arc 
)

Create a circle arc.

Create arc of circle conjugated with the given bounded curve at the start point or at the end point. An arc always starts at curve.

Parameters
[in]line- Curve to conjugate with.
[in]p2- Point on arc.
[out]arc- A set that contains the arc of circle.

◆ ArcTangentCurveRadContinue()

void ArcTangentCurveRadContinue ( const MbLine line,
double  rad,
const MbCartPoint p2,
PArray< MbArc > &  arc 
)

Create a circle arc.

Create an arc of circle with the given radius conjugated with the given bounded curve at the start point or at the end point. An arc always starts at curve.

Parameters
[in]line- Curve to conjugate with.
[in]rad- Radius.
[in]p2- Point on arc.
[out]arc- A set that contains the arc of circle.

◆ CircleTanThreeCurves()

void CircleTanThreeCurves ( const MbCurve curve1,
const MbCurve curve2,
const MbCurve curve3,
const MbCartPoint pnt,
PArray< MbTempCircle > &  circle 
)

Create circles.

Create circles that touch three curves.

Parameters
[in]curve1- The first curve.
[in]curve2- The second curve.
[in]curve3- The third curve.
[in]pnt- A point on perpendicular to curve at the tangent point.
Used for those of the given three curves which are not segment, line or polyline.
[out]circle- A set of circles.

◆ CreateNewCircles()

void CreateNewCircles ( PArray< MbTempCircle > &  cTmp,
PArray< MbArc > &  pCircle 
)

Copy temporary circles.

Copy temporary circles.
Clear temporary array cTmp.

Parameters
[in,out]cTmp- Set of temporary circles. Array will be cleared.
[out]pCircle- Set of arcs of circles, created by temporary circles.

◆ LineParallelPoint()

void LineParallelPoint ( const MbCartPoint p,
const MbLine pl,
MbLine pl_par 
)

Construct a line parallel to a given line.

Construct a line parallel to a given line and passing through a given point.

Parameters
[in]p- The point on the line.
[in]pl- The parallel line.
[out]pl_par- The result - the line parallel to the line pl and passing through the point p.

◆ LineParallelDistance()

void LineParallelDistance ( double  delta,
const MbLine pl,
MbLine pl_par 
)

Construct a line parallel to a given line.

Construct a line parallel to a given line at a given distance from it.

Parameters
[in]delta- The distance to the parallel line.
[in]pl- The parallel line.
[out]pl_par- The result - the line parallel to the line pl at a given distance delta.

◆ LineBisector()

int LineBisector ( const MbCartPoint p,
const MbLine pl1,
const MbLine pl2,
MbLine pl3 
)

Construct a line passing through a given point.

Construct a line passing through a given point and being a bisector of angle between two given lines.

Parameters
[in]p- The point on the line.
[in]pl1- The line defining the angle side.
[in]pl2- The line defining the angle side.
[out]pl3- The result.

◆ LinePointAngle()

void LinePointAngle ( double  angle,
const MbCartPoint p,
const MbLine pl,
MbLine pl_new 
)

Construct a line passing at angle.

Construct a line at an angle to a given line and passing through a given point.

Parameters
[in]angle- The angle.
[in]p- The point on the line.
[in]pl- The line at the given angle to the created line.
[out]pl_new- The result - the created line.

◆ EllipsePntPntDist()

bool EllipsePntPntDist ( const MbCartPoint p1,
const double &  l1,
const MbCartPoint p2,
double &  l2,
MbCartPoint pc,
double &  angle 
)

Construct an ellipse.

Construct an ellipse.
The finite point and the length of the first semi-axis are fixed. The end point of the second semi-axis is put in. Calculate the length of the second semi-axis, ellipse center and inclination angle of the first semi-axis.

Parameters
[in]p1- The end point of the first semi-axis.
[in]l1- The length of the first semi-axis.
[in]p2- The end point of the second semi-axis.
[out]l2- The length of the second semi-axis.
[out]pc- The ellipse center.
[out]angle- The inclination angle of the first semi-axis.

◆ LinePointPerpCurve()

void LinePointPerpCurve ( const MbCartPoint pnt,
const MbCurve pCurve,
PArray< MbLine > &  pLine 
)

Construct a line passing through a given point.

Construct a line passing through a point and perpendicular to a given curve.
A line origin is coincident with intersection point.

Parameters
[in]pnt- The point on the line.
[in]pCurve- The perpendicular line.
[out]pLine- The result - the array of lines.

◆ LinePointTangentCircle()

int LinePointTangentCircle ( const MbCartPoint p,
const MbCartPoint centre,
double  radius,
MbLine pl 
)

Construct a line passing through a given point.

Construct a line passing through a point and tangent to a given circle with given center and radius.

Parameters
[in]p- The point on the line.
[in]centre- The circle center.
[in]radius- The circle radius.
[out]pl- The result - the array of lines.
Returns
The number of lines.

◆ CircleCentreOnCurveRadPointOn()

void CircleCentreOnCurveRadPointOn ( const MbCurve pCurve,
double  radius,
const MbCartPoint on,
PArray< MbTempCircle > &  pCircle 
)

Construct a circle.

Construct a circle by radius and coincident point, a circle center lies on a given curve.

Parameters
[in]pCurve- The curve containing the circle center.
[in]radius- The circle radius.
[in]on- The point on the circle.
[out]pCircle- The result - the set of circles.

◆ CircleCentreOnCurveTwoPoints()

void CircleCentreOnCurveTwoPoints ( const MbCurve pCurve,
const MbCartPoint on1,
const MbCartPoint on2,
PArray< MbTempCircle > &  pCircle 
)

Construct a circle.

Construct a circle by two points, with a center lying on a given curve.

Parameters
[in]pCurve- The curve containing the circle center.
[in]on1- The point on the circle.
[in]on2- The point on the circle.
[out]pCircle- The result - the set of circles.

◆ Arc2PointsRadius()

int Arc2PointsRadius ( const MbCartPoint p1,
const MbCartPoint p2,
double  rad,
bool  clockwise,
MbArc arc 
)

Construct a circle arc.

Construct a circle arc by two points, radius and direction.

Parameters
[in]p1- The point on the circle.
[in]p2- The point on the circle.
[in]rad- The circle radius.
[in]clockwise- The attribute of counterclockwise direction.
[out]arc- The result - the array of circles.
Returns
The count of circles in array.

◆ CanonicToParametricConic()

MbCurve* CanonicToParametricConic ( double  A,
double  B,
double  C,
double  D,
double  E,
double  F,
double  X1,
double  Y1,
double  X2,
double  Y2 
)

Construct curves.

Construct curves by conic section coefficients.

Parameters
[in]A,B,C,D,E,F- The coefficients of the conic section equation A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0.
[in]X1,Y1- The first boundary point coordinates.
[in]X2,Y2- The second boundary point coordinates.
Returns
The construction results:
  • circle arc -> circle arc;
  • ellipse arc -> ellipse arc;
  • parabola arc -> NURBS-curve;
  • hyperbola arc -> NURBS-curve.

◆ LinePointTangentCurve()

void LinePointTangentCurve ( const MbCartPoint pnt,
const MbCurve pCurve,
PArray< MbLine > &  pLine,
bool  lineAsCurve = false 
)

Construct a line.

Construct a line passing through a point and tangent to a given curve.
A line origin is coincident with a tangency point.

Parameters
[in]pnt- The point which the line passing through.
[in]pCurve- The curve which the constructed line should be tangent to.
[out]pLine- The set of lines.
[in]lineAsCurve- Work with MbLline, MbPolyline, MbLineSegment as with MbCurve.

◆ LineAngleTangentCurve()

void LineAngleTangentCurve ( double  angle,
const MbCurve pCurve,
PArray< MbLine > &  pLine 
)

Construct lines passing at angle.

Construct lines at angle "angle" to the axis OX and tangent to the curve.
A line origin is coincident with a tangency point.

Parameters
[in]angle- The angle to the abscissa axis.
[in]pCurve- The curve which the constructed line should be tangent to.
[out]pLine- The set of lines.

◆ LineTan2Circles()

ptrdiff_t LineTan2Circles ( const MbCartPoint centre1,
double  radius1,
const MbCartPoint centre2,
double  radius2,
MbLine pl,
MbCartPoint sp 
)

Construct lines tangent to circles.

Construct lines tangent to two circles. with given centers and radii.
A line origin is coincident with a point of tangency with the first circle. Function constructs from 0 to 4 variables.

Parameters
[in]centre1- The center of the first circle.
[in]radius1- The radius of the first circle.
[in]centre2- The center of the second circle.
[in]radius2- The radius of the second circle.
[out]pl- The result - the array of lines.
[out]sp- The array of tangency points on the second curve.
Returns
The number of lines in array "pl" that is equal to the number of the base points in array "sp".

◆ LineTangentTwoCurves()

void LineTangentTwoCurves ( const MbCurve pCurve1,
const MbCurve pCurve2,
PArray< MbLine > *  pLine,
SArray< MbCartPoint > *  secodnPnt 
)

Construct a tangent line.

Construct a line tangent to two curves.
A line origin is coincident with a point of tangency on the first curve.

Parameters
[in]pCurve1- The first curve which the constructed line should be tangent to.
[in]pCurve2- The second curve the constructed line should be tangent to.
[out]pLine- The result - the array of lines.
[out]secodnPnt- The array of tangency points on the second curve.
Returns
The number of lines in array "pline" that is equal to the number of points in array "secondPnt".

◆ LineAngleTanCircle()

ptrdiff_t LineAngleTanCircle ( double  angle,
const MbCartPoint centre,
double  radius,
MbLine pLine 
)

Construct lines passing at angle.

Construct lines at angle "angle" to the axis OX, tangent to a circle with the given center and radius.

Parameters
[in]angle- The angle.
[in]centre- The circle center.
[in]radius- The circle radius.
[out]pLine- The result - the array of lines.
Returns
The number of lines in array "pLine",

◆ SwapLines()

void SwapLines ( MbLine l1,
MbLine l2 
)
inline

Swap lines.

Swap lines.

Parameters
[in]l1- The first line.
[in]l2- The second line.

◆ NurbsConic_1()

MbCurve* NurbsConic_1 ( const MbCartPoint mbPoint0,
const MbCartPoint mbPoint1,
const MbCartPoint mbPoint2,
double  fDiscr 
)

Construct a conic section by two points, an angle vertex and a discriminant.

Construction of a conic section as a NURBS curve of the third degree by two points setting ends of a curve, a vertex of enginer triangle and a discriminant which is used for the definition of the third point.

Parameters
[in]mbPoint0- Coordinates of the conic start point.
[in]mbPoint1- Coordinates of the vertex of angle which should be inscribed into the conic.
[in]mbPoint2- Coordinates of the conic end point.
[in]fDiscr- The discriminant is less than 1. Otherwise it will be set to 0.99999999 automatically.
Returns
The pointer to the constructed curve
is nullptr if a try to construct a conic for a given parameters has failed.

◆ NurbsConic_2()

MbCurve* NurbsConic_2 ( std::vector< MbCartPoint > &  vmbConicPoints,
const MbCartPoint mbVertex 
)

Construct a conic section by three points, and an angle vertex.

Construction of a conic section as a NURBS curve of the third degree by three points: ends of a curve, its average point and by a vertex of an angle, a conic should be inscribed in.

Parameters
[in]vmbConicPoints- The container for points of a conic: start point, average point and end point; there should be exactly 3 points.
[in]mbVertex- Coordinates of the vertex of angle which should be inscribed into the conic.
Returns
The pointer to the constructed curve
is nullptr if a try to construct a conic for given parameters has failed.

◆ NurbsConic_3()

MbCurve* NurbsConic_3 ( const std::vector< MbCartPoint > &  vmbConicPoints,
MbVector mbTangent1,
MbVector mbTangent2 
)

Construct a conic section by three points and two inclinations.

Construction of a conic section as a NURBS curve of the third degree by 3 points setting begin, end and an average point of a curve and two inclinations outgoing from the start point and from the end point

Parameters
[in]vmbConicPoints- The container for points of a conic: start point, average point and end point; there should be exactly 3 points.
[in]mbTangent1- Inclination at start of a curve.
[in]mbTangent2- Inclination at end of a curve.
Returns
The pointer to the constructed curve
is nullptr if a try to construct a conic for given parameters has failed.

◆ NurbsConic_4()

MbCurve* NurbsConic_4 ( const MbCartPoint mbPoint1,
const MbCartPoint mbPoint2,
const MbVector mbTangent1,
const MbVector mbTangent2,
double  fDiscr 
)

Construct a conic section by two points, two inclinations and a discriminant.

Construction of a conic section as a NURBS curve of the third degree by 2 points setting start and end of a curve, two incllinations outgoing from these points and a discriminant.

Parameters
[in]mbPoint1- Coordinates of the conic start point.
[in]mbPoint2- Coordinates of the conic end point.
[in]mbTangent1- Inclination at start of conic.
[in]mbTangent2- Inclination at end of conic.
[in]fDiscr- The discriminant is less than 1. Otherwise it will be set to 0.99999999 automatically.
Returns
The pointer to the constructed curve
is nullptr if a try to construct a conic for given parameters has failed.

◆ NurbsConic_5()

MbCurve* NurbsConic_5 ( const std::vector< MbCartPoint > &  vmbConicPoints,
MbVector mbTangent1,
size_t  tanPntNb = 1 
)

Construct a conic section by four points, and an inclination.

Construction of a conic section as a NURBS curve of the third degree by 4 points and inclination in the first of them.
By substituting of start points in the common equation of the conic Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0 and its tangent at the start point (x1, y1): (2Ax1 + By1 + D)(x - x1) + (2Cy1 + Bx1 + E)(y - y1) = 0 we get the SLAE. Having SLAE solved relative to parameters A,B,C,D,E we find the required conic.

Parameters
[in]vmbConicPoints- The container for points of a conic: the first point is start point, the last point is end point. there should be exactly 4 points.
[in]mbTangent1- Inclination at point of conic.
[in]tanPntNb- Point number at which the inclination is specified.
Returns
The pointer to the constructed curve
is nullptr if a try to construct a conic for given parameters has failed.

◆ NurbsConic_6()

MbCurve* NurbsConic_6 ( const std::vector< MbCartPoint > &  vmbConicPoints)

Construct a conic section by five points.

Construction of a conic section as a NURBS curve of the third degree by 5 points.
By substituting of start points in the common equation of the conic Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0 we get the SLAE. Having SLAE solved relative to parameters A,B,C,D,E we find the required conic.

Parameters
[in]vmbConicPoints- The container for points of a conic: the first point is start point, the last point is end point. there should be exactly 5 points.
Returns
The pointer to the constructed curve
is nullptr if a try to construct a conic for given parameters has failed.

◆ CreateSmoothFromBezier()

void CreateSmoothFromBezier ( const MbBezier bez,
RPArray< MbCurve > &  arCurve,
bool  bline 
)

Create a smooth curve from a Bezier curve.

A NURBS of the fourth degree is created by an initial Bezier curve . Thereafter the NURBS is splitted in internal knots of triple multiplicity if they exist
If 'bline' is true then the degeneration into a line is checked. If the considered segment or the entire curve is a line then it is trandformed into a line.

Parameters
[in]bez- Bezier curve
[out]arCurve- The array of created curves.
[in]bline- The flag for the check of degeneration into a line.

◆ ConvertNurbsToCurveOfType()

MbCurve* ConvertNurbsToCurveOfType ( const MbNurbs nurbs,
MbePlaneType  type,
double  eps 
)

Create a curve of a given type as NURBS-curve.

It works for the two types: 'pt_LineSegment' and 'pt_Arc'. If approximation with the given tolerance has failed then the function returns nullptr.

Parameters
[in]nurbs- The initial NURBS-curve.
[in]type- The type of a curve which is required to create.
[in]eps- The tolerance of approximation.
Returns
The pointer to the curve if it has been created.

◆ CreateSurfaceHide()

void CreateSurfaceHide ( const MbSurface surf,
const MbPlacement3D eyePlace,
double  sag,
RPArray< MbCurve > &  hideCurves,
VERSION  version = Math::DefaultMathVersion() 
)

Get the array of surface silhouette curves of planar projection.

Get the array of surface silhouette curves of planar projection.

◆ CreateNurbsLSMClosed()

template<class Nurbs , class PointsVector , class DoubleVector >
bool CreateNurbsLSMClosed ( SPtr< Nurbs > &  nurbs,
const ptrdiff_t  degree,
const ptrdiff_t  pCount,
const PointsVector &  aPoints,
const DoubleVector &  aKnots,
const DoubleVector *  aParams = nullptr 
)

Construction of closed spline.

Construction of closed spline which approximates a set of points by the method of least squares.

Parameters
[in,out]nurbs- Modifiable spline.
[in]aDegree- The spline order.
[in]pCount- Count of points.
[in]aPoints- Point set for approximation.
[in]aKnots- The predefined knots vector.
[in]aParams- The parameters for point set.
Returns
Returns true if success, false - on other case.

◆ CreateNurbsLSM()

template<class Nurbs , class PointsVector , class DoubleVector >
bool CreateNurbsLSM ( SPtr< Nurbs > &  nurbs,
const ptrdiff_t  degree,
const ptrdiff_t  pCount,
const PointsVector &  aPoints,
const DoubleVector &  aKnots,
const DoubleVector *  aParams = nullptr 
)

Construction of non-closed spline.

Construction of non-closed spline which approximates a set of points by the method of least squares.

Parameters
[in,out]nurbs- Modifiable spline.
[in]aDegree- The spline order.
[in]pCount- Count of points.
[in]aPoints- Point set for approximation.
[in]aKnots- The predefined knots vector.
[in]aParams- The parameters for point set.
Returns
Returns true if success, false - on other case.

◆ ApproximatePolylineByNurbs()

MbResultType ApproximatePolylineByNurbs ( const MbApproxNurbsParameters< MbCartPoint, MbVector, MbNurbs > &  param,
MbApproxNurbsCurveResult< MbNurbs > &  result 
)

Approximate 2D points by NURBS curve.

Approximate points by NURBS curve.

Parameters
[in]param- Parameters for approximation.
[out]result- Operation result.
Returns
Error code.
Warning
Under development.