C3D Kernel  104598
Classes | Functions
Curves
Geometric Objects
Collaboration diagram for Curves:

Classes

class  MbArc3D
 Elliptical arc in three-dimensional space. More...
class  MbBSpline
 B-spline set of NURBS-curve. More...
class  MbBezier3D
 Bezier spline in three-dimensional space. More...
class  MbBridgeCurve3D
 Bridge curve connecting ends of two curves. More...
class  MbCharacterCurve3D
 Functionally defined curve. More...
class  MbConeSpiral
 Conical spiral. More...
class  MbContour3D
 Contour in three-dimensional space. More...
class  MbContourOnPlane
 Contour on plane. More...
class  MbContourOnSurface
 Contour on surface. More...
class  MbCrookedSpiral
 Spiral with a curvilinear axis. More...
class  MbCubicSpline3D
 Cubic spline. More...
class  MbCurveSpiral
 Spiral with a variable radius. More...
class  MbHermit3D
 Composite Hermite cubic spline in three-dimensional space. More...
class  MbLine3D
 Line in three-dimensional space. More...
class  MbLineSegment3D
 Line segment in three-dimensional space. More...
class  MbNurbs3D
 NURBS curve in three-dimensional space. More...
class  MbOffsetCurve3D
 Offset curve in three-dimensional space. More...
class  MbPlaneCurve
 Plane curve in three-dimensional space. More...
class  MbPolyCurve3D
 Curve in three-dimensional space, defined by points. More...
class  MbPolyline3D
 Polyline in three-dimensional space. More...
class  MbReparamCurve3D
 Reparametrized curve in three-dimensional space. More...
class  MbSilhouetteCurve
 Isocline curve or silhouette curve of surface. More...
class  MbSpiral
 Spiral. More...
class  MbSurfaceCurve
 Curve on surface. More...
class  MbSurfaceIntersectionCurve
 Intersection curve of two surfaces. More...
class  MbTrimmedCurve3D
 Trimmed curve in three-dimensional space. More...
class  MbCurve3D
 Curve in three-dimensional space. More...

Functions

MbCurve3DTrimContour (const MbContour3D &cntr, double t1, double t2, int sense, bool useTrimmedOnly)
 Trim a contour.
void MakeSpaceWireFrame (const MbItem &item, RPArray< MbCurve3D > &wire)
 Create a spatial wireframe by a mesh.
void MakePlaneWireFrame (const MbItem &item, const MbPlacement3D &place, RPArray< MbCurve3D > &wire)
 Create a planar wireframe by a mesh.
void MakePlaneVistaWireFrame (const MbItem &item, const MbPlacement3D &place, const MbCartPoint3D &vista, RPArray< MbCurve3D > &wire)
 Create a planar wireframe by a mesh in perspective.
void MakePlaneWireFrame (const MbItem &item, const MbPlacement3D &place, RPArray< MbCurve > &wire)
 Create a planar wireframe by a mesh.
void MakePlaneVistaWireFrame (const MbItem &item, const MbPlacement3D &place, const MbCartPoint3D &vista, RPArray< MbCurve > &wire)
 Create a planar wireframe by a mesh in perspective.
MbeNewtonResult NearestPoints (const MbCurve3D &curve1, bool ext1, const MbCurve3D &curve2, bool ext2, double &t1, double &t2, double &dmin)
 Calculate parameters of the nearest points of two curves.
MbeNewtonResult CurveCrossNewton (const MbCurve3D &curve1, bool ext1, const MbCurve3D &curve2, bool ext2, double funcEpsilon, size_t iterLimit, double &t1, double &t2)
 Definition of parameters of the nearest points of curves.
void CalculatePolygon (const MbCurve3D &curve, const MbStepData &stepData, std::vector< std::pair< double, MbCartPoint3D > > &paramPoints)
 Calculate polygon points of curve.

Functions for working inside and outside the curve's domain.

Functions _PointOn, _FirstDer, _SecondDer, _ThirdDer,... do not correct parameter when it is out of domain bounds. When parameter is out of domain bounds, an unclosed curve is extended by tangent vector at corresponding end point in general case. The exceptions are arcs of ellipse and arcs of circle - they are extended according to their equations.

