#include <nurbs.h>
Inheritance diagram for PLib::NurbsCurve< T, N >:
Public Member Functions | |
NurbsCurve () | |
NurbsCurve (const NurbsCurve< T, N > &nurb) | |
NurbsCurve (const Vector< HPoint_nD< T, N > > &P1, const Vector< T > &U1, int deg=3) | |
NurbsCurve (const Vector< Point_nD< T, N > > &P1, const Vector< T > &W, const Vector< T > &U1, int deg=3) | |
int | degree () const |
const Vector< HPoint_nD< T, N > > & | ctrlPnts () const |
const HPoint_nD< T, N > | ctrlPnts (int i) const |
const Vector< T > & | knot () const |
T | knot (int i) const |
void | resize (int n, int Deg) |
virtual void | reset (const Vector< HPoint_nD< T, N > > &P1, const Vector< T > &U1, int deg) |
virtual NurbsCurve & | operator= (const NurbsCurve< T, N > &) |
virtual HPoint_nD< T, N > | operator() (T u) const |
HPoint_nD< T, N > | hpointAt (T u) const |
HPoint_nD< T, N > | hpointAt (T u, int span) const |
void | deriveAtH (T u, int, Vector< HPoint_nD< T, N > > &) const |
void | deriveAt (T u, int, Vector< Point_nD< T, N > > &) const |
void | deriveAtH (T u, int, int, Vector< HPoint_nD< T, N > > &) const |
void | deriveAt (T u, int, int, Vector< Point_nD< T, N > > &) const |
Point_nD< T, N > | derive3D (T u, int d) const |
HPoint_nD< T, N > | derive (T u, int d) const |
Point_nD< T, N > | normal (T u, const Point_nD< T, N > &v) const |
HPoint_nD< T, N > | firstD (T u) const |
HPoint_nD< T, N > | firstD (T u, int span) const |
Point_nD< T, N > | firstDn (T u) const |
Point_nD< T, N > | firstDn (T u, int span) const |
T | basisFun (T u, int i, int p=-1) const |
void | basisFuns (T u, int span, Vector< T > &N) const |
void | dersBasisFuns (int n, T u, int span, Matrix< T > &N) const |
T | minKnot () const |
T | maxKnot () const |
int | findSpan (T u) const |
void | findMultSpan (T u, int &r, int &s) const |
int | findMult (int r) const |
int | findKnot (T u) const |
T | getRemovalBnd (int r, int s) const |
void | removeKnot (int r, int s, int num) |
void | removeKnotsBound (const Vector< T > &ub, Vector< T > &ek, T E) |
int | knotInsertion (T u, int r, NurbsCurve< T, N > &nc) |
void | refineKnotVector (const Vector< T > &X) |
void | refineKnotVectorClosed (const Vector< T > &X) |
void | mergeKnotVector (const Vector< T > &Um) |
void | clamp () |
void | unclamp () |
int | leastSquares (const Vector< Point_nD< T, N > > &Q, int degC, int n) |
int | leastSquares (const Vector< Point_nD< T, N > > &Q, int degC, int n, const Vector< T > &ub) |
int | leastSquaresH (const Vector< HPoint_nD< T, N > > &Q, int degC, int n, const Vector< T > &ub) |
int | leastSquares (const Vector< Point_nD< T, N > > &Q, int degC, int n, const Vector< T > &ub, const Vector< T > &knot) |
int | leastSquaresH (const Vector< HPoint_nD< T, N > > &Q, int degC, int n, const Vector< T > &ub, const Vector< T > &knot) |
int | leastSquaresClosed (const Vector< Point_nD< T, N > > &Q, int degC, int n) |
int | leastSquaresClosed (const Vector< Point_nD< T, N > > &Q, int degC, int n, const Vector< T > &ub) |
int | leastSquaresClosedH (const Vector< HPoint_nD< T, N > > &Q, int degC, int n, const Vector< T > &ub) |
int | leastSquaresClosed (const Vector< Point_nD< T, N > > &Q, int degC, int n, const Vector< T > &ub, const Vector< T > &knot) |
int | leastSquaresClosedH (const Vector< HPoint_nD< T, N > > &Q, int degC, int n, const Vector< T > &ub, const Vector< T > &knot) |
void | globalApproxErrBnd (Vector< Point_nD< T, N > > &Q, int deg, T E) |
void | globalApproxErrBnd (Vector< Point_nD< T, N > > &Q, Vector< T > &ub, int deg, T E) |
void | globalApproxErrBnd2 (Vector< Point_nD< T, N > > &Q, int degC, T E) |
void | globalApproxErrBnd3 (Vector< Point_nD< T, N > > &Q, int degC, T E) |
void | globalApproxErrBnd3 (Vector< Point_nD< T, N > > &Q, const Vector< T > &ub, int degC, T E) |
void | globalInterp (const Vector< Point_nD< T, N > > &Q, int d) |
void | globalInterp (const Vector< Point_nD< T, N > > &Q, const Vector< T > &ub, int d) |
void | globalInterpH (const Vector< HPoint_nD< T, N > > &Q, int d) |
void | globalInterpH (const Vector< HPoint_nD< T, N > > &Q, const Vector< T > &U, int d) |
void | globalInterpH (const Vector< HPoint_nD< T, N > > &Q, const Vector< T > &ub, const Vector< T > &U, int d) |
void | globalInterpClosed (const Vector< Point_nD< T, N > > &Qw, int d) |
void | globalInterpClosed (const Vector< Point_nD< T, N > > &Qw, const Vector< T > &ub, int d) |
void | globalInterpClosedH (const Vector< HPoint_nD< T, N > > &Qw, int d) |
void | globalInterpClosedH (const Vector< HPoint_nD< T, N > > &Qw, const Vector< T > &U, int d) |
void | globalInterpClosedH (const Vector< HPoint_nD< T, N > > &Qw, const Vector< T > &ub, const Vector< T > &U, int d) |
void | globalInterpClosed (const Vector< Point_nD< T, N > > &Qw, const Vector< T > &ub, const Vector< T > &Uc, int d) |
void | globalInterpD (const Vector< Point_nD< T, N > > &Q, const Vector< Point_nD< T, N > > &D, int d, int unitD, T a=1.0) |
void | projectTo (const Point_nD< T, N > &p, T guess, T &u, Point_nD< T, N > &r, T e1=0.001, T e2=0.001, int maxTry=100) const |
T | length (T eps=0.001, int n=100) const |
T | lengthIn (T us, T ue, T eps=0.001, int n=100) const |
T | lengthF (T) const |
T | lengthF (T, int) const |
void | makeCircle (const Point_nD< T, N > &O, const Point_nD< T, N > &X, const Point_nD< T, N > &Y, T r, double as, double ae) |
void | makeCircle (const Point_nD< T, N > &O, T r, double as, double ae) |
void | makeCircle (const Point_nD< T, N > &O, T r) |
void | makeLine (const Point_nD< T, N > &P0, const Point_nD< T, N > &P1, int d) |
virtual void | degreeElevate (int t) |
void | decompose (NurbsCurveArray< T, N > &c) const |
void | decomposeClosed (NurbsCurveArray< T, N > &c) const |
int | splitAt (T u, NurbsCurve< T, N > &cl, NurbsCurve< T, N > &cu) const |
int | mergeOf (const NurbsCurve< T, N > &cl, const NurbsCurve< T, N > &cu) |
void | transform (const MatrixRT< T > &A) |
void | modCP (int i, const HPoint_nD< T, N > &a) |
void | modCPby (int i, const HPoint_nD< T, N > &a) |
virtual void | modKnot (const Vector< T > &knotU) |
int | movePoint (T u, const Point_nD< T, N > &delta) |
int | movePoint (T u, const BasicArray< Point_nD< T, N > > &delta) |
int | movePoint (const BasicArray< T > &ur, const BasicArray< Point_nD< T, N > > &D) |
int | movePoint (const BasicArray< T > &ur, const BasicArray< Point_nD< T, N > > &D, const BasicArray_INT &Dr, const BasicArray_INT &Dk) |
int | movePoint (const BasicArray< T > &ur, const BasicArray< Point_nD< T, N > > &D, const BasicArray_INT &Dr, const BasicArray_INT &Dk, const BasicArray_INT &fixCP) |
void | setTangent (T u, const Point_nD< T, N > &T0) |
void | setTangentAtEnd (const Point_nD< T, N > &T0, const Point_nD< T, N > &T1) |
int | read (const char *) |
int | write (const char *) const |
virtual int | read (ifstream &fin) |
int | write (ofstream &fout) const |
int | writePS (const char *, int cp=0, T magFact=T(-1), T dash=T(5), bool bOpen=true) const |
int | writePSp (const char *, const Vector< Point_nD< T, N > > &, const Vector< Point_nD< T, N > > &, int cp=0, T magFact=0.0, T dash=5.0, bool bOpen=true) const |
int | writeVRML (ostream &fout, T radius, int K, const Color &color, int Nu, int Nv, T u_s, T u_e) const |
int | writeVRML (const char *filename, T radius, int K, const Color &color, int Nu, int Nv, T u_s, T u_e) const |
int | writeVRML (const char *filename, T radius=1, int K=5, const Color &color=whiteColor, int Nu=20, int Nv=20) const |
int | writeVRML (ostream &fout, T radius=1, int K=5, const Color &color=whiteColor, int Nu=20, int Nv=20) const |
int | writeVRML97 (const char *filename, T radius, int K, const Color &color, int Nu, int Nv, T u_s, T u_e) const |
int | writeVRML97 (ostream &fout, T radius, int K, const Color &color, int Nu, int Nv, T u_s, T u_e) const |
int | writeVRML97 (const char *filename, T radius=1, int K=5, const Color &color=whiteColor, int Nu=20, int Nv=20) const |
int | writeVRML97 (ostream &fout, T radius=1, int K=5, const Color &color=whiteColor, int Nu=20, int Nv=20) const |
int | writeDisplayLINE (const char *filename, int iNu, const Color &color=blueColor, T fA=1) const |
int | writeDisplayLINE (const char *filename, const Color &color, int iNu, T u_s, T u_e) const |
void | drawImg (Image_UBYTE &Img, unsigned char color=255, T step=0.01) |
void | drawImg (Image_Color &Img, const Color &color, T step=0.01) |
void | drawAaImg (Image_Color &Img, const Color &color, int precision=3, int alpha=1) |
void | drawAaImg (Image_Color &Img, const Color &color, const NurbsCurve< T, 3 > &profile, int precision=3, int alpha=1) |
NurbsSurface< T, 3 > | drawAaImg (Image_Color &Img, const Color &color, const NurbsCurve< T, 3 > &profile, const NurbsCurve< T, 3 > &scaling, int precision=3, int alpha=1) |
BasicList< Point_nD< T, N > > | tesselate (T tolerance, BasicList< T > *uk) const |
Protected Attributes | |
Vector< HPoint_nD< T, N > > | P |
Vector< T > | U |
int | deg_ |
Friends | |
HPoint_nD< T, N > | C (T u, const NurbsCurve< T, N > &nurb) |
Point_nD< T, N > | Cp (T u, const NurbsCurve< T, N > &nurb) |
void | generateCompatibleCurves (NurbsCurveArray< T, N > &ca) |
Related Functions | |
(Note that these are not member functions.) | |
T | chordLengthParam (const Vector< Point_nD< T, N > > &Q, Vector< T > &ub) |
This class is used to represent and manipulate NURBS curve. The curves are composed of points in 4D. They can have any degree and have any number of control points.
|
default constructor
|
|
A copy constructor.
|
|
Constructor with control points in 4D.
|
|
Constructor with control points in 3D.
|
|
Computes the basis function of the curve. Computes the i basis function of degree p of the curve at parameter u. You can have more information about this function in the LaTeX version.
|
|
computes the non-zero basis functions of the curve Computes the non-zero basis functions and puts the result into N. N has a size of deg+1. To relate N to the basis functions, Basis[span -deg +i] = N[i] for i=0...deg. You can find more information in the LaTeX version.
|
|
< a reference to one of the control points
|
|
< a reference to the vector of control points
|
|
< a reference to the degree of the curve
|
|
Computes the derivative of degree of the curve at parameter u. For more information on the algorithm used, see A3.2 on p 93 of the NurbsBook.
|
|
Computes the derivative of degree d of the curve at parameter u. For more information on the algorithm used, see A3.2 on p 93 of the NurbsBook.
|
|
Computes the derivative of the curve at the parameter u.
|
|
Computes the derivative at the parameter u.
Implements PLib::ParaCurve< T, N >. |
|
Computes the derivative of degree d of the curve at parameter u. For more information on the algorithm used, see A3.2 on p 93 of the NurbsBook.
|
|
Computes the derivative of degree d of the curve at parameter u in the homonegeous domain. For more information on the algorithm used, see A3.2 on p 93 of the NurbsBook.
Implements PLib::ParaCurve< T, N >. |
|
Compute the derivatives functions at u of the NURBS curve. For information on the algorithm, see A2.3 on p72 of the NURBS book. The result is stored in the ders matrix, where ders is of size (n+1,deg+1) and the derivative N'_i(u) = ders(1,i=span-deg+j) where j=0...deg+1.
|
|
Draws an anti-aliased NURBS curve on an image. This will draw the NURBS by using a brush profile. The drawing is performed by averaging the intensity of the profile at the pixels. This function generates a sweep surface by using the profile given in its argument. The sweep is always performed by following the y-axis of the profile. A scaling function is also used when sweeping. This is used to vary the shape of the profile while it's being swept (see the sweep member function of NurbsSurface<T,N> for more details).
|
|
draws an anti-aliased NURBS curve on an image This will draw the NURBS by using a user-defined brush profile. The drawing is performed by averaging the intensity of the profile at the pixels.
|
|
Draws an anti-aliased NURBS curve on an image. This will draw the NURBS by using a circular brush profile. The drawing is performed by averaging the intensity of the profile at the pixels.
|
|
Draws a NURBS curve on an image. This will draw very primitively the NURBS curve on an image. The drawing assumes the line is only in the xy plane (the z is not used for now). The algorithm finds the points on the curve at a step parametric intervall between them and join them by a line. No fancy stuff.
|
|
draws a NURBS curve on an image This will draw very primitively the NURBS curve on an image. The drawing assumes the line is only in the xy plane (the z is not used for now). The algorithm finds the points on the curve at a step parametric intervall between them and join them by a line. No fancy stuff.
|
|
Finds the knot k for which u is in the range [u_k,u_{k+1}).
|
|
Finds the multiplicity of a knot.
|
|
Finds the multiplicity of a knot at a parametric value. Finds the index of the knot at parametric value u and returns its multiplicity.
|
|
Determines the knot span index. Determines the knot span for which their exists non-zero basis functions. The span is the index k for which the parameter u is valid in the [u_k,u_{k+1}] range.
|
|
Get the knot removal error bound for an internal knot. Get the knot removal error bound for an internal knot r (non-rational). For more information on the algorithm, see A9.8 from the Nurbs book on page 428.
|
|
Approximation of a curve bounded to a certain error. It is a type II approximation: it starts with a lot of control points then tries to eliminate as much as it can as long as the curve stays within a certain error bound. The method uses least squares fitting along with knot removal techniques. It is the algorithm A9.10 on p 431 of the NURBS book.
|
|
Evaluates the curve in homogenous space at parameter u.
For more details on the algorithm, see A4.1 on page 124 of the Nurbs Book.
Implements PLib::ParaCurve< T, N >. |
|
< calls operator()
Reimplemented from PLib::ParaCurve< T, N >. |
|
< the i-th knot
|
|
< a reference to the vector of knots
|
|
A least squares curve approximation. This routines generates a curve that approrimates the points in the least square sense, you can find more details in the LaTeX version. For more details, see section 9.4.1 on page 491 of the NURBS book.
|
|
A least squares curve approximation. This routines generates a curve that approrimates the points in the least square sense, you can find more details in the LaTeX version. For more details, see section 9.4.1 on page 491 of the NURBS book.
|
|
A least squares curve approximation. This routines generates a curve that approrimates the points in the least square sense, you can find more details in the LaTeX version. For more details, see section 9.4.1 on page 491 of the NURBS book.
|
|
A least squares curve approximation. This routines generates a curve that approrimates the points in the least square sense, you can find more details in the LaTeX version. For more details, see section 9.4.1 on page 491 of the NURBS book.
|
|
A least squares curve approximation. This routines generates a curve that approrimates the points in the least square sense, you can find more details in the LaTeX version. For more details, see section 9.4.1 on page 491 of the NURBS book.
|
|
< the maximal value for the knot vector
Implements PLib::ParaCurve< T, N >. |
|
the minimal value for the knot vector
Implements PLib::ParaCurve< T, N >. |
|
Computes the normal of the curve at u from a vector. Computes the normal of the curve at u from a vector. If the curve lies only in the xy-plane, then calling the function with the vector v = (0,0,1) (the z$axis) will yield a proper normal for this curve.
|
|
Evaluates the curve in 4D at parameter u.
For more details on the algorithm, see A4.1 on page 124 of the Nurbs Book.
Implements PLib::ParaCurve< T, N >. |
|
The assignment operator for a NURBS curve.
Reimplemented in PLib::NurbsCurveSP< T, N >. |
|
Removes an internal knot from a curve. This is A5.8 on p185 from the NURB book modified to not check for tolerance before removing the knot.
Reimplemented in PLib::NurbsCurveSP< T, N >, and PLib::NurbsCurveSP< float, 3 >. |
|
Remove knots from a curve without exceeding an error bound. For more information about the algorithm, see A9.9 on p429 of the NURB book.
Reimplemented in PLib::NurbsCurveSP< T, N >. |
|
Resets a NURBS curve to new values.
Reimplemented in PLib::NurbsCurveSP< T, N >. |
|
Resizes a NURBS curve. Resizes a NURBS curve. The old values are lost and new ones have to be created.
|
|
Performs geometrical modifications. Each control points will be modified by a rotation-translation matrix.
|
|
a function interface to operator()
|
|
chord length parameterization Performs chord length parameterization from a vector of points. There are more details about this function in the LaTeX version.
|
|
returns the curvePoint in 3D
|