C3D Toolkit  Kernel - 105435, Vision - 121811.105435
+ Collaboration diagram for Base Algorithms:

Classes

class  MbRegDuplicate
 Registrator of copied objects. More...
 
class  MbAutoRegDuplicate
 Auto-registrator of duplication. More...
 
class  MbRegTransform
 Registrator of transformable objects. More...
 
class  MbAutoRegTransform
 Auto-registrator of transformation. More...
 

Macros

#define __REG_DUPLICATE_IMPL(__CLASS)
 Create a copy of the object using the registrator of duplicated objects. More...
 

Functions

double & c3d::NormalizeAngle (double &angle, double angleEpsilon=Math::AngleEps)
 Normalize an angle. More...
 
template<class Type >
double c3d::AngleBetweenVectors (const Type &v1, const Type &v2)
 Calculate the angle between two vectors. More...
 
template<class Vector >
bool c3d::ArFind (const Vector &arParam, double t, ptrdiff_t &id)
 Find a parameter in the array. More...
 
bool c3d::InRange (double x1, double x2, double x)
 Check if the number is in range [x1, x2]. More...
 
bool c3d::IsParamOn (double tmin, double tmax, double t, double treg)
 Check if parameter is in the range of the curve. More...
 
bool c3d::InRangePlus (double x1, double x, double eps=FLT_EPSILON)
 Check if the number is in range [0, x1). More...
 
template<class TypeVector >
bool c3d::IsMonotonic (const TypeVector &items, bool isAscending, bool allowEqual=false)
 Whether vector of objects is ascending or descending. More...
 
template<class Point , class Vector >
bool c3d::ArePointsOnLine (const SArray< Point > &pnts, double metricEps=METRIC_EPSILON)
 Whether points lie on the line. More...
 
template<class Point , class Vector >
bool c3d::ArePointsOnLine (const std::vector< Point > &pnts, double metricEps=METRIC_EPSILON)
 Whether points lie on the line. More...
 
template<class PointsVector >
bool c3d::IsPlanar (const PointsVector &pnts, MbPlacement3D *place, double mEps=METRIC_EPSILON)
 Whether the set of points lies on plane. More...
 
template<class Point >
bool c3d::IsPlanar2 (const Array2< Point > &pnts, MbPlacement3D *place, double mEps=METRIC_EPSILON)
 Whether the set of points lies on plane. More...
 
template<class DoubleVector >
void c3d::SetLimitParam (DoubleVector &tarr, double tmin, double tmax, double teps=Math::paramEpsilon)
 Set the range of parameter. More...
 
bool SortSynchroArrays (SArray< double > &tt0, SArray< double > &tt2, double eps, bool checkCoincidentParams)
 Sort the array. More...
 
void SortArray (SArray< double > &tt0, double eps, bool checkCoincidentParams)
 Sort the array. More...
 
void SortArray (std::vector< double > &tt0, double eps, bool checkCoincidentParams)
 Sort the array. More...
 
void CorrectParameter (bool pext, bool pc, double pmin, double pmax, double &p, double eps=Math::paramRegion)
 Refine the parameter. More...
 
bool CorrectCheckNearParameter (const double &tmin, const double &tmax, const double &tPeriod, const bool &ext, const double &tRegion, double &t)
 Correction of parameter with validation. More...
 
bool MatrixRoughInverse (const MbPlacement3D &place3D, const MbDirection *pDir, const MbVector3D &seeY, const MbVector3D &seeZ, MbMatrix &matrix)
 Determine the inversion matrix of roughness symbol. More...
 
bool MatrixTextInverse (const MbPlacement3D &place3D, const MbDirection *pDir, const MbVector3D &seeY, const MbVector3D &seeZ, MbMatrix &matrix)
 Determine the inversion matrix of text. More...
 
bool RoundedValue (double &value, uint8 n)
 The value is rounded to n significant digits. More...
 
int QuadraticEquation (double a, double b, double c, double &d, std::pair< double, double > &res)
 Solve a quadratic equation of the form a * x ^ 2 + b * x + c = 0 without external tolerance control. More...
 
int QuadraticEquation (double a, double b, double c, double &x1, double &x2, double epsilon=Math::paramEpsilon)
 Solve a quadratic equation of the form a * x ^ 2 + b * x + c = 0. More...
 
int QubicEquation (double a, double b, double c, double d, double *x, double epsilon)
 Solve a cubic equation of the form a * x^3 + b * x^2 + c * x + d = 0. More...
 
int CubicEquation (double i1, double i2, double i3, double *x, double epsilon)
 Solve a cubic equation of the form x^3 - i1 * x^2 + i2 * x - i3 = 0. More...
 