virtual void MbCurve::Explore (double &t, bool ext, MbCartPoint &pnt, MbVector &fir, MbVector *sec, MbVector *thir) const
 Calculate point and derivatives of object for given parameter.

Functions for curve domain description

virtual bool MbCurve3D::IsClosed () const =0
 Define whether the curve is closed.

Functions for working in the curve's domain.\n

functions PointOn, FirstDer, SecondDer, ThirdDer,... correct parameter when it is out of domain bounds. The exception is MbLine3D (line).

virtual void MbCurve3D::PointOn (double &t, MbCartPoint3D &p) const =0
 Calculate a point on the curve.
virtual void MbCurve3D::FirstDer (double &t, MbVector3D &) const =0
 Calculate first derivative.
virtual void MbCurve3D::SecondDer (double &t, MbVector3D &) const =0
 Calculate second derivative.
virtual void MbCurve3D::ThirdDer (double &t, MbVector3D &) const =0
 Calculate third derivative.
virtual void MbCurve3D::Tangent (double &t, MbVector3D &) const
 Calculate tangent vector (normalized).
virtual void MbCurve3D::Normal (double &t, MbVector3D &) const
 Calculate main normal vector.
virtual void MbCurve3D::BNormal (double &t, MbVector3D &) const
 Calculate binormal vector.

Functions for working inside and outside the curve's domain\n

functions _PointOn, _FirstDer, _SecondDer, _ThirdDer,... do not correct parameter when it is out of domain bounds.

virtual void MbCurve3D::_PointOn (double t, MbCartPoint3D &p) const
 Calculate point at curve and its extension.
virtual void MbCurve3D::Explore (double &t, bool ext, MbCartPoint3D &pnt, MbVector3D &fir, MbVector3D *sec, MbVector3D *thir) const
 Calculate point and derivatives of object for given parameter.
virtual void MbCurve3D::FastApproxExplore (double &t, MbCartPoint3D &pnt, MbVector3D &fir, MbVector3D *sec) const
 Calculate point and derivatives on the curve.
virtual void MbCurve3D::_FirstDer (double t, MbVector3D &) const
 Calculate first derivative at curve and its extension.
virtual void MbCurve3D::_SecondDer (double t, MbVector3D &) const
 Calculate second derivative at curve and its extension.
virtual void MbCurve3D::_ThirdDer (double t, MbVector3D &) const
 Calculate third derivative at curve and its extension.
virtual void MbCurve3D::_Tangent (double t, MbVector3D &) const
 Calculate tangent vector (normalized) at curve and its extension.
virtual void MbCurve3D::_Normal (double t, MbVector3D &) const
 Calculate main normal vector (normalized) at curve and its extension.
virtual void MbCurve3D::_BNormal (double t, MbVector3D &) const
 Calculate binormal vector (normalized) at curve and its extension.

Function of moving by curve

virtual double MbCurve3D::Step (double t, double sag) const
 Calculate parameter step.
virtual double MbCurve3D::DeviationStep (double t, double ang) const
 Calculate parameter step.
virtual double MbCurve3D::MetricStep (double t, double length) const
 Calculate parameter step.
double MbCurve3D::CurveStep (const double &t, const MbStepData &stepData) const
 Calculate parameter step.

Common function of curve.

virtual MbCurve3DMbCurve3D::NurbsCurve (const MbNurbsParameters &tParameters) const
 Construct a NURBS copy of a curve.
virtual MbCurve3DMbCurve3D::Trimmed (double t1, double t2, int sense) const
 Construct a trimmed curve.
virtual double MbCurve3D::CalculateLength (double t1, double t2) const
 Calculate the metric length of a curve.
virtual bool MbCurve3D::DistanceAlong (double &t, double len, int curveDir, double eps=Math::metricPrecision, VERSION version=Math::DefaultMathVersion()) const
 Translate parameter along the curve.
virtual bool MbCurve3D::ChangeCarrierBorne (MbSpaceItem &item, MbSpaceItem &init, const MbMatrix &matr)
 Change the carrier.
virtual void MbCurve3D::CalculatePolygon (const MbStepData &stepData, MbPolygon3D &poligon) const
 Calculate an array of points for drawing.
virtual MbeNewtonResult MbCurve3D::PointProjectionNewton (const MbCartPoint3D &p, size_t iterLimit, double &t, bool ext) const
 Find the point projection to the curve.
