C3D Toolkit
Kernel - 117950, Vision - 2.7.5.29
|
NURBS curve in two-dimensional space. More...
#include <cur_nurbs.h>
Public Member Functions | |
DEPRECATE_DECLARE | MbNurbs () |
Common functions of geometric object. | |
MbePlaneType | IsA () const override |
Get the object type. | |
MbPlaneItem & | Duplicate (MbRegDuplicate *=nullptr) const override |
Create a copy. More... | |
bool | IsSame (const MbPlaneItem &other, double accuracy=LENGTH_EPSILON) const override |
Determine whether objects are equal. More... | |
bool | SetEqual (const MbPlaneItem &) override |
Make the objects equal. More... | |
void | Transform (const MbMatrix &matr, MbRegTransform *ireg=nullptr, const MbSurface *newSurface=nullptr) override |
Transform according to the matrix. More... | |
void | Move (const MbVector &to, MbRegTransform *=nullptr, const MbSurface *newSurface=nullptr) override |
Translate along a vector. More... | |
void | Rotate (const MbCartPoint &pnt, const MbDirection &angle, MbRegTransform *=nullptr, const MbSurface *newSurface=nullptr) override |
Rotate about a point. More... | |
void | GetProperties (MbProperties &) override |
Get properties of the object. More... | |
void | SetProperties (const MbProperties &) override |
Change properties of the object. More... | |
void | GetBasisPoints (MbControlData &) const override |
Get control points of object. | |
void | SetBasisPoints (const MbControlData &) override |
Change the object by control points. | |
Functions describing the domain of a curve. | |
double | GetTMin () const override |
Get the minimum value of parameter. | |
double | GetTMax () const override |
Get the maximum value of parameter. | |
bool | IsClosed () const override |
Define whether the curve is closed. More... | |
bool | IsDegenerate (double eps=Math::LengthEps) const override |
Define whether the curve is degenerate.. | |
bool | IsPeriodic () const override |
Define whether the curve is periodic. | |
Functions for working in the curve's domain. | |
Functions PointOn, FirstDer, SecondDer, ThirdDer,... correct parameter when it is out of domain bounds. | |
void | PointOn (double &t, MbCartPoint &pnt) const override |
Calculate a point on the curve. More... | |
void | FirstDer (double &t, MbVector &fd) const override |
Calculate first derivative. | |
void | SecondDer (double &t, MbVector &sd) const override |
Calculate second derivative. | |
void | ThirdDer (double &t, MbVector &td) const override |
Calculate third derivative. | |
Functions for get of the group of data inside and outside the curve's domain of parameter. | |
void | Explore (double &t, bool ext, MbCartPoint &pnt, MbVector &fir, MbVector *sec, MbVector *thir) const override |
Calculate point and derivatives of object for given parameter. More... | |
void | Derivatives (double &t, bool ext, MbVector &fir, MbVector *sec, MbVector *thi) const |
void | ExtPointOn (double t, MbCartPoint &pnt) const |
Point on the curve extension. | |
void | ExtFirstDer (double t, MbVector &fd) const |
The first derivative on the curve extension. | |
void | ExtSecondDer (double t, MbVector &sd) const |
The second derivative on the curve extension. | |
void | ExtThirdDer (double t, MbVector &td) const |
The third derivative on the curve extension. | |
MbResultType | Extend (const MbCurveExtensionParameters ¶meters, c3d::PlaneCurveSPtr &resCurve) const override |
Extend the curve. | |
Common functions of curve | |
void | CalculateGabarit (MbRect &) const override |
Detect the bounding box of a curve. More... | |
bool | IsStraight (bool ignoreParams=false) const override |
Define whether the curve is rectilinear.. | |
double | CalculateMetricLength () const override |
Calculate the metric length of a curve. | |
bool | DistanceAlong (double &t, double len, int curveDir, double eps=Math::LengthEps, VERSION version=Math::DefaultMathVersion()) const override |
Translate parameter along the curve. More... | |
double | CalculateLength (double t1, double t2) const override |
Calculate the metric length of a curve. More... | |
size_t | GetCount () const override |
Define the number of splittings for one passage in operations. | |
MbNurbs * | NurbsCurve (const MbCurveIntoNurbsInfo &) const override |
Construct a NURBS copy of a curve. More... | |
MbCurve * | NurbsCurve (const MbNurbsParameters &tParameters) const override |
Construct a NURBS copy of a curve. More... | |
MbContour * | NurbsContour () const override |
Approximate of a curve by the contour from NURBS curves. | |
MbCurve * | Trimmed (double t1, double t2, int sense, bool saveParamLenAndLaw=false) const override |
Construct a trimmed curve. More... | |
void | Refresh () override |
Set all temporary (mutable) data of object to undefined (initial) state. | |
void | Inverse (MbRegTransform *iReg=nullptr) override |
Set the opposite direction of curve. | |
bool | IsReparamSame (const MbCurve &curve, double &factor) const override |
Define whether a reparameterized curve is the same. More... | |
double | Step (double t, double sag) const override |
Calculate parameter step. More... | |
double | DeviationStep (double t, double angle) const override |
Calculate parameter step. More... | |
void | CalculatePolygon (double sag, MbPolygon &) const override |
Calculate an array of points for drawing. More... | |
MbeState | DeletePart (double t1, double t2, MbCurve *&part2) override |
Delete the piece of a curve. More... | |
MbeState | TrimmPart (double t1, double t2, MbCurve *&part2) override |
Keep the piece of a curve. More... | |
MbeState | Deformation (const MbRect &, const MbMatrix &) override |
Deform the curve. More... | |
bool | GoThroughPoint (MbCartPoint &p0) override |
Create a curve through a point. More... | |
void | TangentPoint (const MbCartPoint &pnt, SArray< double > &tFind) const override |
Find tangents to a curve. More... | |
void | OffsetCuspPoint (SArray< double > &tCusps, double dist) const override |
Find the special points of an offset curve. More... | |
bool | GetCentre (MbCartPoint &) const override |
Calculate a center of curve. | |
double | GetRadius () const override |
Get the physical radius of the curve or null if it impossible. More... | |
bool | GetAxisPoint (MbCartPoint &p) const override |
Calculate a point to construct an axis. More... | |
bool | IsSimilarToCurve (const MbCurve &curve, double precision=PARAM_PRECISION) const override |
Define whether the curves are similar for the merge. | |
void | MakeTangentLine (MbLine *line) |
Touching the spline by line. | |
void | ConvexHull (ptrdiff_t seg, MbCartPoint *p) const |
Determine the convex hull of the curve segment. | |
void | GetAnalyticalFunctionsBounds (std::vector< double > ¶ms) const override |
Get the boundaries of the curve sections that are described by one analytical function. | |
Common functions of polygonal curve. | |
void | GetRuleInterval (ptrdiff_t index, double &t1, double &t2) const override |
Get the range of influence of point of the curve. More... | |
void | Rebuild () override |
Rebuild curve. | |
void | SetClosed (bool cls) override |
Set attribute of closedness. | |
void | RemovePoint (ptrdiff_t index) override |
Remove control point with given index. | |
void | RemovePoints () override |
Remove all points. | |
void | AddPoint (const MbCartPoint &pnt) override |
Add point to the end of the array of control points. | |
void | InsertPoint (ptrdiff_t index, const MbCartPoint &pnt) override |
Insert a point to the array of control points. More... | |
void | InsertPoint (double t, const MbCartPoint &pnt, double xEps, double yEps) override |
Insert a point to the array of control points. More... | |
void | ChangePoint (ptrdiff_t index, const MbCartPoint &pnt) override |
Replace a point. More... | |
bool | ChangePointsValue (const SArray< MbCartPoint > &pntList) override |
Change control points. More... | |
bool | CheckParam (double &t, ptrdiff_t &i0, ptrdiff_t &i1, double &t0, double &t1) const override |
Drive a parameter into the curve domain. More... | |
double | GetParam (ptrdiff_t i) const override |
Get parameter corresponding to the point with specified index. | |
size_t | GetParamsCount () const override |
Get count of parameters. | |
void | ResetTCalc () const override |
Reset the current value of parameter. | |
double | DistanceToPoint (const MbCartPoint &to) const override |
Calculate the distance to a point. | |
bool | DistanceToPointIfLess (const MbCartPoint &to, double &d) const override |
Calculate the distance to a point. More... | |
double | PointProjection (const MbCartPoint &pnt) const override |
Find the point projection to the curve. | |
bool | NearPointProjection (const MbCartPoint &pnt, double xEpsilon, double yEpsilon, double &t, bool ext, MbRect1D *tRange=nullptr) const override |
Find the point projection to the curve. More... | |
bool | IsContinuousDerivative (bool &contLength, bool &contDirect, c3d::DoubleVector *params=nullptr, double epsilon=EPSILON) const override |
Get properties of the object. More... | |
bool | SetContinuousDerivativeLength (VERSION version, double epsilon=EPSILON) override |
Eliminate the discontinuities of the first derivative at length. More... | |
void | GetStartPoint (MbCartPoint &) const override |
Calculate a start point of a curve. | |
void | GetEndPoint (MbCartPoint &) const override |
Calculate an end point of a curve. | |
Functions of B-spline. | |
void | AddPoint (ptrdiff_t index, const MbCartPoint &pnt, double weight) |
Add a point with weight. | |
void | AddPoint (const MbCartPoint &pnt, double weight) |
Add point to the end of the array. | |
MbContour * | CreateContour () const |
Create a contour from the NURBS curve. | |
MbNurbs * | Break (double t1, double t2) const |
Break a part. | |
MbeNurbsCurveForm | GetFormType () const |
Get form of B-spline. | |
size_t | GetDegree () const |
Get the spline order. | |
bool | IsRational () const |
Get attribute of rationality, but no regularity of curve. | |
size_t | GetWeightsCount () const |
Get a size of weights vector. | |
template<class WeightsVector > | |
void | GetWeights (WeightsVector &wts, bool justSet=true) const |
Get a weights vector. | |
double | GetWeight (size_t ind) const |
Get a weights vector element value by index. | |
double & | SetWeight (size_t ind) |
Get a weights vector element value by index. | |
size_t | GetKnotsCount () const |
Get a size of knots vector. | |
template<class KnotsVector > | |
void | GetKnots (KnotsVector &kts, bool justSet=true) const |
Get a knots vector. | |
double | GetKnot (size_t ind) const |
Get a knots vector element value by index. | |
double & | SetKnot (size_t ind) |
Get a knots vector element value by index. | |
ptrdiff_t | GetUppKnotsIndex () const |
Get the maximal index of knots vector. | |
void | LtAddPoint (MbCartPoint &pnt, double weight) |
Add point to the end of the array. | |
void | LtAddPowerPoint (MbCartPoint &pnt) |
Add a control point with degree representation to the end of the array. | |
void | LtAddKnot (double knot) |
Add a knot to the end of knot vector. | |
void | LtSetDegree (size_t newDegree) |
Set the spline order. | |
void | LtSetClosed (bool cls) |
Set the closedness attribute. | |
void | LtSetData (size_t d, bool c, MbeNurbsCurveForm f) |
Change degree, closedness and type of shape. | |
bool | LtRebuild () |
Rebuild the spline. | |
void | LtInit () |
Initialization. | |
bool | LtInitPowerArc () |
bool | LtTrimmed (double t1, double t2, int sense=1) |
void | Bezier (MbNurbs &bezierForm) const |
Create a Bezier shape of Nurbs. | |
bool | Concatenate (MbNurbs &) |
Attach nurbs. | |
void | SetWeight (ptrdiff_t pointNumber, double newWeight) |
Set weight for control point. | |
size_t | KnotMultiplicity (ptrdiff_t knotIndex) const |
Get the knot multiplicity. | |
void | DefineKnotsVector () |
Determination of basis knot vector. | |
bool | OpenKnotsVector () |
Redetermination of the basis knot vector from Close to Open. | |
bool | CloseKnotsVector () |
Redetermination of the basis knot vector from Open to Close. | |
void | CyclicShift (ptrdiff_t interval) |
Shift parameter of closed spline. | |
void | CyclicShift (double t) |
bool | BasicFunctions (double &t, ptrdiff_t k, CcArray< double > &values, ptrdiff_t &left, double &sum) |
void | CheckForm () |
MbCurve * | ConvertToConic () |
Transform a curve into a conic section if it is possible. | |
bool | SetLimitParam (double newTMin, double newTMax) |
Set the range of parameter. | |
size_t | InsertKnots (double &newKnot, size_t multiplicity, double relEps) |
Addition of a new knots; returns the number of knots which have been inserted. | |
ptrdiff_t | RemoveKnot (ptrdiff_t id, ptrdiff_t num, double relEps=Math::paramEpsilon, double absEps=Math::lengthEpsilon) |
Remove multiple internal 'id' knot 'num' times, return count of removals was successfully made. | |
void | RemoveAllKnots (double relEps=Math::paramEpsilon, double absEps=Math::lengthEpsilon) |
Remove all internal knots if it is possible. | |
bool | DecomposeCurve () |
Convert this nurbs to Bezier form; knot vector to clamped. | |
bool | UnClamped (bool clm) |
Transform knot vector to clamped (if curve is closed and clm = false) or unclamped (if curve is open and clm = true). | |
void | AddCurve (MbNurbs &, bool bmerge=true) |
Add curve to the end. | |
template<class NurbsCurves > | |
void | AddCurves (NurbsCurves &curves) |
Add curves to the end. | |
bool | BreakC0NURBS4 (RPArray< MbCurve > &, bool bline=true) |
Split the curve. More... | |
bool | BreakC0 (c3d::PlaneCurvesSPtrVector &, double metricAcc=METRIC_EPSILON) |
Split NURBS-curve at places where the curve is non-differentiable. Parametrization does not remain. | |
bool | ExtendNurbs (double, double, bool bmerge=false) |
Extend open NURBS-curve by tangents. | |
void | FixClosedNurbs () |
Make curve closed. More... | |
![]() | |
virtual | ~MbPolyCurve () |
Destructor. | |
MbePlaneType | Type () const override |
Get the group type of the object. | |
void | AddYourGabaritTo (MbRect &r) const override |
Extend the given bounding rectangle so that it encloses this object. | |
void | Refresh () override |
Set all temporary (mutable) data of object to undefined (initial) state. | |
void | PrepareIntegralData (const bool forced) const override |
Calculate temporary (mutable) data of an object. More... | |
bool | IsClosed () const override |
Define whether the curve is closed. More... | |
bool | IsStraight (bool ignoreParams=false) const override |
Define whether the curve is rectilinear.. | |
bool | HasLength (double &length) const override |
Calculate the metric length of a curve. More... | |
MbeState | Deformation (const MbRect &, const MbMatrix &) override |
Deform the curve. More... | |
bool | IsInRectForDeform (const MbRect &r) const override |
Determine visibility of a curve in rectangle. | |
size_t | GetCount () const override |
Define the number of splittings for one passage in operations. | |
double | GetMetricLength () const override |
Calculate the metric length of a curve. More... | |
double | GetLengthEvaluation () const override |
Calculate the metric length of a curve. More... | |
bool | GetSpecificPoint (const MbCartPoint &from, double &dmax, MbCartPoint &pnt) const override |
Return a specific point of a curve. More... | |
void | GetBasisPoints (MbControlData &) const override |
Get control points of object. | |
void | SetBasisPoints (const MbControlData &) override |
Change the object by control points. | |
virtual size_t | GetPointsCount () const |
Get count of control points. | |
virtual void | GetPoint (ptrdiff_t index, MbCartPoint &pnt) const |
Get control point. More... | |
virtual ptrdiff_t | GetNearPointIndex (const MbCartPoint &pnt) const |
Get index of the point nearest to the given one. | |
virtual void | SetBegEndDerivesEqual () |
Set equal derivatives at the ends. | |
virtual void | ClosedBreak () |
Make curve open, keeping coincidence of the beginning and the end. | |
virtual void | AddAfter (const MbCartPoint &pnt, ptrdiff_t index) |
Insert a point to the array of control points. More... | |
virtual void | InsertPoint (double t, const MbCartPoint &pnt, const MbVector &v, double xEps, double yEps) |
Insert a point to the array of control points. More... | |
virtual void | ChangePole (ptrdiff_t index, const MbCartPoint &pnt) |
Replace a pole. More... | |
virtual void | GetTList (SArray< double > ¶ms) const |
size_t | GetPointListCount () const |
Get count of control points. | |
ptrdiff_t | GetPointListMaxIndex () const |
Get maximal index of array of control points. | |
template<class PointsVector > | |
void | GetPoints (PointsVector &pnts) const |
Get array of control points. | |
void | GetPointList (SArray< MbCartPoint > &pnts) const |
Get array of control points. | |
void | GetPointList (c3d::ParamPointsVector &pnts) const |
Get array of control points. | |
bool | ReplacePoints (const SArray< MbCartPoint > &pnts) |
Replace the set of control points. | |
bool | ReplacePoints (const std::vector< MbCartPoint > &pnts) |
Replace the set of control points. | |
const MbCartPoint & | GetPointList (size_t i) const |
Get control point with the given index. | |
MbCartPoint & | SetPointList (size_t i) |
Get control point with the given index. | |
ptrdiff_t | GetUppIndex () const |
Get the maximal index of array of control points. | |
size_t | GetSegmentsCount () const |
Get count of ranges. | |
template<class SegmentsVector > | |
void | GetLineSegments (SegmentsVector &segments, double eps=PARAM_PRECISION) const |
Get the array of segments. | |
bool | NurbsParam (double epsilon, double &pmin, double &pmax, ptrdiff_t &i1, double &t1, ptrdiff_t &i2, double &t2) const |
Get information for NurbsCurve function. More... | |
![]() | |
virtual | ~MbCurve () |
Destructor. | |
MbePlaneType | Type () const override |
Get the group type of the object. | |
MbePlaneType | Family () const override |
Get family of object. | |
void | Refresh () override |
Set all temporary (mutable) data of object to undefined (initial) state. | |
size_t | size () const |
Number of objects if object is interpreted as vector of objects. | |
const MbCurve * | operator[] (size_t) const |
An access operator. | |
virtual void | AddYourGabaritMtr (MbRect &rect, const MbMatrix &matr) const |
Add a bounding box to rectangle. More... | |
virtual void | CalculateLocalGabarit (const MbMatrix &into, MbRect &local) const |
Calculate bounding box in the local coordinate system. More... | |
bool | IsVisibleInRect (const MbRect &rect, bool exact=false) const override |
Determine visibility of an object in rectangle. More... | |
virtual bool | IsCompleteInRect (const MbRect &rect) const |
Determine whether an object is fully visible in rectangle. More... | |
double | DistanceToPoint (const MbCartPoint &toP) const override |
Calculate the distance to a point. | |
bool | DistanceToPointIfLess (const MbCartPoint &toP, double &d) const override |
Calculate the distance to a point. More... | |
virtual double | GetPeriod () const |
Return period. More... | |
bool | IsTouch (double eps=Math::LengthEps) const |
Determine whether a curve is closed regardless of the smoothness of the closure. More... | |
void | Tangent (double &t, MbVector &v) const |
Calculate tangent vector (normalized). | |
void | Tangent (double &t, MbDirection &d) const |
Calculate tangent vector (normalized). | |
void | Normal (double &t, MbVector &v) const |
Calculate main normal vector (normalized). | |
void | Normal (double &t, MbDirection &d) const |
Calculate main normal vector (normalized). | |
virtual void | _PointOn (double t, MbCartPoint &p) const |
Calculate point at curve and its extension. More... | |
virtual void | _FirstDer (double t, MbVector &v) const |
Calculate first derivative at curve and its extension. | |
virtual void | _SecondDer (double t, MbVector &v) const |
Calculate second derivative at curve and its extension. | |
virtual void | _ThirdDer (double t, MbVector &v) const |
Calculate third derivative at curve and its extension. | |
void | _Tangent (double t, MbVector &v) const |
Calculate tangent vector (normalized). | |
void | _Tangent (double t, MbDirection &d) const |
Calculate tangent vector (normalized). | |
void | _Normal (double t, MbVector &v) const |
Calculate main normal vector (normalized) at curve and its extension. | |
void | _Normal (double t, MbDirection &d) const |
Calculate main normal vector (normalized) at curve and its extension. | |
virtual double | Curvature (double t) const |
Calculate curvature of curve. | |
double | CurvatureDerive (double t) const |
Calculate derivative of curvature by parameter. | |
double | CurvatureRadius (double t) const |
Calculate radius of curve with a sign. | |
virtual bool | IsBounded () const |
Define whether the curve is bounded. | |
virtual bool | IsSmoothConnected (double angleEps) const |
Define whether joints of contour/curve are smooth. | |
double | GetParamLength () const |
Calculate the parametric length of a curve. | |
virtual MbCurve * | Offset (double rad) const |
Construct the equidistant curve which is shifted by the given value. | |
virtual bool | BeginApprox (double sag, double &tbeg, double &tend, MbCartPoint &pnt, bool &existNextPoint) const |
Start approximation for the drawing. More... | |
virtual bool | GetNextPoint (double sag, double tend, double &tcur, MbCartPoint &pnt) const |
Calculate the next point. More... | |
MbNurbs * | NurbsCurve (const MbCurveIntoNurbsInfo *nInfo=nullptr) const |
Construct a NURBS copy of a curve. More... | |
virtual MbeItemLocation | PointRelative (const MbCartPoint &pnt, double eps=Math::LengthEps) const |
Define the point position relative to the curve. More... | |
virtual MbeLocation | PointLocation (const MbCartPoint &pnt, double eps=Math::LengthEps) const |
The point position relative to the curve. | |
MbeNewtonResult | PointProjectionNewton (const MbCartPoint &p, double xEpsilon, double yEpsilon, size_t iterLimit, double &t, bool ext) const |
Find the point projection to the curve. More... | |
void | PointProjection (const MbCartPoint &pnt, MbCartPoint &on) const |
Calculate the point projection to the curve. More... | |
void | BasePointProjection (const MbCartPoint &pnt, MbCartPoint &on) const |
Calculate the point projection to the curve. More... | |
void | PointProjectionAndAngle (MbCartPoint &on, double &angle) const |
Calculate the point projection to the curve. More... | |
bool | DirectPointProjection (const MbCartPoint &pnt, const MbDirection &dir, MbCartPoint &pp) const |
Calculate the point projection to the curve. More... | |
virtual bool | SmallestPerpendicular (const MbCartPoint &pnt, double &tProj) const |
Find the nearest perpendicular to the curve. More... | |
virtual void | PerpendicularPoint (const MbCartPoint &pnt, SArray< double > &tFind) const |
Find perpendiculars to a curve. More... | |
virtual void | IntersectHorizontal (double y, SArray< double > &cross) const |
Find intersections of a curve with horizontal line. More... | |
virtual void | IntersectVertical (double x, SArray< double > &cross) const |
Find intersections of a curve with vertical line. More... | |
virtual void | Isoclinal (const MbVector &angle, SArray< double > &tFind) const |
Construct isoclines. More... | |
void | HorzIsoclinal (SArray< double > &tFind) const |
Construct horizontal isoclines. More... | |
void | VertIsoclinal (SArray< double > &tFind) const |
Construct vertical isoclines. More... | |
void | LowestPoint (MbCartPoint &lowestPoint, double &tLowest) const |
Find the lowest point of a curve and the corresponding parameter. | |
virtual void | SelfIntersect (SArray< MbCrossPoint > &, double metricEps=Math::LengthEps) const |
Find self-intersections of curve. More... | |
virtual bool | GetMiddlePoint (MbCartPoint &) const |
Calculate a middle point of a curve. | |
void | GetPointsByEvenParamDelta (size_t n, std::vector< MbCartPoint > &pnts) const |
Get n points of a curve with equal intervals by parameter. | |
void | GetPointsByEvenParamDelta (size_t n, SArray< MbCartPoint > &pnts) const |
virtual void | GetPointsByEvenLengthDelta (size_t n, std::vector< MbCartPoint > &pnts) const |
Get n points of a curve with equal intervals by arc length. | |
void | GetPointsByEvenLengthDelta (size_t n, SArray< MbCartPoint > &pnts) const |
virtual double | LengthBetween2Points (MbCartPoint &p1, MbCartPoint &p2, MbCartPoint *pc=nullptr) const |
Calculate minimal length of a curve between two points on it. More... | |
virtual bool | GetWeightCentre (MbCartPoint &) const |
Calculate the center of gravity of a curve. | |
bool | IsPointOn (const MbCartPoint &, double eps=Math::LengthEps) const |
Check whether the point is on a curve with the tolerance eps. | |
bool | IsParamOn (double t, double eps=Math::paramEpsilon) const |
Check whether the parameter is inside a range with the tolerance eps. | |
void | CorrectCyclicParameter (double &t, double eps=Math::paramRegion) const |
Correct parameter for closed curves. More... | |
void | CorrectParameter (double &t) const |
Correct parameter. More... | |
MbCurve * | InverseDuplicate () const |
Create a copy with changed direction. | |
bool | IsInverseSame (const MbCurve &curve, double accuracy=LENGTH_EPSILON) const |
Define whether an inversed curve is the same. | |
MbCartPoint | GetLimitPoint (ptrdiff_t number) const |
Calculate the boundary point. More... | |
void | GetLimitPoint (ptrdiff_t number, MbCartPoint &pnt) const |
Calculate the boundary point. More... | |
void | GetLimitTangent (ptrdiff_t number, MbVector &v) const |
Calculate a tangent vector to the boundary point. More... | |
void | GetLimitPointAndTangent (ptrdiff_t number, MbCartPoint &pnt, MbVector &v) const |
Calculate a tangent vector and point at the end of a curve. More... | |
bool | AreLimitPointsEqual () const |
Are boundary points equal? More... | |
virtual const MbCurve & | GetBasisCurve () const |
Returns the base curve if exists or itself. | |
virtual MbCurve & | SetBasisCurve () |
Returns the base curve if exists or itself. | |
virtual double | GetParamDelta () const |
Return an indent by parameter of a curve. | |
virtual const MbCurve & | GetSubstrate () const |
Get a substrate or itself. | |
virtual MbCurve & | SetSubstrate () |
Get a substrate or itself. | |
virtual int | SubstrateCurveDirection () const |
Return direction of a substrate relative to a curve or vice versa. | |
virtual void | SubstrateToCurve (double &) const |
Transform a substrate parameter to the curve parameter. | |
virtual void | CurveToSubstrate (double &) const |
Transform a curve parameter to the substrate parameter. | |
virtual double | GetParamToUnit () const |
Return increment of parameter, corresponding to the unit length in space. | |
virtual double | GetParamToUnit (double t) const |
Return increment of parameter, corresponding to the unit length in space according to parameter. | |
virtual double | GetTEpsilon (double epsilon) const |
Return the minimal discernible value of parameter with the given tolerance. | |
virtual double | GetTEpsilon (double t, double epsilon) const |
Return the minimal discernible value of parameter with the given tolerance according to parameter. | |
virtual double | GetTRegion (double epsilon) const |
Return the minimal discernible value of parameter with the given tolerance. | |
virtual double | GetTRegion (double t, double epsilon) const |
Return the minimal discernible value of parameter with the given tolerance according to parameter. | |
double | GetTMid () const |
Return the middle of parametric range of a curve. | |
double | GetTRange () const |
Return the parametric length of a curve. | |
MbCartPoint | PointOn (double &t) const |
Calculate point on the curve. | |
MbVector | FirstDer (double &t) const |
Calculate first derivative. | |
MbDirection | Tangent (double &t) const |
Calculate tangent vector (normalized). | |
MbDirection | Normal (double &t) const |
Calculate the normal vector. | |
double | DerLength (double &t) const |
Calculate the length of derivative vector. | |
virtual void | BreakPoints (std::vector< double > &vBreaks, double precision=ANGLE_REGION) const |
\ ru Определение точек излома кривой. The determination of curve smoothness break points. | |
MbProperty & | CreateProperty (MbePrompt name) const override |
Create a custom property. | |
bool | IsSpaceNear (const MbCurve &curve, double eps, bool ext, double devSag=5.0 *Math::deviateSag) const |
Check whether the two curves are metrically close. More... | |
bool | IsSpaceNear (const MbCurve &curve, double xEps, double yEps, bool ext, double xNear, double yNear, double devSag=5.0 *Math::deviateSag) const |
Check whether the two curves are metrically close. More... | |
SimpleName | GetCurveName () const |
A curve name. | |
void | SetCurveName (SimpleName newName) |
Set a curve name. | |
![]() | |
virtual | ~MbPlaneItem () |
Destructor. | |
void | PrepareWrite () const |
Object registration. More... | |
MbeRefType | RefType () const override |
Get the registration type (for copying, duplication). | |
virtual void | Rotate (const MbCartPoint &pnt, double angle, MbRegTransform *iReg=nullptr, const MbSurface *newSurface=nullptr) |
Rotate about a point. More... | |
virtual bool | IsSimilar (const MbPlaneItem &item) const |
Determine whether the objects are similar. More... | |
![]() | |
TapeBase (RegistrableRec regs=noRegistrable) | |
Constructor. | |
TapeBase (const TapeBase &) | |
Copy-constructor. | |
virtual | ~TapeBase () |
Destructor. | |
RegistrableRec | GetRegistrable () const |
Whether the stream class is registrable. | |
void | SetRegistrable (RegistrableRec regs=registrable) const |
Set the state of registration of the stream class. | |
virtual const char * | GetPureName (const VersionContainer &) const |
Get the class name. | |
virtual bool | IsFamilyRegistrable () const |
Whether the object belongs to a registrable family. | |
![]() | |
refcount_t | GetUseCount () const |
Get count of references (get count of owners of an object). | |
refcount_t | AddRef () const |
Increase count of references by one. | |
refcount_t | DecRef () const |
Decrease count of references by one. | |
refcount_t | Release () const |
Decrease count of references by one and if count of references became zero, then remove itself. | |
![]() | |
void | Lock () const |
Switch lock on (locking happens only in parallel region). | |
void | Unlock () const |
Switch lock off if locking has been set. | |
CommonRecursiveMutex * | GetLock () const |
Get a pointer to the mutex object. Return nullptr if no parallelism. For use in ScopedLock. | |
Static Public Member Functions | |
static MbNurbs * | Create (const MbNurbs &) |
Create copy of spline. More... | |
template<class PointsVector > | |
static MbNurbs * | Create (ptrdiff_t initDegree, const PointsVector &initPoints, bool initClosed) |
Create spline. More... | |
template<class PointsVector , class DoubleVector > | |
static MbNurbs * | Create (ptrdiff_t initDegree, const PointsVector &initPoints, bool initClosed, const DoubleVector *initWeights) |
Create spline. More... | |
template<class PointsVector , class DoubleVector > | |
static MbNurbs * | Create (ptrdiff_t initDegree, bool initClosed, const PointsVector &initPoints, const DoubleVector &initWeights, const DoubleVector &initKnots, MbeNurbsCurveForm initForm=ncf_Unspecified) |
Create spline. More... | |
static MbNurbs * | CreateThrough (size_t degree, bool cls, const SArray< MbCartPoint > &points, const SArray< double > ¶ms, SArray< double > *aKnots=nullptr) |
Create spline. More... | |
static MbNurbs * | CreateParasolid (size_t degree, bool closed, bool rational, ptrdiff_t count, const CcArray< double > &verts, ptrdiff_t vertsCount, const CcArray< ptrdiff_t > &mul, ptrdiff_t mulCount, const CcArray< double > &knots, ptrdiff_t knotsCount, double scl) |
Fill NURBS by parasolid data. More... | |
static MbNurbs * | CreateCube (const MbCartPoint &p1, const MbVector &v1, const MbCartPoint &p2, const MbVector &v2) |
Create spline. More... | |
static MbNurbs * | CreateArc (const SArray< MbCartPoint > &points) |
Create spline. More... | |
static MbNurbs * | CreateArc (double a2, const MbCartPoint &p1, const MbCartPoint &p2) |
Create spline. More... | |
static MbNurbs * | CreateWavyLine (const MbCartPoint &p1, const MbCartPoint &p2, double height, double periode) |
Create spline. More... | |
Protected Member Functions | |
template<class PointsVector , class DoubleVector > | |
MbNurbs (size_t degree, bool cls, const PointsVector &points, const DoubleVector *weights, const DoubleVector *knots) | |
Constructor. More... | |
bool | CanChangeClosed () const override |
Determine whether it is possible to change an attribute of closedness. | |
![]() | |
MbPolyCurve () | |
Default constructor. | |
MbPolyCurve (const MbPolyCurve &pCurve) | |
Copy-constructor. | |
![]() | |
MbCurve () | |
Default constructor. | |
MbCurve (const MbCurve &other) | |
Copy-constructor. | |
![]() | |
MbPlaneItem () | |
Constructor. | |
![]() | |
MbRefItem () | |
Constructor without parameters. | |
Functions of NURBS curve initialization. | |
void | Init (const MbNurbs &) |
Set the spline parameters by a given NURBS curve. | |
template<class PointsVector > | |
bool | Init (size_t initDegree, const PointsVector &initPoints, bool initClosed) |
Initialization. More... | |
template<class PointsVector , class DoubleVector > | |
bool | Init (size_t initDegree, const PointsVector &initPoints, bool initClosed, const DoubleVector *initWeights) |
Initialization. More... | |
template<class PointsVector , class DoubleVector > | |
bool | Init (size_t initDegree, bool initClosed, const PointsVector &initPoints, const DoubleVector &initWeights, const DoubleVector &initKnots, MbeNurbsCurveForm initForm=ncf_Unspecified) |
Initialization. More... | |
bool | Init (size_t degree, bool cls, const CcArray< double > &points, const CcArray< double > &knots, ptrdiff_t nPoints, ptrdiff_t nKnots) |
Initialization. More... | |
bool | InitThrough (size_t degree, bool cls, const SArray< MbCartPoint > &points, const SArray< double > ¶ms, SArray< double > *aKnots=nullptr) |
Initialization. More... | |
bool | InitThrough (size_t degree, bool cls, const c3d::ParamPointsVector &points, const c3d::DoubleVector ¶ms, c3d::DoubleVector *aKnots=nullptr) |
Initialization. More... | |
bool | InitLine (double t1, const MbCartPoint &p1, double t2, const MbCartPoint &p2) |
Initialization. More... | |
bool | InitCube (const MbCartPoint &p1, const MbVector &v1, const MbCartPoint &p2, const MbVector &v2) |
Initialization. More... | |
bool | AttachG (c3d::PntMatingData2D &connectData, bool beg) |
Set conjugation at the end. | |
bool | RaiseDegree (size_t newDegree, double relEps=Math::paramEpsilon) |
Increase order of curve without changing its geometric shape and parametrization. More... | |
bool | ReductionDegree (double relEps=Math::paramEpsilon) |
Decrease order of nurbs curve by 1 without changing its geometric shape and parametrization. More... | |
bool | SetDegree (size_t newDegree) |
Set the spline order. More... | |
void | DegreeIncrease () |
Increase the order by 1. | |
void | SetFormType (MbeNurbsCurveForm f) |
Set the type of shape. | |
bool | PointOnMultipleKnot (const MbCartPoint &point) const |
The point on a multiple knot. | |
static MbNurbs * | CreateNURBS2 (const SArray< MbCartPoint > &points, const SArray< double > ¶ms, bool cls) |
Interpolation. More... | |
static MbNurbs * | CreateNURBS4 (const SArray< MbCartPoint > &, MbeSplineParamType spType, const c3d::PntMatingData2D &begData, const c3d::PntMatingData2D &endData) |
Create cubic NURBS by parameters of conjugation and points which it passes through. | |
static MbNurbs * | CreateNURBS4 (const SArray< MbCartPoint > &, MbeSplineParamType spType, bool closed, RPArray< c3d::PntMatingData2D > &) |
Create cubic NURBS by interpolation points and data of conjugation at each point. | |
static MbNurbs * | CreateNURBS4 (const SArray< MbCartPoint > &, const SArray< double > &, bool closed, RPArray< c3d::PntMatingData2D > &) |
Create cubic NURBS by interpolation points, parameters and data of conjugation at each point. | |
static MbNurbs * | CreateNURBS4 (const SArray< MbCartPoint > &, bool cls, MbeSplineParamType spType, MbeSplineCreateType useInitThrough=sct_Version2) |
Interpolation. More... | |
static MbNurbs * | CreateNURBS4 (const SArray< MbCartPoint > &points, const SArray< double > ¶ms, bool cls, MbeSplineCreateType useInitThrough=sct_Version2) |
Interpolation. More... | |
static MbNurbs * | CreateNURBS4 (const SArray< double > &weights, const SArray< MbCartPoint > &points, SArray< double > ¶ms, bool cls) |
Interpolation. More... | |
static MbNurbs * | CreateNURBS4 (const SArray< MbCartPoint > &points, const SArray< double > ¶ms, const MbVector &, const MbVector &, bool cls, bool bfstS=true, bool bfstN=true) |
Interpolation. More... | |
static MbNurbs * | CreateNURBS4 (const SArray< MbCartPoint > &points, const SArray< MbVector > &vectors, const SArray< double > ¶ms, bool cls) |
Interpolation. More... | |
static MbNurbs * | CreateNURBS4 (const MbBezier &) |
Interpolation. More... | |
Additional Inherited Members | |
![]() | |
SArray< MbCartPoint > | pointList |
Set of control points. | |
ptrdiff_t | uppIndex |
Count of curve pieces (is equal to count of control points minus one). | |
bool | closed |
An attribute of curve closedness. | |
MbRect | rect |
Bounding rectangle. | |
double | metricLength |
Metric length of a spline. | |
![]() | |
SimpleName | name |
A curve name. The object data is temporary and used internally. | |
NURBS curve in two-dimensional space.
NURBS curve is defined by 'pointList' control points, weights of control points ('weights'), knot vector ('knots') and order of spline ('degree').
Abbreviation of NURBS is obtained from the first letters of the Non-Uniform Rational B-Spline phrase. NURBS curve doesn't pass through its control points. 'knots' knot vector has to be not decreasing sequence of real numbers. 'pointList' and 'weights' sets have to contain the same count of elements. For not closed curve 'knots' knot vector has to contain the count of elements of 'pointList' set plus 'degree'. For closed curve 'knots' knot vector has to contain the count of elements of 'pointList' set plus 2*degree-1. Minimal value of spline parameter is equal to value of element of knot vector with degree-1 index. Maximal value of spline parameter is equal to value of element of knot vector with index, which is equal to index of last element minus degree-1. Curve calculation at each point is performed by normalized non-uniform B-splines.
Family of B-splines is defined by given crescent sequence of knot parameters and given order of B-spline.
DEPRECATE_DECLARE MbNurbs::MbNurbs | ( | ) |
|
protected |
Constructor.
Constructor by order, points, parameters and an attribute of closedness. If parameters initDegree and points is invalid then the curve behavior is undefined.
[in] | degree | - A spline order. It must be greater than unity. It shouldn't exceed count of control points. |
[in] | cls | - A closedness attribute. |
[in] | points | - Set of control points. Count of points must be greater than or equal to two. |
[in] | weights | - Set of weights for control points. Count of weights must be equal to count of points. |
[in] | knots | - Sequence of knot parameters. |
Create copy of spline.
Create copy of spline.
|
inlinestatic |
Create spline.
Create spline and set parameters of spline.
[in] | initDegree | - A spline order. |
[in] | initPoints | - Set of control points. |
[in] | initClosed | - A closedness attribute. |
|
inlinestatic |
Create spline.
Create spline and set parameters of spline.
[in] | initDegree | - A spline order. |
[in] | initPoints | - Set of control points. |
[in] | initClosed | - A closedness attribute. |
[in] | initWeights | - Set of weights for control points. |
|
inlinestatic |
Create spline.
Create spline and set parameters of spline.
[in] | initDegree | - A spline order. |
[in] | initClosed | - A closedness attribute. |
[in] | initPoints | - Set of control points. |
[in] | initWeights | - Set of weights for control points. |
[in] | initKnots | - Non-decreasing sequence of weights. |
[in] | initForm | - Type of construction. |
|
static |
Create spline.
Spline passing through given points at given parameters.
In case of closedness it is necessary to pass the array with coincidence of the first and the last points.
[in] | degree | - A spline order. |
[in] | cls | - A closedness attribute. |
[in] | points | - Set of points which the spline passes through. |
[in] | params | - Sequence of knot parameters. |
[in] | aKnots | - Nondecreasing sequence of knots. |
|
static |
Fill NURBS by parasolid data.
Fill NURBS by parasolid data.
[in] | degree | - Order of spline. |
[in] | closed | - A closedness attribute. |
[in] | rational | - Whether the curve is rational. if true then NURBS is created, false - Bezier curve. |
[in] | count | - Count of control points. |
[in] | verts | - An array of coordinates of points. If spline is rational, then the fourth coordinate - weight of point. |
[in] | vertsCount | - Count of elements in 'verts' array. |
[in] | mul | - Array with multiplicity of each knot. |
[in] | mulCount | - Count of elements in 'mul' array. |
[in] | knots | - Array with values of parameters at knots. Each value is presented only once. Information about knot multiplicity is in the element of 'mul' array with the same index. |
[in] | knotsCount | - Count of elements in 'knots' array. |
[in] | scl | - A scale factor. |
|
static |
Create spline.
Create spline and set parameters of spline.
[in] | p1 | - The initial point the spline passes through. |
[in] | v1 | - A tangent vector to the curve at the start point. |
[in] | p2 | - The final point the spline passes through. |
[in] | v2 | - A tangent vector to the curve at the end point. |
|
static |
Create spline.
Constructor of a spline describing the arc of a conic section.
[in] | points | - A set of four points the section passes through. The first and last points define the beginning and ending of the arc respectively. |
|
static |
Create spline.
Constructor of a spline describing the arc of a circle.
[in] | a2 | - A half opening angle. |
[in] | p1 | - The starting point of the arc. |
[in] | p2 | - The end point of the arc. |
|
static |
Create spline.
Constructor of a spline describing a wavy line.
[in] | p1 | - Start point of curve. |
[in] | p2 | - End point of curve. |
[in] | height | - Height of the wave. |
[in] | periode | - Period of the wave. |
|
inline |
Initialization.
Set parameters of spline.
[in] | initDegree | - A spline order. |
[in] | initPoints | - Set of control points. |
[in] | initClosed | - A closedness attribute. |
|
inline |
Initialization.
Set parameters of spline.
[in] | initDegree | - A spline order. |
[in] | initPoints | - Set of control points. |
[in] | initClosed | - A closedness attribute. |
[in] | initWeights | - Set of weights for control points. |
|
inline |
Initialization.
Set parameters of spline.
[in] | initDegree | - A spline order. |
[in] | initClosed | - A closedness attribute. |
[in] | initPoints | - Set of control points. |
[in] | initWeights | - Set of weights for control points. |
[in] | initKnots | - Non-decreasing sequence of weights. |
[in] | initForm | - Type of construction. |
bool MbNurbs::Init | ( | size_t | degree, |
bool | cls, | ||
const CcArray< double > & | points, | ||
const CcArray< double > & | knots, | ||
ptrdiff_t | nPoints, | ||
ptrdiff_t | nKnots | ||
) |
Initialization.
Set parameters of spline.
[in] | degree | - A spline order. |
[in] | cls | - A closedness attribute. |
[in] | points | - Set of control points. |
[in] | knots | - Non-decreasing sequence of knots. |
[in] | nPoints | - Count of control points. |
[in] | nKnots | - Count of knots. |
bool MbNurbs::InitThrough | ( | size_t | degree, |
bool | cls, | ||
const SArray< MbCartPoint > & | points, | ||
const SArray< double > & | params, | ||
SArray< double > * | aKnots = nullptr |
||
) |
Initialization.
Spline passing through given points at given parameters.
In case of closedness it is necessary to pass the array with coincidence of the first and the last points.
[in] | degree | - A spline order. |
[in] | cls | - A closedness attribute. |
[in] | points | - Set of points which the spline passes through. |
[in] | params | - Sequence of knot parameters. |
[in] | aKnots | - Nondecreasing sequence of knots. |
bool MbNurbs::InitThrough | ( | size_t | degree, |
bool | cls, | ||
const c3d::ParamPointsVector & | points, | ||
const c3d::DoubleVector & | params, | ||
c3d::DoubleVector * | aKnots = nullptr |
||
) |
Initialization.
Spline passing through given points at given parameters.
In case of closedness it is necessary to pass the array with coincidence of the first and the last points.
[in] | degree | - A spline order. |
[in] | cls | - A closedness attribute. |
[in] | points | - Set of points which the spline passes through. |
[in] | params | - Sequence of knot parameters. |
[in] | aKnots | - Nondecreasing sequence of knots. |
bool MbNurbs::InitLine | ( | double | t1, |
const MbCartPoint & | p1, | ||
double | t2, | ||
const MbCartPoint & | p2 | ||
) |
Initialization.
Initialize a straight spline.
[in] | t1 | - The initial knot. |
[in] | p1 | - The initial point the spline passes through. |
[in] | t2 | - The final knot. |
[in] | p2 | - The final point the spline passes through. |
bool MbNurbs::InitCube | ( | const MbCartPoint & | p1, |
const MbVector & | v1, | ||
const MbCartPoint & | p2, | ||
const MbVector & | v2 | ||
) |
Initialization.
Initialize a cubic curve as a spline.
[in] | p1 | - The initial point the spline passes through. |
[in] | v1 | - A tangent vector to the curve at the start point. |
[in] | p2 | - The final point the spline passes through. |
[in] | v2 | - A tangent vector to the curve at the end point. |
|
static |
Interpolation.
Create a planar spline of second-order by points, parameters and attribute of closedness.
|
static |
Interpolation.
Create a planar spline of fourth order by points, attribute of closedness and parametrization type.
NURBS passes through points. Used boundary condition of knot absence.
|
static |
Interpolation.
Create a planar spline of fourth order by points, parameters and attribute of closedness.
Used boundary condition of knot absence.
|
static |
Interpolation.
Create a planar spline of fourth order by weights, points, parameters and attribute of closedness.
Used boundary condition of knot absence.
|
static |
Interpolation.
Create a planar spline of fourth order by points, parameters and attribute of closedness with boundary conditions - given vectors of first or second derivatives.
Has 2 multiple internal knots, belongs to class of differentiable (but not twice differentiable) functions.
[in] | bfstS | - If true, then start boundary condition is the vector of the first derivative, otherwise - the vector of the second derivative. |
[in] | bfstN | - If true, then end boundary condition is the vector of first derivative, otherwise - vector of second derivative. |
|
static |
Interpolation.
Create a planar spline of fourth order by points, derivatives, parameters and attribute of closedness.
It has 2 multiple internal knots, belongs to the class of differentiable (but not twice differentiable) functions.
Interpolation.
Create a planar spline of fourth order by composite Bezier spline of fourth order.
If closedness is necessary - call UnClamped( bezier.IsClosed() ).
bool MbNurbs::RaiseDegree | ( | size_t | newDegree, |
double | relEps = Math::paramEpsilon |
||
) |
Increase order of curve without changing its geometric shape and parametrization.
Increase order of curve without changing its geometric shape and parametrization.
[in] | newDegree | - New order of spline. |
[in] | relEps | - Permissible shape error. |
bool MbNurbs::ReductionDegree | ( | double | relEps = Math::paramEpsilon | ) |
Decrease order of nurbs curve by 1 without changing its geometric shape and parametrization.
Decrease order of nurbs curve by 1 without changing its geometric shape and parametrization.
[in] | relEps | - Permissible shape error. |
bool MbNurbs::SetDegree | ( | size_t | newDegree | ) |
Set the spline order.
Set the spline order.
When you change the order, the parameterization of the spline is reset to uniform, the shape of the spline changes.
[in] | newDegree | - A new spline order. |
|
overridevirtual |
Create a copy.
Create a copy of the object using the registrator. The registrator is used for preventing multiple copying of an object. If the object contains references to other objects, then the included objects are copied too. It is allowed not to pass the registrator to a function. Then the new copy of the object will be created. It is allowed not to use the registrator while copying a single object or a set of disconnected objects. The registrator must be used to copy several correlated objects successively. It is possible that the objects' connection means that the objects contain references to the common objects. Then, while copying without using the registrator, one can get a set of copies which contain references to the different copies of a single included object, what leads to loss of connection between the copies.
[in] | iReg | - Registrator. |
Implements MbPlaneItem.
|
overridevirtual |
Determine whether objects are equal.
Objects of the same types with similar (equal) data are considered to be equal.
[in] | item | - Object for comparison. |
[in] | accuracy | - The accuracy. |
Implements MbPlaneItem.
|
overridevirtual |
Make the objects equal.
It is possible to make equal only similar objects. Similar object is equated to a given one by changing of numerical data.
[in] | item | - Object for initialization. |
Implements MbPlaneItem.
|
overridevirtual |
Transform according to the matrix.
Transform the initial object according to the matrix using the registrator. If the object contains references to the other geometric objects, then the nested objects are transformed according to the matrix. The registrator is used for preventing multiple transformation of the object. The function can be used without the registrator to transform a single object. The registrator must be used to transform a set of interdependent objects to prevent repeated transformation of the nested objects, since it is not ruled out that several objects from the set contain references to one or several common objects subject to transformation.
[in] | matr | - A transformation matrix. |
[in] | iReg | - Registrator. |
[in] | surface | - New base surface of object provided that 'matr' is a transformation matrix from the old surface to a new one. For transformation of projection curve. It isn't considered if the surface is planar. |
Implements MbPlaneItem.
|
overridevirtual |
Translate along a vector.
Translate a geometric object along the vector using the registrator. If the object contains references to the other objects, then the translation operation is applied to the nested objects. The registrator is used for preventing multiple transformation of the object. The function can be used without the registrator to transform a single object. The registrator must be used to transform a set of interdependent objects to prevent repeated transformation of the nested objects, since it is not ruled out that several objects from the set contain references to one or several common objects subject to translation.
[in] | to | - Translation vector. |
[in] | iReg | - Registrator. |
[in] | surface | - New base surface of object provided that 'matr' is a transformation matrix from the old surface to a new one. For transformation of projection curve. It isn't considered if the surface is planar. |
Implements MbPlaneItem.
|
overridevirtual |
Rotate about a point.
Rotate an object about a point by the given angle using the registrator. If the object contains references to the other geometric objects, then the rotation operation is applied to the nested objects too. The registrator is used for preventing multiple transformation of the object. The function can be used without the registrator to transform a single object. The registrator must be used to transform a set of interdependent objects to prevent repeated transformation of the nested objects, since it is not ruled out that several objects from the set contain references to one or several common objects subject to rotation.
[in] | pnt | - Fixed point. |
[in] | angle | - The rotation angle. |
[in] | iReg | - Registrator. |
[in] | surface | - New base surface of object provided that 'matr' is a transformation matrix from the old surface to a new one. For transformation of projection curve. It isn't considered if the surface is planar. |
Implements MbPlaneItem.
|
overridevirtual |
Get properties of the object.
Get internal data (properties) of an object for viewing and modification.
[in] | properties | - Container for internal data of an object. |
Implements MbPlaneItem.
|
overridevirtual |
Change properties of the object.
Change internal data (properties) of object is performed by copying of corresponding values from the given object.
[in] | properties | - Container for internal data of an object. |
Implements MbPlaneItem.
|
overridevirtual |
Define whether the curve is closed.
Define whether the curve is closed.
A curve is considered as closed if it is cyclic:
Implements MbCurve.
|
overridevirtual |
Calculate a point on the curve.
Correct parameter when getting out of domain bounds and calculate a point on the curve.
[in] | t | - Curve parameter. |
[out] | p | - A point on the curve. |
Implements MbCurve.
|
overridevirtual |
Calculate point and derivatives of object for given parameter.
Values of point and derivatives are calculated on parameter area and on extended curve.
[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 nullptr. |
[out] | thir | - Third derivative with respect to t, if not nullptr. |
Reimplemented from MbCurve.
|
overridevirtual |
Detect the bounding box of a curve.
The sent rectangle becomes empty for getting a bounding box. Then bounding boxes of an object are calculated and saved into a rectangle 'rect'.
Reimplemented from MbCurve.
|
overridevirtual |
Translate parameter along the curve.
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.
[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. |
[in] | version | - Version. |
Reimplemented from MbCurve.
|
overridevirtual |
Calculate the metric length of a curve.
Calculate the metric length of unclosed curve from parameter t1 to parameter t2. The condition t1 < t2 should satisfied.
[in] | t1 | - Start parameter of a curve section. |
[in] | t2 | - End parameter of a curve section. |
Reimplemented from MbCurve.
|
overridevirtual |
Construct a NURBS copy of a curve.
Constructs a NURBS curve which approximates a given curve inside the range [t1, t2]. with a given direction. If it is possible, constructs the accurate curve, perhaps with multiple knots. The number of knots for NURBS is defined depending on the curve.
[in,out] | nurbs | - A constructed NURBS-curve. |
[in] | t1 | - Parameter corresponding to start of approximated part of a curve. |
[in] | t2 | - Parameter corresponding to end of approximated part of a curve. |
[in] | sense | - Does the direction of parameter increasing along the NURBS curve coincide with direction of the initial curve. 'sense' > 0 - direction coincide. |
[in] | nInfo | - Parameters of conversion of a curve to NURBS. |
Implements MbCurve.
|
overridevirtual |
Construct a NURBS copy of a curve.
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.
[in] | tParameters | - Parameters for the construction of a NURBS copy of the curve. |
Reimplemented from MbCurve.
|
overridevirtual |
Construct a trimmed curve.
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 curve (or for an arc - exception) 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.
[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] | saveParLenAndLaw | - Save parametric length and law. |
Implements MbCurve.
|
overridevirtual |
Define whether a reparameterized curve is the same.
Define whether a reparameterized curve is the same.
[in] | curve | - A curve for comparison. |
[out] | factor | - Coefficient of compression of parametric region at the time of transition to the pointed curve. |
Reimplemented from MbCurve.
|
overridevirtual |
Calculate parameter step.
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 of a curve from its polygon does not exceed the given sag value.
[in] | t | - A parameter defining the point on a curve, at which a step should be calculated. |
[in] | sag | - Maximum feasible sag value. |
Reimplemented from MbCurve.
|
overridevirtual |
Calculate parameter step.
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.
[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. |
Reimplemented from MbCurve.
|
overridevirtual |
Calculate an array of points for drawing.
Get an array of drawn points with a given sag. If the cure is a contour then knots of a contour are duplicated.
[in] | sag | - Maximal value of sag. |
[in,out] | poligon | - A polygon of calculated points on a curve. |
Reimplemented from MbCurve.
Delete the piece of a curve.
Delete a part of a curve between parameters t1 and t2. If the curve is split into two parts after deletion, then the initial object corresponds to the start part of a curve, and parameter 'part2' contains the end part of a curve. If the curve remained simply connected, then only the initial object changes.
[in] | t1 | - Start parameter of trimming. |
[in] | t2 | - End parameter of trimming. |
[in,out] | part2 | - The end part of a curve after deletion, if an initial curve is split into parts. It may be the only part after deletions, \ if the curve did not change (e. g. for a curve of MbLine type), in this case the returned value is dp_Degenerated. |
Implements MbCurve.
Keep the piece of a curve.
Leave a part of a curve between parameters t1 and t2.
In a case of success the returned value equals dp_Changed and a curve satisfies to the next conditions:
[in] | t1 | - Start parameter of trimming. |
[in] | t2 | - End parameter of trimming. |
[in,out] | part2 | - This may be filled by a result of trimming if the curve was not changed. In this case the returned value is dp_Degenerated. Otherwise nullptr is returned. |
Implements MbCurve.
Deform the curve.
If the bounding rectangle of a curve intersects the given one, then the curve is transformed according to the matrix with a help of 'Transform' function.
[in] | rect | - A rectangle, in which the visibility of a curve is checked. |
[in] | matr | - A deformation matrix. |
Reimplemented from MbCurve.
|
overridevirtual |
Create a curve through a point.
Change a curve such that it passes through the given point. Changes should not affect the whole curve. If the curve has any base objects, then the connection with them should not be modified. If the curve cannot be constructed, then the initial curve will not change, false is returned.
[in] | pnt | - A given point. |
Reimplemented from MbCurve.
|
overridevirtual |
Find tangents to a curve.
Find all tangents to a curve from the given point. A point may belong to a curve. In this function a curve without extensions is considered.
[in] | pnt | - A given point. |
[in,out] | tFind | - An array of parameters of a curve, corresponding to the tangent points. |
Reimplemented from MbCurve.
|
overridevirtual |
Find the special points of an offset curve.
Special points of an offset curve are the points where the curvature radius of the initial curve equals to the value of shift of an offset curve.
[in,out] | tCusps | - An array of parameters of special points. |
[in] | dist | - Shift of the offset curve. |
Reimplemented from MbCurve.
|
overridevirtual |
Get the physical radius of the curve or null if it impossible.
In general case 0 is returned. A value different from 0 may be obtained only in a case, when the curve is an arc of a circle or it is equivalent to an arc of a circle.
Reimplemented from MbCurve.
|
overridevirtual |
Calculate a point to construct an axis.
Calculates a point to construct an axis, if a curve may be constructed by rotation of a point around an axis.
Reimplemented from MbCurve.
|
overridevirtual |
Get the range of influence of point of the curve.
Determines which range of curve parameter will be affected by changing of the control point with 'index' index.
[in] | index | - Index of control point. |
[out] | t1 | - Minimal parameter of the range of influence. |
[out] | t2 | - Maximal parameter of the range of influence. |
Implements MbPolyCurve.
|
overridevirtual |
Insert a point to the array of control points.
Insert the given point by index.
[in] | pnt | - A given point. |
[in] | index | - Index to insert a point by. |
Implements MbPolyCurve.
|
overridevirtual |
Insert a point to the array of control points.
Insert a point which corresponds to parameter 't' of the curve. If parameter 't' differs from the parameter of some point less than by the given tolerance, then the new point isn't inserted, already existent point close by parameter is replaced.
[in] | t | - Parameter of the new point. |
[in] | pnt | - A given point. |
[in] | xEps | - Tolerance in x direction. |
[in] | yEps | - Tolerance in y direction. |
Implements MbPolyCurve.
|
overridevirtual |
Replace a point.
Replace a point.
[in] | index | - Index of a point to be changed. |
[in] | pnt | - A given point. |
Reimplemented from MbPolyCurve.
|
overridevirtual |
Change control points.
If count of points in the given array is equal to the current count of points, then the array of points is replaced by the new one. If not equal, then the control points are not changed, the function returns false.
[in] | pntList | - The given array of control points. |
Reimplemented from MbPolyCurve.
|
overridevirtual |
Drive a parameter into the curve domain.
Check parameter. If it is out of the range of the curve parameters, then in case of closed curve drive it into the definition domain with changing by period. In case of open curve - make equal to the nearest boundary parameter. Determine indices of control points the given parameter is between, and also determine their parametric values.
[in,out] | t | - On input - the given parameter. On output - parameter in the curve definition domain. |
[out] | i0 | - Index of control point to the left of the given parameter. |
[out] | i1 | - Index of control point to the right of the given parameter. |
[out] | t0 | - Parameter of control point to the left of the given parameter. |
[out] | t1 | - Parameter of control point to the right of the given parameter. |
Implements MbPolyCurve.
|
overridevirtual |
Calculate the distance to a point.
Calculate distance to object from a given point near the object. Distance is calculated and stored to 'd' variable if it is less then initial value of 'd'. There can be performance benefit in comparison with DistanceToPoint function due to primarily checking the distance from point to bounding box and performing the further calculations only if this distance is not greater than the given one.
[in] | to | - Point. |
[in,out] | d | - Specified distance from object on input. Distance from point to object on output if operation succeeded. |
Implements MbPlaneItem.
|
overridevirtual |
Find the point projection to the curve.
Find the nearest projection of a point on a curve (in the range of the curve) or on its continuation by the given initial approximation. If the parameter ext = true, then also search for a projection on the continuation of the curve. If the range of change of the 'tRange' parameter is specified, then find the projection in the specified range. A range of parameter may not belong to the domain of a curve. The Newton method is used.
[in] | pnt | - A given point. |
[in] | xEpsilon | - A tolerance of detection of the projection by x axis. |
[in] | yEpsilon | - A tolerance of detection of the projection by y axis. |
[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. |
Reimplemented from MbCurve.
|
overridevirtual |
Get properties of the object.
Set properties of the object. Get the basis points of the curve.
Have the first derivative of the curve the continuous length and direction?
Are absent any discontinuities at length or at direction of first derivative of the curve?
[out] | contLength | - The length is continuous (true/false). |
[out] | contDirect | - The direction of the first derivative is continuous (true/false). |
[out] | params | - The parameters of the points at which the direction break occurs. |
[in] | epsilon | - The accuracy of the calculation. |
Reimplemented from MbCurve.
Split the curve.
Split the non-differentiable NURBS-curve of fourth degree at internal knot with multiplicity of three.
If there are no internal knots with multiplicity of three, then the array is filled with copy of curve.
If bline = true, then check the curve for degeneration into a line, if it is a line then transform to a line.
void MbNurbs::FixClosedNurbs | ( | ) |
Make curve closed.
Make actually closed curve closed.
That is, if the first and the last points of curve are coincident, but curve implemented as open, then one of coincident points is taken away and curve becomes closed.