int Degree4Equation (double a, double b, double c, double d, double e, double *x, double epsilon)
 Solve a quartic equation of the form a * x^4 + b * x^3 + с * x^2 + d * x + e = 0. More...
 
void EigenVector (double a[c3d::SPACE_DIM][c3d::SPACE_DIM], MbVector3D &vect)
 Determine the eigenvector of 3 x 3 matrix. More...
 
template<class Point >
bool c3d::EqualPoints (const Point &p1, const Point &p2, double eps)
 Check points for equality. More...
 
template<class Vector >
bool c3d::EqualVectors (const Vector &p1, const Vector &p2, double eps)
 Check equality of vectors with given tolerance. More...
 
template<class Matrix >
bool c3d::EqualMatrices (const Matrix &m1, const Matrix &m2, double accuracy)
 Compare matrices. More...
 
void c3d::GetCosSin (const double &tt, double &cosT, double &sinT)
 Calculation of the cosine and sine. More...
 
template<class Type >
double GetParamDistance (const Type &p1, const Type &p2, MbeSplineParamType spType)
 Get a measure of the distance. More...
 
bool IsValidNurbsParams (ptrdiff_t degree, bool closed, size_t pcnt)
 Check initialization parameters of a nurbs-object. More...
 
bool IsValidNurbsParams (ptrdiff_t degree, bool closed, size_t pcnt, size_t wcnt)
 Check initialization parameters of a nurbs-object. More...
 
bool IsValidNurbsParams (ptrdiff_t degree, bool closed, size_t pcnt, size_t wcnt, size_t kcnt)
 Check initialization parameters of a nurbs-object. More...
 
template<class KnotsVector >
bool IsValidNurbsParamsExt (ptrdiff_t degree, bool closed, size_t pcnt, const KnotsVector &knots)
 Check initialization parameters of a nurbs-curve. More...
 
template<class PointVector , class DoubleVector >
bool IsValidNurbsParamsExt (ptrdiff_t degree, bool closed, const PointVector &pnts, const DoubleVector *wts, const DoubleVector *knots=NULL)
 Check initialization parameters of a nurbs-curve. More...
 
template<class KnotsVector >
bool IsValidNurbsKnots (const KnotsVector &knots, double eps=EXTENT_EPSILON)
 Check knots vector of a nurbs-object. More...
 
template<class KnotsVector >
ptrdiff_t KnotIndex (ptrdiff_t degree, const KnotsVector &knots, double &t)
 Definition of "left" knot index for the first non-zero function. More...
 
template<class KnotsVector >
ptrdiff_t DefineKnotsVector (ptrdiff_t degree, bool closed, ptrdiff_t uppPointsIndex, KnotsVector &knots)
 Define knot vector (uniform parameterization). More...
 
bool DefineKnotsVector (ptrdiff_t degree, bool closed, size_t count, const SArray< double > *params, SArray< double > &knots)
 Define knot vector. More...
 
template<class Points , class Params >
bool DefineThroughPointsParams (const Points &points, MbeSplineParamType spType, bool closed, Params &params)
 Define parametric distribution of points. More...
 
template<class Knots , class DoubleVector >
bool BasisFuns (ptrdiff_t i, double t, ptrdiff_t p, const Knots &knots, DoubleVector &nsplines, DoubleVector &lrVect)
 The calculation of B - basis ("degree" - order of B-spline, p = (degree - 1) - the degree of the polynomial (B-spline)). More...
 
template<class DoubleVector >
bool CalcBsplvb (const DoubleVector &knots, double t, ptrdiff_t left, ptrdiff_t degree, DoubleVector &biatx, DoubleVector &lrVect)
 Calculate basic spline by "t" parameter and knots vector. More...
 
void AllBasisFuns (ptrdiff_t i, double t, ptrdiff_t p, const SArray< double > &knots, double **ndu, double *left, double *right, bool newPatch=true)
 Calculation of B - basis (using working pointers to nurbs curves and surfaces). More...
 
void AllBasisFuns (ptrdiff_t i, double t, ptrdiff_t p, const SArray< double > &knots, double *ndu, size_t degree, double *left, double *right, bool newPatch=true)
 Calculation of B - basis (using working pointers to nurbs curves and surfaces). More...
 
bool CalcDBsplvb (const SArray< double > &knots, ptrdiff_t degree, double t, ptrdiff_t left, ptrdiff_t n, Array2< double > &values)
 Calculate values and derivatives of basic spline. More...
 