virtual bool MbCurve3D::NearPointProjection (const MbCartPoint3D &pnt, double &t, bool ext, MbRect1D *tRange=NULL) const
 Find the point projection to the curve.
virtual MbeNewtonResult MbCurve3D::IsoclinalNewton (const MbVector3D &dir, size_t iterLimit, double &t) const
 Find isoclines of a curve.
virtual void MbCurve3D::GetIsoclinal (const MbVector3D &nor, SArray< double > &tIso) const
 Find all isoclines of a curve.
virtual MbCurveMbCurve3D::GetMap (const MbMatrix3D &into, MbRect1D *pRegion=NULL, VERSION version=Math::DefaultMathVersion(), bool *coincParams=NULL) const
 Construct a planar projection of a piece of a space curve.
virtual MbCurveMbCurve3D::GetMapPsp (const MbMatrix3D &into, double zNear, MbRect1D *pRegion=NULL) const
 Construct a planar projection of a piece of a space curve.
virtual MbCurveMbCurve3D::GetProjection (const MbPlacement3D &place, VERSION version) const
 Construct a planar projection of a space curve to a plane.
bool MbCurve3D::IsSpaceNear (const MbCurve3D &curve, double eps, bool ext, double devSag=5.0 *Math::deviateSag) const
 Check whether the two curves are metrically close.
MbCartPoint3D MbCurve3D::GetLimitPoint (ptrdiff_t number) const
 Calculate the boundary point.
void MbCurve3D::GetLimitPoint (ptrdiff_t number, MbCartPoint3D &pnt) const
 Calculate the boundary point.

Common functions

virtual void MbFunction::Explore (double &t, bool ext, double &val, double &fir, double *sec, double *thr) const
 Calculate value and derivatives of object for given parameter.

Function Documentation

MbCurve3D* TrimContour ( const MbContour3D cntr,
double  t1,
double  t2,
int  sense,
bool  useTrimmedOnly 
)

Trim a contour. This function is extended version of contour's function Trimmed.

Parameters:
[in]t1- Parameter corresponding to start of a trimmed curve.
[in]t2- Parameter corresponding to end of a trimmed curve.
[in]sense- Direction of a trimmed curve in relation to an initial curve. sense = 1 - direction does not change. sense = -1 - direction changes to the opposite value.
[in]useTrimmedOnly- A truncated segment is always curve MbTrimmedCurve3D.
Returns:
A constructed trimmed curve.
void MakeSpaceWireFrame ( const MbItem item,
RPArray< MbCurve3D > &  wire 
)

Create a spatial wireframe by a mesh.

void MakePlaneWireFrame ( const MbItem item,
const MbPlacement3D place,
RPArray< MbCurve3D > &  wire 
)

Create a planar wireframe by a mesh.

void MakePlaneVistaWireFrame ( const MbItem item,
const MbPlacement3D place,
const MbCartPoint3D vista,
RPArray< MbCurve3D > &  wire 
)

Create a planar wireframe by a mesh in perspective.

void MakePlaneWireFrame ( const MbItem item,
const MbPlacement3D place,
RPArray< MbCurve > &  wire 
)

Create a planar wireframe by a mesh.

void MakePlaneVistaWireFrame ( const MbItem item,
const MbPlacement3D place,
const MbCartPoint3D vista,
RPArray< MbCurve > &  wire 
)

Create a planar wireframe by a mesh in perspective.

virtual void MbCurve::Explore ( double &  t,
bool  ext,
MbCartPoint pnt,
MbVector fir,
MbVector sec,
MbVector thir 
) const [virtual]

Values of point and derivatives are calculated on parameter area and on extended curve.

Parameters:
[in]t- Parameter.
[in]ext- On parameters area (false), on extended curve (true).
[out]pnt- Point.
[out]fir- Derivative with respect to t.
[out]sec- Second derivative with respect to t, if not NULL.
[out]thir- Third derivative with respect to t, if not NULL.

Reimplemented in MbArc, MbBezier, MbCharacterCurve, MbContour, MbCosinusoid, MbCubicSpline, MbHermit, MbLine, MbLineSegment, MbNurbs, MbOffsetCurve, MbPointCurve, MbPolyCurve, MbPolyline, MbProjCurve, MbReparamCurve, and MbTrimmedCurve.

