26 #ifndef MERCURYDPM_NURBSUTILS_H
27 #define MERCURYDPM_NURBSUTILS_H
43 array2(
size_t nRows,
size_t nCols, T fillValue = 0.0)
64 bool close(
double a,
double b,
double eps = std::numeric_limits<double>::epsilon());
73 int findSpan(
int degree,
const std::vector<double>& knots,
double u);
84 double bsplineOneBasis(
int i,
int deg,
const std::vector<double>& U,
double u);
94 void bsplineBasis(
int deg,
int span,
const std::vector<double>& knots,
double u, std::vector<double>& N);
105 void bsplineDerBasis(
int deg,
int span,
const std::vector<double>& knots,
double u,
106 int nDers, std::vector<std::vector<double>>& ders);
116 std::vector<Mdouble>
createUniformKnotVector(
unsigned int numberOfControlPoints,
unsigned int degree,
bool clampedAtStart,
bool clampedAtEnd);
132 void extendKnotVector(std::vector<Mdouble>& knots,
unsigned int degree,
unsigned int numStart,
unsigned int numEnd,
bool forceBothEndsUniform =
false);
145 std::vector<std::vector<Vec3D>> controlPoints, std::vector<std::vector<Mdouble>> weights);
double Mdouble
Definition: GeneralDefine.h:34
Definition: NurbsUtils.h:41
array2(size_t nRows, size_t nCols, T fillValue=0.0)
Definition: NurbsUtils.h:43
size_t cols
Definition: NurbsUtils.h:57
size_t rows
Definition: NurbsUtils.h:57
std::vector< T > data
Definition: NurbsUtils.h:58
T operator()(size_t row, size_t col) const
Definition: NurbsUtils.h:48
T & operator()(size_t row, size_t col)
Definition: NurbsUtils.h:52
Definition: NurbsUtils.cc:31
int findSpan(int degree, const std::vector< double > &knots, double u)
Definition: NurbsUtils.cc:43
std::vector< Mdouble > createUniformKnotVector(unsigned int numberOfControlPoints, unsigned int degree, bool clampedAtStart, bool clampedAtEnd)
Creates a uniform (clamped) knot vector.
Definition: NurbsUtils.cc:254
double bsplineOneBasis(int i, int deg, const std::vector< double > &U, double u)
Definition: NurbsUtils.cc:84
void extendKnotVector(std::vector< Mdouble > &knots, unsigned int degree, unsigned int numStart, unsigned int numEnd, bool forceBothEndsUniform)
Extends the knot vector for when control points have been added at the start or end.
Definition: NurbsUtils.cc:304
void bsplineBasis(int deg, int span, const std::vector< double > &knots, double u, std::vector< double > &N)
Definition: NurbsUtils.cc:129
void bsplineDerBasis(int deg, int span, const std::vector< double > &knots, double u, int nDers, std::vector< std::vector< double >> &ders)
Definition: NurbsUtils.cc:155
void normalizeKnotVector(std::vector< Mdouble > &knots)
Resets the knot vector to the interval [0, 1].
Definition: NurbsUtils.cc:288
bool close(double a, double b, double eps)
Definition: NurbsUtils.cc:38
bool isKnotVectorMonotonic(const std::vector< double > &knots)
Definition: NurbsUtils.cc:33
Vec3D evaluate(Mdouble u, Mdouble v, std::vector< Mdouble > knotsU, std::vector< Mdouble > knotsV, std::vector< std::vector< Vec3D >> controlPoints, std::vector< std::vector< Mdouble >> weights)
Evaluate point on a NURBS surface.
Definition: NurbsUtils.cc:376
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
const Mdouble degree
Definition: ExtendedMath.h:52