template<class Point , class NurbsVector , class KnotsVector >
void CurveDeriveCpts (ptrdiff_t p, const KnotsVector &U, const Point *P, const double *W, size_t pointCount, const NurbsVector *PW, ptrdiff_t d, ptrdiff_t r1, ptrdiff_t r2, NurbsVector *PK)
 Calculate all difference forms of curve. More...
 
template<class Point , class NurbsVector , class KnotsVector >
void CurveDeriveCpts (ptrdiff_t p, const KnotsVector &U, const Point *P, const double w, size_t pointCount, const NurbsVector *PW, ptrdiff_t d, ptrdiff_t r1, ptrdiff_t r2, NurbsVector *PK)
 Calculate all difference forms of curve. More...
 
template<class Point , class Homogeneous >
void CurveDeriveCpts (ptrdiff_t p, const double *U, const Point *P, const double *W, size_t pointCount, ptrdiff_t r1, ptrdiff_t r2, Homogeneous *H0, Homogeneous *H1, Homogeneous *H2, Homogeneous *H3)
 Calculate all difference forms of curve. More...
 
void CheckParam (const double &tMin, const double &tMax, bool closed, double &t)
 Reduce "t" to parameter in the parametric domain of the curve. More...
 
template<class KnotsVector , class DoubleVector1 , class DoubleVector2 >
ptrdiff_t CalculateSplines (ptrdiff_t degree, const KnotsVector &knots, bool closed, double &t, DoubleVector1 &nsplines, DoubleVector2 &lrVect)
 Calculate non-zero splines with a given parameter. More...
 

Detailed Description

Macro Definition Documentation

◆ __REG_DUPLICATE_IMPL

#define __REG_DUPLICATE_IMPL (   __CLASS)
Value:
MbRefItem * copyItem = NULL; \
if ( iReg == NULL || !iReg->IsReg( this, copyItem ) ) { \
copyItem = new __CLASS; \
if ( iReg != NULL ) \
iReg->SetReg( this, copyItem ); \
}
Reference-counted object.
Definition: reference_item.h:91

Create a copy of the object using the registrator of duplicated objects.

Create a copy of the object using the registrator of duplicated objects. If a copy of the object is already registered then get it from the registrator.

Function Documentation

◆ NormalizeAngle()

double& c3d::NormalizeAngle ( double &  angle,
double  angleEpsilon = Math::AngleEps 
)
inline

Normalize an angle.

Draw the source angle in range [0, 2*M_PI) if necessary.

Parameters
[out]angle- The source angle to normalize.
[in]angleEpsilon- Angular tolerance.

◆ AngleBetweenVectors()

template<class Type >
double c3d::AngleBetweenVectors ( const Type &  v1,
const Type &  v2 
)

Calculate the angle between two vectors.

Template function. Applicable for any vectors.

Parameters
[in]v1- The first vector.
[in]v2- The second vector.
Returns
The angle.

◆ ArFind()

template<class Vector >
bool c3d::ArFind ( const Vector &  arParam,
double  t,
ptrdiff_t &  id 
)
inline

Find a parameter in the array.

Locating the index of a given parameter in the array. Input array is to be sorted in ascending order. If the initial value of the index is set to be close to the expected location of the sought parameter, the search will be faster. If there is no parameter in the array equal to the given one, then the first parameter in the array greater than the given one will be chosen. If there is only 1 element in the array, then it will be considered as equal to the given one.

Parameters
[in]arParam- An array of parameters.
[in]t- The parameter value to be found in the array.
[out]id- The index of the parameter found in the array.
Returns
- true, if there are elements in the array,
otherwise false

◆ InRange()

bool c3d::InRange ( double  x1,
double  x2,
double  x 
)
inline

Check if the number is in range [x1, x2].

x1 can be both the start and the end of the range, just as x2.

Parameters
[in]x1- The start or the end of the source range.
[in]x2- The start or the end of the source range.
[in]x- The input number which should be checked.
Returns
True if x lies inside range,
otherwise false.

◆ IsParamOn()

bool c3d::IsParamOn ( double  tmin,
double  tmax,
double  t,
double  treg 
)
inline

Check if parameter is in the range of the curve.

Range of the curve is given by domain of curve parameters [tmin, tmax].

Parameters
[in]tmin- Minimal value of parameter.
[in]tmax- Maximal value of parameter.
[in]t- Source parameter
[in]treg- Accuracy of parameter.
Returns
True if t lies inside the range [tmin, tmax],
otherwise false.

◆ InRangePlus()

bool c3d::InRangePlus ( double  x1,
double  x,
double  eps = FLT_EPSILON 
)
inline

Check if the number is in range [0, x1).

x1 >= 0