virtual bool MbCurve3D::IsClosed ( ) const [pure virtual]

Define whether the curve is closed.
A curve is considered as closed if it is cyclic:

  • start point is coincident with end point,
  • derivatives in start point and end point coincide,
    if there are breaks at curve (in cases when a curve is contour or polyline), then derivatives may not coincide; in Bezier curve derivatives should coincide by direction, but they may differ by absolute value.
    Returns:
    True if a curve is closed.

Implemented in MbArc3D, MbBSpline, MbBridgeCurve3D, MbCharacterCurve3D, MbContour3D, MbContourOnSurface, MbCrookedSpiral, MbLine3D, MbLineSegment3D, MbNurbs3D, MbOffsetCurve3D, MbPlaneCurve, MbPolyCurve3D, MbReparamCurve3D, MbSpiral, MbSurfaceCurve, MbSurfaceIntersectionCurve, and MbTrimmedCurve3D.

virtual void MbCurve3D::PointOn ( double &  t,
MbCartPoint3D p 
) const [pure virtual]
virtual void MbCurve3D::_PointOn ( double  t,
MbCartPoint3D p 
) const [virtual]

Calculate a point on the curve including the outside area determination parameter.

Parameters:
[in]t- Curve parameter.
[out]p- A point on the curve.

Reimplemented in MbArc3D, MbConeSpiral, MbContour3D, MbContourOnPlane, MbContourOnSurface, MbCrookedSpiral, MbCurveSpiral, MbHermit3D, MbLine3D, MbLineSegment3D, MbPlaneCurve, MbReparamCurve3D, MbSilhouetteCurve, MbSurfaceCurve, MbSurfaceIntersectionCurve, and MbTrimmedCurve3D.

virtual void MbCurve3D::Explore ( double &  t,
bool  ext,
MbCartPoint3D pnt,
MbVector3D fir,
MbVector3D sec,
MbVector3D thir 
) const [virtual]

Values of point and derivatives are calculated on parameter area and on extended curve.

Parameters:
[in]t- Parameter.
[in]ext- On parameters area (false), on extended curve (true).
[out]pnt- Point.
[out]fir- Derivative with respect to t.
[out]sec- Second derivative with respect to t, if not NULL.
[out]thir- Third derivative with respect to t, if not NULL.

Reimplemented in MbArc3D, MbBSpline, MbBezier3D, MbBridgeCurve3D, MbCharacterCurve3D, MbConeSpiral, MbContour3D, MbContourOnPlane, MbContourOnSurface, MbCrookedSpiral, MbCubicSpline3D, MbCurveSpiral, MbHermit3D, MbLine3D, MbLineSegment3D, MbNurbs3D, MbOffsetCurve3D, MbPlaneCurve, MbPolyCurve3D, MbPolyline3D, MbReparamCurve3D, MbSilhouetteCurve, MbSpiral, MbSurfaceCurve, MbSurfaceIntersectionCurve, and MbTrimmedCurve3D.

virtual void MbCurve3D::FastApproxExplore ( double &  t,
MbCartPoint3D pnt,
MbVector3D fir,
MbVector3D sec 
) const [virtual]

The function is overloaded in MbSurfaceIntersectionCurve and MbSilhouetteCurve for the fast approximated calculation of a point and derivatives. In other surfaces it is equivalent to the function Explore(t,false,pnt,fir,sec,NULL).

Parameters:
[in]t- Parameter.
[out]pnt- A calculated point.
[out]fir- Derivative with respect to t.
[out]sec- Second derivative with respect to t, if not NULL.

Reimplemented in MbSilhouetteCurve, and MbSurfaceIntersectionCurve.

virtual double MbCurve3D::Step ( double  t,
double  sag 
) const [virtual]

Calculate parameter step for the curve's approximation by its sag value. Calculation of the step is performed with consideration of curvature radius. A step of curve's approximation is chosen in such way, that the deviation from its polygon does not exceed the given value of sag.

Parameters:
[in]t- A parameter defining the point on a curve, at which a step should be calculated.
[in]sag- Maximum feasible sag value.
Returns:
A sag value by parameter at given point.

Reimplemented in MbArc3D, MbBSpline, MbBezier3D, MbBridgeCurve3D, MbCharacterCurve3D, MbConeSpiral, MbContour3D, MbContourOnPlane, MbContourOnSurface, MbCubicSpline3D, MbHermit3D, MbLine3D, MbLineSegment3D, MbNurbs3D, MbOffsetCurve3D, MbPlaneCurve, MbPolyline3D, MbReparamCurve3D, MbSpiral, MbSurfaceCurve, MbSurfaceIntersectionCurve, and MbTrimmedCurve3D.

virtual double MbCurve3D::DeviationStep ( double  t,
double  ang 
) const [virtual]

Calculate parameter step for the curve's approximation by the deviation angle of the tangent vector. A step of curve's approximation is chosen in such way, that angular deviation of the tangent curve at the next point does not exceed the given value ang.

Parameters:
[in]t- A parameter defining the point on a curve, at which a step should be calculated.
[in]ang- The maximum feasible deviation angle of tangent.
Returns:
A sag value by parameter at given point.

Reimplemented in MbArc3D, MbBezier3D, MbBridgeCurve3D, MbCharacterCurve3D, MbConeSpiral, MbContour3D, MbContourOnPlane, MbContourOnSurface, MbCubicSpline3D, MbHermit3D, MbLine3D, MbLineSegment3D, MbNurbs3D, MbOffsetCurve3D, MbPlaneCurve, MbPolyline3D, MbReparamCurve3D, MbSilhouetteCurve, MbSpiral, MbSurfaceCurve, MbSurfaceIntersectionCurve, and MbTrimmedCurve3D.

virtual double MbCurve3D::MetricStep ( double  t,
double  length 
) const [virtual]

Calculate the parameter step for approximation of a curve by the given metric length of a step along a curve.

Parameters:
[in]t- A parameter defining the point on a curve, at which a step should be calculated.
[in]len- Maximum metric length of a step along a curve.
Returns:
A sag value by parameter at given point.

Reimplemented in MbArc3D, MbConeSpiral, MbContour3D, MbLine3D, MbLineSegment3D, MbPlaneCurve, MbReparamCurve3D, MbSurfaceCurve, MbSurfaceIntersectionCurve, and MbTrimmedCurve3D.

double MbCurve3D::CurveStep ( const double &  t,
const MbStepData stepData 
) const

Calculate parameter step for the curve approximation: by diviation sngle; or by its sag value; or by the metric length.

Parameters:
[in]t- A parameter defining the point on a curve, at which a step should be calculated.
[in]stepData- Data for step calculation.
Returns:
A sag value by parameter at given point.
virtual MbCurve3D* MbCurve3D::NurbsCurve ( const MbNurbsParameters tParameters) const [virtual]

Constructs a NURBS curve which approximates a given curve with the given parameters. In parameters the degree and the number of knots of a spline and the range of curve's parameters changing may be set. If the flag of accurate approximation is not set in parameters then NURBS without multiple knots is constructed.

Parameters:
[in]tParameters- Parameters for the construction of a NURBS copy of the curve.
Returns:
The constructed NURBS curve or NULL in a case of failure.

Reimplemented in MbArc3D, MbBezier3D, MbBridgeCurve3D, MbCubicSpline3D, MbHermit3D, MbLine3D, MbLineSegment3D, MbNurbs3D, MbPlaneCurve, MbPolyline3D, MbReparamCurve3D, and MbTrimmedCurve3D.

virtual MbCurve3D* MbCurve3D::Trimmed ( double  t1,
double  t2,
int  sense 
) const [virtual]

Constructs a trimmed curve, a start point of which corresponds to a point with parameter t1 and an end point corresponds to a point with parameter t2. Direction of the constructed curve relative to the initial curve may be changed by the parameter 'sense'. If the curve is closed, then there may be obtained a trimmed curve, passing through the start of a curve.
In a case of closed or periodic curve three parameters 'sense', t1 and t2 clearly define the result. In a case of unclosed curve the parameter 'sense' and parameter of trimming should correspond each other:
1) if sense == 1, then t1 < t2,
2) if sense == -1, then t1 > t2,
If there is a discrepancy between 'sense' and parameters of trimming, then 'sense' parameter has higher priority. If parameters t1 and t2 are equal and the curve is closed, then in result a closed curve should be obtained.