Parameters
[in]x1- End of the source range.
[in]x- The input number which should be checked.
[in]eps- Tolerance.
Returns
True if x lies inside range,
otherwise false.

◆ IsMonotonic()

template<class TypeVector >
bool c3d::IsMonotonic ( const TypeVector &  items,
bool  isAscending,
bool  allowEqual = false 
)

Whether vector of objects is ascending or descending.

Whether vector of items are ascending or descending.

Parameters
[in]items- Vector of objects.
[in]isAscending- Check for ascending.
[in]allowEqual- Allow for equality of objects.
Returns
True if vector is ascending (descending),
otherwise false.

◆ ArePointsOnLine() [1/2]

template<class Point , class Vector >
bool c3d::ArePointsOnLine ( const SArray< Point > &  pnts,
double  metricEps = METRIC_EPSILON 
)

Whether points lie on the line.

Whether points lie on the line (improved variant of IsPointOnLine).

Parameters
[in]pnts- Point set.
[in]metricEps- Check accuracy.
Returns
True if points lie on line,
otherwise false.

◆ ArePointsOnLine() [2/2]

template<class Point , class Vector >
bool c3d::ArePointsOnLine ( const std::vector< Point > &  pnts,
double  metricEps = METRIC_EPSILON 
)

Whether points lie on the line.

Whether points lie on the line (improved variant of IsPointOnLine).

Parameters
[in]pnts- Point set.
[in]metricEps- Check accuracy.
Returns
True if points lie on line,
otherwise false.

◆ IsPlanar()

template<class PointsVector >
bool c3d::IsPlanar ( const PointsVector &  pnts,
MbPlacement3D place,
double  mEps = METRIC_EPSILON 
)

Whether the set of points lies on plane.

Whether the set of points lies on plane.

Parameters
[in]pnts- Point set.
[in,out]place- Points coordinate system.
[in]mEps- Check accuracy.
Returns
True if points lie on plane,
otherwise false.

◆ IsPlanar2()

template<class Point >
bool c3d::IsPlanar2 ( const Array2< Point > &  pnts,
MbPlacement3D place,
double  mEps = METRIC_EPSILON 
)

Whether the set of points lies on plane.

Whether set of points lies on plane.

Parameters
[in]pnts- Point set.
[in,out]place- Points coordinate system.
[in]mEps- Check accuracy.
Returns
True if points lie on plane,
otherwise false.

◆ SetLimitParam()

template<class DoubleVector >
void c3d::SetLimitParam ( DoubleVector &  tarr,
double  tmin,
double  tmax,
double  teps = Math::paramEpsilon 
)

Set the range of parameter.

Set (reparametrize) range of parameter in the array.

Parameters
[in,out]params- The array of parameters sorted in ascending order.
[in]pmin- Minimal value of parameter.
[in]pmax- Maximal value of parameter.

◆ SortSynchroArrays()

bool SortSynchroArrays ( SArray< double > &  tt0,
SArray< double > &  tt2,
double  eps,
bool  checkCoincidentParams 
)

Sort the array.

First array is sorted in ascending order. Elements of the second array are rearranged synchronously with elements of the first one. If the corresponding flag is set, then the array is checked for duplications. If they exist, then only one of them is kept with the corresponding parameter in tt2. Meanwhile, the parameter is kept in tt0, which correspondence in tt2 has the minimal value.

Parameters
[out]tt0- Source array of first parameters to sort.
[out]tt2- Source array of second parameters to sort synchronously with tt0.
[in]eps- Parameters comparison tolerance.
[in]checkCoincidentParams- Flag for checking of duplicate parameters.

◆ SortArray() [1/2]

void SortArray ( SArray< double > &  tt0,
double  eps,
bool  checkCoincidentParams 
)

Sort the array.

Sort the array in ascending order. If the corresponding flag is set, then the check for duplicate parameters is to be performed. If they exist, then only one of them is kept.

Parameters
[out]tt0- Source array of parameters to sort.
[in]eps- Parameters comparison tolerance.
[in]checkCoincidentParams- Flag for checking of duplicate parameters.

◆ SortArray() [2/2]

void SortArray ( std::vector< double > &  tt0,
double  eps,
bool  checkCoincidentParams 
)

Sort the array.

Sort the array in ascending order. If the corresponding flag is set, then the check for duplicate parameters is to be performed. If they exist, then only one of them is kept.

Parameters
[out]tt0- Source array of parameters to sort.
[in]eps- Parameters comparison tolerance.
[in]checkCoincidentParams- Flag for checking of duplicate parameters.

◆ CorrectParameter()

void CorrectParameter ( bool  pext,
bool  pc,
double  pmin,
double  pmax,
double &  p,
double  eps = Math::paramRegion 
)

Refine the parameter.

If parameter is closed or must not be in the extension of parametric region, then it drawn inside region [pmin, pmax] if necessary.

Parameters
[in]pext- Whether extension of parametric region is used.
[in]pc- Closedness of parameter domain.
[in]pmin- The minimal value of parameter.
[in]pmax- The maximal value of parameter.
[out]p- The parameter to refine.
[in]eps- Computational tolerance.

◆ CorrectCheckNearParameter()

bool CorrectCheckNearParameter ( const double &  tmin,
const double &  tmax,
const double &  tPeriod,
const bool &  ext,
const double &  tRegion,
double &  t 
)

Correction of parameter with validation.

If the parameter is not in range [tmin, tmax] after correction, and flag of use of parameter on extension of parametric region is false, then parameter equates to tmin or tmax, according to which bound it get out from range [tmin, tmax].

Parameters
[in]tmin- Minimal value of parameter.
[in]tmax- Maximal value of parameter.
[in]tPeriod- Period.
[in]ext- Whether extension of parametric region is used.
[in]tRegion- Accuracy of parameter.
[out]t- The parameter to refine.
Returns
True if there was no parameter out of range [tmin, tmax] after correction,
otherwise false.

◆ MatrixRoughInverse()

bool MatrixRoughInverse ( const MbPlacement3D place3D,
const MbDirection pDir,
const MbVector3D seeY,
const MbVector3D seeZ,
MbMatrix matrix 
)

Determine the inversion matrix of roughness symbol.

Calculating the inversion matrix in three-dimensional space.

Parameters
[in]place3D- Local coordinate system.
[in]pDir- Direction.
[in]seeY- Screen Y-axis.
[in]seeZ- Screen Z-axis.
[out]matrix- Inversion matrix.
Returns
True if the matrix was found,
otherwise false

◆ MatrixTextInverse()

bool MatrixTextInverse ( const MbPlacement3D place3D,
const MbDirection pDir,
const MbVector3D seeY,
const MbVector3D seeZ,
MbMatrix matrix 
)

Determine the inversion matrix of text.

Calculating the inversion matrix in three-dimensional space.

Parameters
[in]place3D- Local coordinate system.
[in]pDir- Direction.
[in]seeY- Screen Y-axis.
[in]seeZ- Screen Z-axis.
[out]matrix- Inversion matrix.
Returns
True if the matrix was found,
otherwise false

◆ RoundedValue()

bool RoundedValue ( double &  value,
uint8  n 
)

The value is rounded to n significant digits.

The value is rounded to n significant digits.

Parameters
[in,out]value- The value.
[in]n- Number of significant digits.
Returns
true, if value is rounded, otherwise false.

◆ QuadraticEquation() [1/2]

int QuadraticEquation ( double  a,
double  b,
double  c,
double &  d,
std::pair< double, double > &  res 
)

Solve a quadratic equation of the form a * x ^ 2 + b * x + c = 0 without external tolerance control.

Solve a quadratic equation of the form a * x ^ 2 + b * x + c = 0 without external tolerance control.

Parameters
[in]a- The second-degree term coefficient.
[in]b- The first-degree term coefficient.
[in]c- The constant term coefficient.
[out]d- The discriminant of equation.
[out]res- Roots of equation.
Returns
Number of real roots and discriminant of equation.

◆ QuadraticEquation() [2/2]

int QuadraticEquation ( double  a,
double  b,
double  c,
double &  x1,
double &  x2,
double  epsilon = Math::paramEpsilon 
)

Solve a quadratic equation of the form a * x ^ 2 + b * x + c = 0.

Solve a quadratic equation of the form a * x ^ 2 + b * x + c = 0.

Parameters
[in]a- The second-degree term coefficient.
[in]b- The first-degree term coefficient.
[in]c- The constant term coefficient.
[out]x1- The first root of equation.
[out]x2- The second root of equation.
[in]epsilon- Solution tolerance.
Returns
Number of real roots.

◆ QubicEquation()

int QubicEquation ( double  a,
double  b,
double  c,
double  d,
double *  x,
double  epsilon 
)

Solve a cubic equation of the form a * x^3 + b * x^2 + c * x + d = 0.

Solve a cubic equation of the form a * x^3 + b * x^2 + c * x + d = 0.

Parameters
[in]a- The third-degree term coefficient.
[in]b- The second-degree term coefficient.
[in]c- The first-degree term coefficient.
[in]d- The constant term coefficient.
[out]x- Roots of equation.
[in]epsilon- Solution tolerance.
Returns
Number of real roots.

◆ CubicEquation()

int CubicEquation ( double  i1,
double  i2,
double  i3,
double *  x,
double  epsilon 
)

Solve a cubic equation of the form x^3 - i1 * x^2 + i2 * x - i3 = 0.

Solve a cubic equation of the form x^3 - i1 * x^2 + i2 * x - i3 = 0.

Parameters
[in]i1- The second-degree term coefficient.
[in]i2- The first-degree term coefficient.
[in]i3- The constant term coefficient.
[out]x- Roots of equation.
[in]epsilon- Solution tolerance.
Returns
Number of real roots.

◆ Degree4Equation()

int Degree4Equation ( double  a,
double  b,
double  c,
double  d,
double  e,
double *  x,
double  epsilon 
)

Solve a quartic equation of the form a * x^4 + b * x^3 + с * x^2 + d * x + e = 0.

Solve a cubic equation of the form a * x^4 + b * x^3 + с * x^2 + d * x + e = 0.

Parameters
[in]a- The fourth-degree term coefficient.
[in]b- The third-degree term coefficient.
[in]c- The second-degree term coefficient.
[in]d- The first-degree term coefficient.
[in]e- The constant term coefficient.
[out]x- Roots of equation.
[in]epsilon- Solution tolerance.
Returns
Number of real roots.

◆ EigenVector()

void EigenVector ( double  a[c3d::SPACE_DIM][c3d::SPACE_DIM],
MbVector3D vect 
)

Determine the eigenvector of 3 x 3 matrix.

Determine the eigenvector of 3 x 3 matrix.

Parameters
[in]a- 3 x 3 matrix.
[out]vect- The eigenvector of matrix.

◆ EqualPoints()

template<class Point >
bool c3d::EqualPoints ( const Point &  p1,
const Point &  p2,
double  eps 
)

Check points for equality.

Points are considered as equal if their coordinates differ by a value which doesn't exceed a given tolerance.

Parameters
[in]p1- The first cartesian point.
[in]p2- The second cartesian point.
[in]eps- Metric tolerance of points coincidence.
Returns
True if points coincide,
false otherwise.

◆ EqualVectors()

template<class Vector >
bool c3d::EqualVectors ( const Vector &  p1,
const Vector &  p2,
double  eps 
)

Check equality of vectors with given tolerance.

Check equality of vectors with given tolerance. Vectors are equal if their coordinates differs less than given tolerance.

Parameters
[in]p1- The first vector.
[in]p2- The second vector.
[in]eps- Coordinate tolerance.
Returns
Returns true if the vectors are equal.

◆ EqualMatrices()

template<class Matrix >
bool c3d::EqualMatrices ( const Matrix &  m1,
const Matrix &  m2,
double  accuracy 
)

Compare matrices.

Tolerant comparison of two matrices.

Parameters
[in]m1,m2- Initial matrices.
[in]accuracy- A tolerance.
Returns
Returns true if matrices are equal,
false otherwise.

◆ GetCosSin()

void c3d::GetCosSin ( const double &  tt,
double &  cosT,
double &  sinT 
)
inline

Calculation of the cosine and sine.

1.7 times faster than a single calculation of sin and cos, Tested in release configuration with optimization.

Parameters
[in]tt- Angle (in radians).
[out]cosT- Cosine of the angle tt.
[out]sinT- Sine of the angle tt.

◆ GetParamDistance()

template<class Type >
double GetParamDistance ( const Type &  p1,
const Type &  p2,
MbeSplineParamType  spType 
)

Get a measure of the distance.

Get a measure of the distance.

Parameters
[in]p1,p2- Points between which the distance is computed.
[in]spType- The parametrization type of spline objects.
Returns
Distance.

◆ IsValidNurbsParams() [1/3]

bool IsValidNurbsParams ( ptrdiff_t  degree,
bool  closed,
size_t  pcnt 
)
inline

Check initialization parameters of a nurbs-object.

Check initialization parameters of a nurbs-object.

Parameters
[in]degree- B-spline degree.
[in]closed- A closedness attribute.
[in]pcnt- Number of points.
Returns
Returns true if parameters are consistent.

◆ IsValidNurbsParams() [2/3]

bool IsValidNurbsParams ( ptrdiff_t  degree,
bool  closed,
size_t  pcnt,
size_t  wcnt 
)
inline

Check initialization parameters of a nurbs-object.

Check initialization parameters of a nurbs-object.

Parameters
[in]degree- B-spline degree.
[in]closed- A closedness attribute.
[in]pcnt- Number of points.
[in]wcnt- Number of weights.
Returns
Returns true if parameters are consistent.

◆ IsValidNurbsParams() [3/3]

bool IsValidNurbsParams ( ptrdiff_t  degree,
bool  closed,
size_t  pcnt,
size_t  wcnt,
size_t  kcnt 
)
inline

Check initialization parameters of a nurbs-object.

Check initialization parameters of a nurbs-object.

Parameters
[in]degree- B-spline degree.
[in]closed- A closedness attribute.
[in]pcnt- Number of points.
[in]wcnt- Number of weights.
[in]kcnt- Number of knots.
Returns
Returns true if parameters are consistent.

◆ IsValidNurbsParamsExt() [1/2]

template<class KnotsVector >
bool IsValidNurbsParamsExt ( ptrdiff_t  degree,
bool  closed,
size_t  pcnt,
const KnotsVector &  knots 
)

Check initialization parameters of a nurbs-curve.

Check initialization parameters of a nurbs-curve.

Parameters
[in]degree- B-spline degree.
[in]closed- A closedness attribute.
[in]pcnt- Number of points.
[in]knots- Knots vector.
Returns
Returns true if parameters are consistent.

◆ IsValidNurbsParamsExt() [2/2]

template<class PointVector , class DoubleVector >
bool IsValidNurbsParamsExt ( ptrdiff_t  degree,
bool  closed,
const PointVector &  pnts,
const DoubleVector *  wts,
const DoubleVector *  knots = NULL 
)

Check initialization parameters of a nurbs-curve.

Check initialization parameters of a nurbs-curve.

Parameters
[in]degree- B-spline degree.
[in]closed- A closedness attribute.
[in]pnts- Points vector.
[in]wts- Weights vector.
[in]knots- Knots vector.
Returns
Returns true if parameters are consistent.

◆ IsValidNurbsKnots()

template<class KnotsVector >
bool IsValidNurbsKnots ( const KnotsVector &  knots,
double  eps = EXTENT_EPSILON 
)

Check knots vector of a nurbs-object.

Check knots vector of a nurbs-object.

Parameters
[in]knots- Knots vector.
Returns
Returns true if parameters are consistent.

◆ KnotIndex()

template<class KnotsVector >
ptrdiff_t KnotIndex ( ptrdiff_t  degree,
const KnotsVector &  knots,
double &  t 
)

Definition of "left" knot index for the first non-zero function.

Definition of "left" knot index for the first non-zero function (knots[mid] <= t < knots[mid + 1]).

Parameters
[in]degree- B-spline degree.
[in]knots- Knots.
[in,out]t- A parameter value.
Returns
A knot index.

◆ DefineKnotsVector() [1/2]

template<class KnotsVector >
ptrdiff_t DefineKnotsVector ( ptrdiff_t  degree,
bool  closed,
ptrdiff_t  uppPointsIndex,
KnotsVector &  knots 
)

Define knot vector (uniform parameterization).

Define knot vector (uniform parameterization).

Parameters
[in]degree- B-spline degree.
[in]closed- A closedness attribute.
[in]uppPointsIndex- Last point index.
[in]knots- Knots vector.

◆ DefineKnotsVector() [2/2]

bool DefineKnotsVector ( ptrdiff_t  degree,
bool  closed,
size_t  count,
const SArray< double > *  params,
SArray< double > &  knots 
)

Define knot vector.

Define knot vector.

Parameters
[in]degree- B-spline degree.
[in]closed- A closedness attribute.
[in]count- Number of points.
[in]params- Points parameters (for closed spline - "count"+1).
[out]knots- Knots vector.
Returns
Returns true if result is success.

◆ DefineThroughPointsParams()

template<class Points , class Params >
bool DefineThroughPointsParams ( const Points &  points,
MbeSplineParamType  spType,
bool  closed,
Params &  params 
)

Define parametric distribution of points.

Define parametric distribution of points.

Parameters
[in]points- Points vector.
[in]spType- The parameterization type of spline objects.
[in]closed- A closedness attribute.
[out]params- Parametric distribution of points.
Returns
Returns true if result is success.

◆ BasisFuns()

template<class Knots , class DoubleVector >
bool BasisFuns ( ptrdiff_t  i,
double  t,
ptrdiff_t  p,
const Knots &  knots,
DoubleVector &  nsplines,
DoubleVector &  lrVect 
)

The calculation of B - basis ("degree" - order of B-spline, p = (degree - 1) - the degree of the polynomial (B-spline)).

The calculation of B - basis ("degree" - order of B-spline, p = (degree - 1) - the degree of the polynomial (B-spline)). To speed up vector lr = { left[p+1], right[p+1] } is used.