Parameters:
[in]t1- Parameter corresponding to start of a trimmed curve.
[in]t2- Parameter corresponding to end of a trimmed curve.
[in]sense- Direction of a trimmed curve in relation to an initial curve. sense = 1 - direction does not change. sense = -1 - direction changes to the opposite value.
Returns:
A constructed trimmed curve.

Reimplemented in MbArc3D, MbConeSpiral, MbContour3D, MbContourOnPlane, MbContourOnSurface, MbCrookedSpiral, MbCurveSpiral, MbHermit3D, MbLine3D, MbLineSegment3D, MbNurbs3D, MbPlaneCurve, MbReparamCurve3D, MbSilhouetteCurve, MbSurfaceCurve, MbSurfaceIntersectionCurve, and MbTrimmedCurve3D.

virtual double MbCurve3D::CalculateLength ( double  t1,
double  t2 
) const [virtual]

Calculate the metric length of unclosed curve from parameter t1 to parameter t2. The condition t1 < t2 should satisfied.

Parameters:
[in]t1- Start parameter of a curve section.
[in]t2- End parameter of a curve section.
Returns:
Length of a curve.

Reimplemented in MbConeSpiral, MbContour3D, MbCrookedSpiral, MbLineSegment3D, MbNurbs3D, MbPlaneCurve, MbReparamCurve3D, and MbSurfaceIntersectionCurve.

virtual bool MbCurve3D::DistanceAlong ( double &  t,
double  len,
int  curveDir,
double  eps = Math::metricPrecision,
VERSION  version = Math::DefaultMathVersion() 
) const [virtual]

Translate parameter along the curve by the given distance at the given direction. The new value of parameter is saved in the variable t. If the curve is not closed and the length of its part from the point with parameter t to the end at the given direction is less than the required shift, then calculations are performed on extension of the curve, if it possible to construct such extension.

Parameters:
[in,out]t- Input - the initial value of parameter. Output - the new value of parameter.
[in]len- The value of shift along the curve.
[in]curveDir- The offset direction. If curveDir is non-negative, then the shift is directed to the side of increasing of parameter. Otherwise - to the side of decreasing of parameter.
[in]eps- Computational tolerance.
Returns:
True - if the operation is performed successfully, otherwise false.

Reimplemented in MbArc3D, MbBezier3D, MbContour3D, MbCubicSpline3D, MbHermit3D, MbLine3D, MbLineSegment3D, MbNurbs3D, MbPlaneCurve, MbReparamCurve3D, and MbSurfaceIntersectionCurve.

virtual bool MbCurve3D::ChangeCarrierBorne ( MbSpaceItem item,
MbSpaceItem init,
const MbMatrix matr 
) [virtual]

For surface curves. Replaces the current carrier 'item' by a new one, if this is possible. Transforms a carried element by the given matrix.

Parameters:
[in]item- An initial carrier.
[in]init- A new carrier.
[in]matr- A matrix for transformation of a carried element.
Returns:
True - if the operation is performed successfully, otherwise false.

Reimplemented in MbContourOnSurface, MbSurfaceCurve, and MbSurfaceIntersectionCurve.

virtual void MbCurve3D::CalculatePolygon ( const MbStepData stepData,
MbPolygon3D poligon 
) const [virtual]

Get an array of drawn points with a given sag. If the cure is a contour then knots of a contour are duplicated.

Parameters:
[in]sag- Maximal value of sag.
[in,out]poligon- A polygon of calculated points on a curve.

Reimplemented in MbLine3D, MbLineSegment3D, MbReparamCurve3D, and MbSurfaceIntersectionCurve.

virtual MbeNewtonResult MbCurve3D::PointProjectionNewton ( const MbCartPoint3D p,
size_t  iterLimit,
double &  t,
bool  ext 
) const [virtual]

Find the point projection to the curve or its extension by the Newton method with the given initial approximation.

Parameters:
[in]p- A given point.
[in]iterLimit- The maximum number of iterations.
[out]t- Input - initial approximation, output - parameter of a curve corresponding to the nearest projection.
[in]ext- A flag defining whether to seek projection on the extension of the curve.
Returns:
The result of the iterative method.
virtual bool MbCurve3D::NearPointProjection ( const MbCartPoint3D pnt,
double &  t,
bool  ext,
MbRect1D tRange = NULL 
) const [virtual]

Find the nearest point projection to the curve or its by the given initial approximation. If the range of parameter changing 'tRange' is set, then find a projection in the given range. A range of parameter may not belong to the domain of a curve. The Newton method is used.

Parameters:
[in]pnt- A given point.
[in,out]t- Input - initial approximation, output - parameter of a curve corresponding to the nearest projection.
[in]ext- A flag defining whether to seek projection on the extension of the curve.
[in]tRange- A range of parameter changing in which the solution should be found.
Returns:
True - if there is found a projection which satisfies to all input conditions.

Reimplemented in MbArc3D, MbConeSpiral, MbContour3D, MbContourOnSurface, MbHermit3D, MbLine3D, MbLineSegment3D, MbNurbs3D, MbPlaneCurve, MbPolyline3D, MbReparamCurve3D, MbSurfaceCurve, and MbTrimmedCurve3D.

virtual MbeNewtonResult MbCurve3D::IsoclinalNewton ( const MbVector3D dir,
size_t  iterLimit,
double &  t 
) const [virtual]

Find the point on a curve where the tangent is parallel to a plane having a normal dir.

Parameters:
[in]dir- A vector which defines a plane.
[in]iterLimit- The maximum number of iterations.
[in,out]t- Input - initial approximation, output - parameter of a point of the required tangent.
Returns:
The result of the iterative method.
virtual void MbCurve3D::GetIsoclinal ( const MbVector3D nor,
SArray< double > &  tIso 
) const [virtual]

Find the points on a curve where the tangent is parallel to a plane having a normal nor.

Parameters:
[in]nor- A vector which defines a plane.
[out]tIso- An array of parameters of points for the required tangent.

Reimplemented in MbReparamCurve3D.

virtual MbCurve* MbCurve3D::GetMap ( const MbMatrix3D into,
MbRect1D pRegion = NULL,
VERSION  version = Math::DefaultMathVersion(),
bool *  coincParams = NULL 
) const [virtual]

Construct a planar projection of a piece of a space curve.

Parameters:
[in]into- The transformation matrix from the global coordinate system into a plane of view.
[in]pRegion- A mapped piece of a curve (paramRegion.x = t1, paramRegion.y = t2), by default - the whole curve..
[in]version- Version, last by default.
[in,out]coincParams- A flag of coincidence between parameterization of initial curve and its projection
if coincParams != NULL then the function tries to create a projection with coincident parameterization
if *coincParams = true then parameterization of projection coincides with parameterization of initial curve.
Returns:
Two-dimensional projection of a curve

Reimplemented in MbArc3D, MbBezier3D, MbCharacterCurve3D, MbConeSpiral, MbContour3D, MbContourOnPlane, MbContourOnSurface, MbCubicSpline3D, MbHermit3D, MbLine3D, MbLineSegment3D, MbNurbs3D, MbPlaneCurve, MbPolyline3D, MbReparamCurve3D, MbSilhouetteCurve, MbSurfaceCurve, MbSurfaceIntersectionCurve, and MbTrimmedCurve3D.

virtual MbCurve* MbCurve3D::GetMapPsp ( const MbMatrix3D into,
double  zNear,
MbRect1D pRegion = NULL 
) const [virtual]

Construct a planar projection of a piece of a space curve for the perspective visualization.

Parameters:
[in]into- The transformation matrix from the global coordinate system into a plane of view.
[in]zNear- The parameter of the perspective visualization which is equal to the distance between the observation point and the plane of view (negative).
[in]pRegion- A mapped piece of a curve (paramRegion.x = t1, paramRegion.y = t2), by default - the whole curve..
Returns:
Two-dimensional projection of a curve

Reimplemented in MbArc3D, MbLine3D, MbLineSegment3D, MbPlaneCurve, and MbPolyline3D.

virtual MbCurve* MbCurve3D::GetProjection ( const MbPlacement3D place,
VERSION  version 
) const [virtual]

Construct a planar projection of a space curve to a plane.

Parameters:
[in]place- A plane.
[in]version- The version of mathematics.
Returns:
Two-dimensional projection of a curve

Reimplemented in MbSurfaceIntersectionCurve.