Parameters
[in]i- Index of knots vector obtained by the function KnotIndex().
[in]t- Parameter.
[in]p- p = degree - 1, where degree is B-spline degree.
[in]knots- Knots vector.
[out]nsplines- Array of B-spline values.
[in,out]lrVect- Temporary working vector with dimension 2*(p+1) = 2*degree.

◆ CalcBsplvb()

template<class DoubleVector >
bool CalcBsplvb ( const DoubleVector &  knots,
double  t,
ptrdiff_t  left,
ptrdiff_t  degree,
DoubleVector &  biatx,
DoubleVector &  lrVect 
)

Calculate basic spline by "t" parameter and knots vector.

Calculate basic spline by "t" parameter and knots vector.

◆ AllBasisFuns() [1/2]

void AllBasisFuns ( ptrdiff_t  i,
double  t,
ptrdiff_t  p,
const SArray< double > &  knots,
double **  ndu,
double *  left,
double *  right,
bool  newPatch = true 
)

Calculation of B - basis (using working pointers to nurbs curves and surfaces).

Calculation of B - basis (using working pointers to nurbs curves and surfaces).

◆ AllBasisFuns() [2/2]

void AllBasisFuns ( ptrdiff_t  i,
double  t,
ptrdiff_t  p,
const SArray< double > &  knots,
double *  ndu,
size_t  degree,
double *  left,
double *  right,
bool  newPatch = true 
)

Calculation of B - basis (using working pointers to nurbs curves and surfaces).

Calculation of B - basis (using working pointers to nurbs curves and surfaces).

◆ CalcDBsplvb()

bool CalcDBsplvb ( const SArray< double > &  knots,
ptrdiff_t  degree,
double  t,
ptrdiff_t  left,
ptrdiff_t  n,
Array2< double > &  values 
)

Calculate values and derivatives of basic spline.

Parameters
[in]t- Curve parameter.
[in]left- Knot number of the first nonzero spline.
[in]n- Order of calculated derivatives.
[out]values- 2D-Array filled by spline values.

◆ CurveDeriveCpts() [1/3]

template<class Point , class NurbsVector , class KnotsVector >
void CurveDeriveCpts ( ptrdiff_t  p,
const KnotsVector &  U,
const Point *  P,
const double *  W,
size_t  pointCount,
const NurbsVector *  PW,
ptrdiff_t  d,
ptrdiff_t  r1,
ptrdiff_t  r2,
NurbsVector *  PK 
)

Calculate all difference forms of curve.

Calculate all (or some, optionally) difference forms of curve (characteristic derivatives).

◆ CurveDeriveCpts() [2/3]

template<class Point , class NurbsVector , class KnotsVector >
void CurveDeriveCpts ( ptrdiff_t  p,
const KnotsVector &  U,
const Point *  P,
const double  w,
size_t  pointCount,
const NurbsVector *  PW,
ptrdiff_t  d,
ptrdiff_t  r1,
ptrdiff_t  r2,
NurbsVector *  PK 
)

Calculate all difference forms of curve.

Calculate all (or some, optionally) difference forms of curve (characteristic derivatives).

◆ CurveDeriveCpts() [3/3]

template<class Point , class Homogeneous >
void CurveDeriveCpts ( ptrdiff_t  p,
const double *  U,
const Point *  P,
const double *  W,
size_t  pointCount,
ptrdiff_t  r1,
ptrdiff_t  r2,
Homogeneous *  H0,
Homogeneous *  H1,
Homogeneous *  H2,
Homogeneous *  H3 
)

Calculate all difference forms of curve.

Calculate all (or some, optionally) difference forms of curve (characteristic derivatives).

◆ CheckParam()

void CheckParam ( const double &  tMin,
const double &  tMax,
bool  closed,
double &  t 
)
inline

Reduce "t" to parameter in the parametric domain of the curve.

Parameters
[in]tMin,tMax- Parameters which define the parametric region of the curve.
[in]closed- An attribute of curve closedness.
[in,out]t- Initial parameter.

◆ CalculateSplines()

template<class KnotsVector , class DoubleVector1 , class DoubleVector2 >
ptrdiff_t CalculateSplines ( ptrdiff_t  degree,
const KnotsVector &  knots,
bool  closed,
double &  t,
DoubleVector1 &  nsplines,
DoubleVector2 &  lrVect 
)

Calculate non-zero splines with a given parameter.

Parameters
[in]degree- B-spline degree.
[in]knots- Knots.
[in]closed- A closedness attribute.
[in,out]t- A parameter
[out]nsplines- Array (dimension is "degree") is filled by spline values.
[out]lrVect- An assisting array (contains garbage).
Returns
The number of the first non-zero B-spline.