bool MbCurve3D::IsSpaceNear ( const MbCurve3D curve,
double  eps,
bool  ext,
double  devSag = 5.0 *Math::deviateSag 
) const

The proximity of curves is defined by equality of their ends and the distance of an arbitrary point of one curve to another curve. Curves may differ parametrically.

Parameters:
[in]curve- A curve to compare with.
[in]eps- The maximum allowed distance between the nearest points of two curves.
[in]ext- A flag defines whether the curve 'curve' may be extended when necessary. If ext = true then the curve may be extended.
[in]devSag- Maximal value of sag.
Returns:
True - if curves are metrically close.
MbCartPoint3D MbCurve3D::GetLimitPoint ( ptrdiff_t  number) const

Calculate the boundary point.

Parameters:
[in]number- A number of a boundary point. The value 1 corresponds to the start point of a curve, 2 - to the end point.
Returns:
A calculated point.
void MbCurve3D::GetLimitPoint ( ptrdiff_t  number,
MbCartPoint3D pnt 
) const

Calculate the boundary point.

Parameters:
[in]number- A number of a boundary point. The value 1 corresponds to the start point of a curve, 2 - to the end point.
[in,out]pnt- A calculated point.
MbeNewtonResult NearestPoints ( const MbCurve3D curve1,
bool  ext1,
const MbCurve3D curve2,
bool  ext2,
double &  t1,
double &  t2,
double &  dmin 
)

Calculate parameters of the nearest points of two curves and the distance between these points.

Parameters:
[in]curve1- Curve 1.
[in]ext1- An attribute of search on the extension of the curve 1.
[in]curve2- Curve 2.
[in]ext2- An attribute of search on the extension of the curve 2.
[in]t1- A point parameter of curve 1.
[in]t2- A point parameter of curve 2.
[in]dmin- The distance between points of curves.
Returns:
Return nr_Success (+1) or nr_Special(0) in a case of successful defining, return nr_Failure(-1) in a case of failure.
MbeNewtonResult CurveCrossNewton ( const MbCurve3D curve1,
bool  ext1,
const MbCurve3D curve2,
bool  ext2,
double  funcEpsilon,
size_t  iterLimit,
double &  t1,
double &  t2 
)

Iterative definition of parameters of the nearest points of curves by solving an equation by the Newton method with given initial approximations. If curves intersect and initial approximations are close to the intersection point, then parameters of the intersection point will be found.
If curves do not intersect in the region of initial approximations, then there will be found parameters of curves points where tangents to the curves are orthogonal to the segment which connects the found points.

Parameters:
[in]curve1- Curve 1.
[in]ext1- An attribute of search on the extension of the curve 1.
[in]curve2- Curve 2.
[in]ext2- An attribute of search on the extension of the curve 2.
[in]funcEpsilon- The minimal tolerance of the distance between curves intersection points.
[in]iterLimit- The maximum number of iterations.
[in,out]t1- Parameter of the curve 1 for the intersection point (the initial approximation at input).
[in,out]t2- Parameter of the curve 2 for the intersection point (the initial approximation at input).
Returns:
Error code: in a case of successful defining nr_Success (+1), nr_Special(0) or nr_Failure(-1) - in a case of failure.
void CalculatePolygon ( const MbCurve3D curve,
const MbStepData stepData,
std::vector< std::pair< double, MbCartPoint3D > > &  paramPoints 
)

Calculate polygon points of curve.

Parameters:
[in]curve- Curve.
[in]sag- Maximal value of sag.
[out]paramPoints- Array of parameters and points.
virtual void MbFunction::Explore ( double &  t,
bool  ext,
double &  val,
double &  fir,
double *  sec,
double *  thr 
) const [virtual]

Values of point and derivatives are calculated on parameter area and on extended axis.

Parameters:
[in]t- Parameter.
[in]ext- On parameters area (false), on extended axis (true).
[out]val- Valuet.
[out]fir- Derivative with respect to t.
[out]sec- Second derivative with respect to t, if not NULL.
[out]thr- Tyhird derivative with respect to t, if not NULL.

Reimplemented in MdCharacterFunction, MbConstFunction, MbCubicFunction, MbCubicSplineFunction, MbLineFunction, MbPowerFunction, and MbSinusFunction.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines