#include <nurbsS.h>
Inheritance diagram for PLib::NurbsSurface< T, N >:
Public Member Functions | |
NurbsSurface () | |
NurbsSurface (const NurbsSurface< T, N > &nS) | |
NurbsSurface (int DegU, int DegV, const Vector< T > &Uk, const Vector< T > &Vk, const Matrix< HPoint_nD< T, N > > &Cp) | |
NurbsSurface (int DegU, int DegV, Vector< T > &Uk, Vector< T > &Vk, Matrix< Point_nD< T, N > > &Cp, Matrix< T > &W) | |
const Vector< T > & | knotU () const |
const Vector< T > & | knotV () const |
T | knotU (int i) const |
T | knotV (int i) const |
const Matrix< HPoint_nD< T, N > > & | ctrlPnts () const |
const HPoint_nD< T, N > | ctrlPnts (int i, int j) const |
int | degreeU () const |
int | degreeV () const |
virtual NurbsSurface< T, N > & | operator= (const NurbsSurface< T, N > &) |
void | resize (int Pu, int Pv, int DegU, int DegV) |
virtual void | resizeKeep (int Pu, int Pv, int DegU, int DegV) |
int | ok () |
virtual HPoint_nD< T, N > | operator() (T u, T v) const |
void | basisFuns (T u, T v, int spanU, int spanV, Vector< T > &Nu, Vector< T > &Nv) const |
void | basisFunsU (T u, int span, Vector< T > &N) const |
void | basisFunsV (T u, int span, Vector< T > &N) const |
void | dersBasisFuns (T u, T v, int dU, int dV, int uspan, int vspan, Matrix< T > &Niku, Matrix< T > &Njkv) const |
void | deriveAt (T u, T v, int d, Matrix< Point_nD< T, N > > &skl) const |
void | deriveAtH (T u, T v, int d, Matrix< HPoint_nD< T, N > > &skl) const |
Point_nD< T, N > | normal (T u, T v) const |
void | globalInterp (const Matrix< Point_nD< T, N > > &Q, int pU, int pV) |
void | globalInterpH (const Matrix< HPoint_nD< T, N > > &Q, int pU, int pV) |
void | globalInterpClosedU (const Matrix< Point_nD< T, N > > &Q, int pU, int pV) |
void | globalInterpClosedUH (const Matrix< HPoint_nD< T, N > > &Q, int pU, int pV) |
void | leastSquares (const Matrix< Point_nD< T, N > > &Q, int pU, int pV, int nU, int nV) |
void | leastSquaresClosedU (const Matrix< Point_nD< T, N > > &Q, int pU, int pV, int nU, int nV) |
int | skinV (NurbsCurveArray< T, N > &ca, int degV) |
int | skinU (NurbsCurveArray< T, N > &ca, int degU) |
void | sweep (const NurbsCurve< T, N > &t, const NurbsCurve< T, N > &C, const NurbsCurve< T, N > &Sv, int K, int useAy=0, int invAz=0) |
void | sweep (const NurbsCurve< T, N > &t, const NurbsCurve< T, N > &C, int K, int useAy=0, int invAz=0) |
void | makeFromRevolution (const NurbsCurve< T, N > &profile, const Point_nD< T, N > &S, const Point_nD< T, N > &T, double theta) |
void | makeFromRevolution (const NurbsCurve< T, N > &profile, const Point_nD< T, N > &S, const Point_nD< T, N > &T) |
void | makeFromRevolution (const NurbsCurve< T, N > &profile) |
void | makeSphere (const Point_nD< T, N > &O, T r) |
void | makeTorus (const Point_nD< T, N > &O, T R, T r) |
void | degreeElevate (int tU, int tV) |
virtual void | degreeElevateU (int tU) |
virtual void | degreeElevateV (int tV) |
int | decompose (NurbsSurfaceArray< T, N > &Sa) const |
void | findSpan (T u, T v, int &spanU, int &spanV) const |
int | findSpanU (T u) const |
int | findSpanV (T v) const |
int | findMultU (int r) const |
int | findMultV (int r) const |
virtual void | refineKnots (const Vector< T > &nU, const Vector< T > &nV) |
virtual void | refineKnotU (const Vector< T > &X) |
virtual void | refineKnotV (const Vector< T > &X) |
virtual void | mergeKnots (const Vector< T > &nU, const Vector< T > &nV) |
virtual void | mergeKnotU (const Vector< T > &X) |
virtual void | mergeKnotV (const Vector< T > &X) |
T | area (T eps=0.001, int n=100) const |
T | areaIn (T us, T ue, T vs, T ve, T eps, int n) const |
T | areaF (T u, T v) const |
void | isoCurveU (T u, NurbsCurve< T, N > &c) const |
void | isoCurveV (T v, NurbsCurve< T, N > &c) const |
int | read (const char *filename) |
int | write (const char *filename) const |
virtual int | read (ifstream &fin) |
int | write (ofstream &fout) const |
int | writeVRML (const char *filename, const Color &color, int Nu, int Nv, T u_s, T u_e, T v_s, T v_e) const |
int | writeVRML (ostream &fout, const Color &color, int Nu, int Nv, T u_s, T u_e, T v_s, T v_e) const |
int | writeVRML97 (const char *filename, const Color &color, int Nu, int Nv, T u_s, T u_e, T v_s, T v_e) const |
int | writeVRML97 (ostream &fout, const Color &color, int Nu, int Nv, T u_s, T u_e, T v_s, T v_e) const |
ostream & | print (ostream &os) const |
int | writeVRML (const char *filename, const Color &color=whiteColor, int Nu=20, int Nv=20) const |
int | writeVRML (ostream &fout, const Color &color=whiteColor, int Nu=20, int Nv=20) const |
int | writeVRML97 (const char *filename, const Color &color=whiteColor, int Nu=20, int Nv=20) const |
int | writeVRML97 (ostream &fout, const Color &color=whiteColor, int Nu=20, int Nv=20) const |
int | writePOVRAY (ostream &povray, int patch_type=1, double flatness=0.01, int num_u_steps=8, int num_v_steps=8) const |
int | writePOVRAY (T, ostream &povray, const Color &color=Color(250, 250, 250), int smooth=0, T ambient=0.2, T diffuse=0.6) const |
int | writePOVRAY (const char *filename, const Color &color, const Point_nD< T, N > &view, const Point_nD< T, N > &up, int patch_type=1, double flatness=0.01, int num_u_steps=8, int num_v_steps=8) const |
int | writePOVRAY (T tolerance, const char *filename, const Color &color, const Point_nD< T, N > &view, const Point_nD< T, N > &up, int smooth=0, T ambient=0.2, T diffuse=0.6) const |
int | writeRIB (ostream &rib) const |
int | writeRIB (const char *filename, const Color &color, const Point_nD< T, N > &view) const |
void | tesselate (T tolerance, BasicList< Point_nD< T, N > > &points, BasicList< int > &connect, BasicList< Point_nD< T, N > > *normal=0) const |
int | writePS (const char *, int nu, int nv, const Point_nD< T, N > &camera, const Point_nD< T, N > &lookAt, int cp=0, T magFact=T(-1), T dash=T(5)) const |
int | writePSp (const char *, int nu, int nv, const Point_nD< T, N > &camera, const Point_nD< T, N > &lookAt, const Vector< Point_nD< T, N > > &, const Vector< Point_nD< T, N > > &, int cp=0, T magFact=0.0, T dash=5.0) const |
int | writeOOGL (const char *filename, T fDu, T fDv, T fBu=0.0, T fBv=0.0, T fEu=1.0, T fEv=1.0, bool bDRawCP=false) const |
int | writeOOGL (const char *filename) const |
int | writeDisplayQUADMESH (const char *filename, int iNu=100, int iNv=100, const Color &color=blueColor, T fA=.25, T fO=0.2) const |
void | transform (const MatrixRT< T > &A) |
void | modCP (int i, int j, const HPoint_nD< T, N > &p) |
void | modCPby (int i, int j, const HPoint_nD< T, N > &p) |
T & | modU (int i) |
T | modU (int i) const |
T & | modV (int i) |
T | modV (int i) const |
void | modKnotU (const Vector< T > &uKnot) |
void | modKnotV (const Vector< T > &vKnot) |
int | movePoint (T u, T v, const Point_nD< T, N > &delta) |
int | movePoint (const Vector< T > &ur, const Vector< T > &vr, const Vector< Point_nD< T, N > > &D, const Vector_INT &Du, const Vector_INT &Dv) |
int | movePoint (const Vector< T > &ur, const Vector< T > &vr, const Vector< Point_nD< T, N > > &D, const Vector_INT &Du, const Vector_INT &Dv, const Vector_INT &Dk, const Vector_INT &Dl) |
int | movePoint (const Vector< T > &ur, const Vector< T > &vr, const Vector< Point_nD< T, N > > &D, const Vector_INT &Du, const Vector_INT &Dv, const Vector_INT &Dk, const Vector_INT &Dl, const BasicArray< Coordinate > &fixCP) |
NurbsSurface< T, N > & | transpose (void) |
Protected Attributes | |
Vector< T > | U |
Vector< T > | V |
Matrix< HPoint_nD< T, N > > | P |
int | degU |
int | degV |
Friends | |
void | gordonSurface (NurbsCurveArray< T, N > &lU, NurbsCurveArray< T, N > &lV, const Matrix< Point_nD< T, N > > &intersections, NurbsSurface< T, N > &gS) |
void | globalSurfInterpXY (const Matrix< Point_nD< T, N > > &Q, int pU, int pV, NurbsSurface< T, N > &S) |
void | globalSurfInterpXY (const Matrix< Point_nD< T, N > > &Q, int pU, int pV, NurbsSurface< T, N > &S, const Vector< T > &uk, const Vector< T > &vk) |
void | globalSurfApprox (const Matrix< Point_nD< T, N > > &Q, int pU, int pV, NurbsSurface< T, N > &S, double error) |
Related Functions | |
(Note that these are not member functions.) | |
int | surfMeshParams (const Matrix< Point_nD< T, N > > &Q, Vector< T > &uk, Vector< T > &vl) |
int | surfMeshParamsH (const Matrix< HPoint_nD< T, N > > &Q, Vector< T > &uk, Vector< T > &vl) |
The NURBS surface is composed of points in homogenous space. It can have any degree in both the u and the v direction.
PLib::NurbsSurface< T, N >::NurbsSurface | ( | ) |
Default constructor.
PLib::NurbsSurface< T, N >::NurbsSurface | ( | const NurbsSurface< T, N > & | s | ) |
the copy constructor
s | the NurbsSurface<T,N> to copy |
PLib::NurbsSurface< T, N >::NurbsSurface | ( | int | DegU, | |
int | DegV, | |||
const Vector< T > & | Uk, | |||
const Vector< T > & | Vk, | |||
const Matrix< HPoint_nD< T, N > > & | Cp | |||
) |
constructor with points in homogenous space
DegU | the degree in the $u$ direction | |
DegV | the degree in the $v$ direction | |
Uk | the $u$ knot vector | |
Vk | the $v$ knot vector | |
Cp | the matrix of control points in 4D |
PLib::NurbsSurface< T, N >::NurbsSurface | ( | int | DegU, | |
int | DegV, | |||
Vector< T > & | Uk, | |||
Vector< T > & | Vk, | |||
Matrix< Point_nD< T, N > > & | Cp, | |||
Matrix< T > & | W | |||
) |
constructor with points in 3D
DegU | the degree of the surface in the U direction | |
DegV | the degree of the surface in the V direction | |
Uk | the U knot vector | |
Vk | the V knot vector | |
Cp | the matrix of 3D control points | |
W | the weight value for each control points |
const Vector<T>& PLib::NurbsSurface< T, N >::knotU | ( | ) | const [inline] |
< A reference to the U knot vector
const Vector<T>& PLib::NurbsSurface< T, N >::knotV | ( | ) | const [inline] |
< A reference to the V knot vector
T PLib::NurbsSurface< T, N >::knotU | ( | int | i | ) | const [inline] |
< Returns the i-th knot from U
T PLib::NurbsSurface< T, N >::knotV | ( | int | i | ) | const [inline] |
< Returns the i-th knot from V
const Matrix< HPoint_nD<T,N> >& PLib::NurbsSurface< T, N >::ctrlPnts | ( | ) | const [inline] |
< A reference to the control points
const HPoint_nD<T,N> PLib::NurbsSurface< T, N >::ctrlPnts | ( | int | i, | |
int | j | |||
) | const [inline] |
< A reference to the control point at (i,j)
int PLib::NurbsSurface< T, N >::degreeU | ( | ) | const [inline] |
< A reference to the degree in U of the surface
int PLib::NurbsSurface< T, N >::degreeV | ( | ) | const [inline] |
< A reference to the degree in V of the surface
NurbsSurface< T, N > & PLib::NurbsSurface< T, N >::operator= | ( | const NurbsSurface< T, N > & | nS | ) | [virtual] |
NurbsSurface<T,N> assignment.
nS | the NURBS surface to copy |
Reimplemented in PLib::NurbsSurfaceSP< T, N >.
void PLib::NurbsSurface< T, N >::resize | ( | int | Pu, | |
int | Pv, | |||
int | DegU, | |||
int | DegV | |||
) |
Resize the surface.
Resize the surface. Proper values must be assigned once this function has been called since the resize operator is destructive.
Pu | the number of control points in the U direction | |
Pv | the number of control points in the V direction | |
DegU | the degree of the surface in the U direction | |
DegV | the degree of the surface in the V direction |
void PLib::NurbsSurface< T, N >::resizeKeep | ( | int | Pu, | |
int | Pv, | |||
int | DegU, | |||
int | DegV | |||
) | [virtual] |
Resize the surface while keeping the old values.
Pu | the number of control points in the U direction | |
Pv | the number of control points in the V direction | |
DegU | the degree of the surface in the U direction | |
DegV | the degree of the surface in the V direction |
Reimplemented in PLib::HNurbsSurfaceSP< T, N >, PLib::NurbsSurfaceSP< T, N >, PLib::HNurbsSurfaceSP< float, 3 >, and PLib::NurbsSurfaceSP< float, 3 >.
int PLib::NurbsSurface< T, N >::ok | ( | ) |
Determines if the surface is valid.
Determines if the surface is valid. The routine only verifies if the number of control points in the U and V direction matches the area of the U and V knot vectors.
HPoint_nD< T, N > PLib::NurbsSurface< T, N >::operator() | ( | T | u, | |
T | v | |||
) | const [virtual] |
Returns the point on the surface at u,v.
Returns the point on the surface at u,v
u | the u parametric value | |
v | the v parametric value |
Implements PLib::ParaSurface< T, N >.
Reimplemented in PLib::HNurbsSurface< T, N >.
void PLib::NurbsSurface< T, N >::basisFuns | ( | T | u, | |
T | v, | |||
int | spanU, | |||
int | spanV, | |||
Vector< T > & | Nu, | |||
Vector< T > & | Nv | |||
) | const |
Find the non-zero basis functions in the U and V direction.
u | the u parametric value | |
v | the v parametric value | |
spanU | the span of u | |
spanV | the span of v | |
Nu | the vector containing the U non-zero basis functions | |
Nv | the vector containing the V non-zero basis functions |
void PLib::NurbsSurface< T, nD >::basisFunsU | ( | T | u, | |
int | span, | |||
Vector< T > & | N | |||
) | const |
Finds the non-zero basis function in the U direction.
u | the u parametric value | |
span | the span of u | |
N | the vector containing the basis functions |
void PLib::NurbsSurface< T, nD >::basisFunsV | ( | T | v, | |
int | span, | |||
Vector< T > & | N | |||
) | const |
Finds the non-zero basis function in the V direction.
v | the v parametric value | |
span | the span of v | |
N | the vector containing the basis functions |
void PLib::NurbsSurface< T, N >::deriveAt | ( | T | u, | |
T | v, | |||
int | d, | |||
Matrix< Point_nD< T, N > > & | skl | |||
) | const [virtual] |
Computes the point and the derivatives of degree d and below at (u,v).
Computes the matrix of derivatives at u,v . The value of skl(k,l) represents the derivative of the surface S(u,v) with respect to u, k times and to v, l times.
u | the u parametric value | |
v | the v parametric value | |
d | the derivative is computed up to and including to this value | |
skl | the matrix containing the derivatives |
Implements PLib::ParaSurface< T, N >.
void PLib::NurbsSurface< T, nD >::deriveAtH | ( | T | u, | |
T | v, | |||
int | d, | |||
Matrix< HPoint_nD< T, nD > > & | skl | |||
) | const |
computes the point and the derivatives of degree d and below at (u,v)
Computes the matrix of derivatives at u,v . The value of skl(k,l) represents the derivative of the surface S(u,v) with respect to u k times and to $v$ $l$ times.
u | the u parametric value | |
v | the v parametric value | |
d | the derivative is computed up to and including to this value | |
skl | the matrix containing the derivatives |
Point_nD< T, N > PLib::NurbsSurface< T, N >::normal | ( | T | u, | |
T | v | |||
) | const |
Computes the normal of the surface at (u,v).
u | the u parametric value | |
v | the v parametric value |
void PLib::NurbsSurface< T, N >::globalInterp | ( | const Matrix< Point_nD< T, N > > & | Q, | |
int | pU, | |||
int | pV | |||
) |
Generates a surface using global interpolation.
Q | a matrix of 3D points | |
pU | the degree of interpolation in the U direction | |
pV | the degree of interpolation in the V direction |
void PLib::NurbsSurface< T, N >::globalInterpH | ( | const Matrix< HPoint_nD< T, N > > & | Q, | |
int | pU, | |||
int | pV | |||
) |
Generates a surface using global interpolation with homogenous points.
Q | a matrix of 4D points | |
pU | the degree of interpolation in the U direction | |
pV | the degree of interpolation in the V direction |
void PLib::NurbsSurface< T, N >::globalInterpClosedU | ( | const Matrix< Point_nD< T, N > > & | Q, | |
int | pU, | |||
int | pV | |||
) |
Generates a closed surface using global interpolation.
Generates a NURBS surface using global interpolation. In the u direction the curve will be closed and with C(pU-1) continuity. Each column in Q indicates the points for a closed curve in the u direction. First and last point have to be equal.
Q | a matrix of 3D points (wrapped in u dir. -rows) | |
pU | the degree of interpolation in the U direction | |
pV | the degree of interpolation in the V direction |
void PLib::NurbsSurface< T, N >::globalInterpClosedUH | ( | const Matrix< HPoint_nD< T, N > > & | Q, | |
int | pU, | |||
int | pV | |||
) |
Generates a surface using global interpolation.
Generates a NURBS surface using global interpolation. In the u direction the curve will be closed and with C(pU-1) continuity. Each column in Q indicates the points for a closed curve in the u direction. First and last point have to be equal.
Q | a matrix of 4D points (wrapped in u dir. -rows) | |
pU | the degree of interpolation in the U direction | |
pV | the degree of interpolation in the V direction |
void PLib::NurbsSurface< T, N >::leastSquares | ( | const Matrix< Point_nD< T, N > > & | Q, | |
int | pU, | |||
int | pV, | |||
int | nU, | |||
int | nV | |||
) |
generates a surface using global least squares approximation.
Q | a matrix of 3D points | |
pU | the degree of interpolation in the U direction | |
pV | the degree of interpolation in the V direction | |
nU | the number of points in the U direction | |
nV | the number of poitns in the V direction |
void PLib::NurbsSurface< T, N >::leastSquaresClosedU | ( | const Matrix< Point_nD< T, N > > & | Q, | |
int | pU, | |||
int | pV, | |||
int | nU, | |||
int | nV | |||
) |
Generates a closed surface using global least squares approximation.
Generates a NURBS surface using global least squares approximation. This will be closed in the u direction and open in the v direction. At u=0("="1) the surface will have C(pU-1) continuity in the u direction.
Q | a matrix of 3D points (wrapped in u dir. -rows) | |
pU | the degree of interpolation in the U direction | |
pV | the degree of interpolation in the V direction | |
nU | the number of points in the U direction | |
nV | the number of poitns in the V direction |
int PLib::NurbsSurface< T, D >::skinV | ( | NurbsCurveArray< T, D > & | ca, | |
int | dV | |||
) |
Generates a NURBS surface from skinning.
The NURBS surface is generated from skinning. The skinning is performed in the V direction.
ca | an array of NURBS curves | |
degV | the degree to skin in the V direction | |
surf | the skinned surface |
int PLib::NurbsSurface< T, nD >::skinU | ( | NurbsCurveArray< T, nD > & | ca, | |
int | dU | |||
) |
Generates a NURBS surface from skinning.
The NURBS surface is generates from skinning. The skinning is performed in the U direction.
ca | an array of NURBS curves | |
degU | the degree to skin in the Udirection |
void PLib::NurbsSurface< T, N >::sweep | ( | const NurbsCurve< T, N > & | Trj, | |
const NurbsCurve< T, N > & | C, | |||
const NurbsCurve< T, N > & | Sv, | |||
int | K, | |||
int | useAy = 0 , |
|||
int | invAz = 0 | |||
) |
Generates a surface by sweeping a curve along a trajectory.
Sweeping consists of creating a surface by moving a curve profile through a trajectory. The method uses here consists of using skinning of K instances of the curve C(u) along T(u). The K value should be viewed as the minimum number of sections required.
The profile curve C(u) should lie on the xz-plane. It follows the trajectory curve T(u) along its y-axis.
The scaling function is used to modify the shape of the curve profile while it's being swept. It can scale in any of the 4 dimensions to obtain the desired effects on the profile.
See A10.1 on page 476 of the NURBS book for more details about the implementation.
You might have to play with the useAy and invAz variables to obtain a satisfactory result for the sweep operation. This is either because there is an error in the code or because it is the way it is supposed to work.
T | the trajectory of the curve | |
C | the curve profile to sweep | |
Sv | a scaling function | |
K | the minimum number of insertion | |
useAy | a 0 indicates that rotation angle around the $y$-axis is not computed, otherwise it is computed. Results are usually better with a value of 0. | |
invAz | a 1 indicates that the computed rotation around the $z$-axis should be inversed, a 0 indicates it stays as it is. |
void PLib::NurbsSurface< T, N >::sweep | ( | const NurbsCurve< T, N > & | Trj, | |
const NurbsCurve< T, N > & | C, | |||
int | K, | |||
int | useAy = 0 , |
|||
int | invAz = 0 | |||
) |
Generates a surface by sweeping a curve along a trajectory.
Sweeping consists of creating a surface by moving a curve through a trajectory. The method uses here consists of using skinning of $K$ instances of the curve C(u) along T(u). The K value should be viewed as a minimum.
The cross-sectional curve C(u) should lie on the xz-plane. It follows the trajectory curve T(u) along its y-axis.
You might have to play with the useAy and invAz variables to obtain a satisfactory result for the sweep operation. This is either because there is an error in the code or because it is the way it is supposed to work.
T | the trajectory of the curve | |
C | the curve to sweep | |
K | the minimum number of insertion | |
useAy | a 0 indicates that rotation angle around the y-axis is not computed, otherwise it is computed. | |
invAz | a 1 indicates that the computed rotation around the z-axis should be inversed, a 0 indicates it stays as it is. |
void PLib::NurbsSurface< T, N >::makeFromRevolution | ( | const NurbsCurve< T, N > & | profile, | |
const Point_nD< T, N > & | S, | |||
const Point_nD< T, N > & | Tvec, | |||
double | theta | |||
) |
Generates a surface of revolution.
Generates a surface of revolution of a profile around an arbitrary axis (specified by a starting point S and a tangent T) with a certain angle.
The angle is specified in radians.
profile | the curves to rotate around the axis | |
S | a point on the axis | |
T | the tangent vector of the rotation axis | |
theta | the angle of the revolution (in radians) |
void PLib::NurbsSurface< T, N >::makeFromRevolution | ( | const NurbsCurve< T, N > & | profile, | |
const Point_nD< T, N > & | S, | |||
const Point_nD< T, N > & | Tvec | |||
) |
Generates a surface of revolution.
Generates a surface of revolution of a profile around an arbitrary axis (specified by a starting point S and a tangent T).
profile | the curves to rotate around the axis | |
S | a point on the axis | |
T | the tangent vector of the rotation axis |
void PLib::NurbsSurface< T, N >::makeFromRevolution | ( | const NurbsCurve< T, N > & | profile | ) |
Generates a surface of revolution.
Generates a surface of revolution of a profile around the z axis.
profile | the curves to rotate around the z-axis |
void PLib::NurbsSurface< T, N >::makeSphere | ( | const Point_nD< T, N > & | O, | |
T | r | |||
) |
Generates a sphere.
The NURBS surface is now a sphere of radius r located at O.
O | the location of the center of the sphere | |
r | the radius of the sphere |
void PLib::NurbsSurface< T, N >::makeTorus | ( | const Point_nD< T, N > & | O, | |
T | R, | |||
T | r | |||
) |
Generates a torus.
The NURBS surface is now a torus with major radius R, minor radius r and located at O. The torus goes around the z-axis. This routine is an adaptation of a routine created by John W. Peterson.
O | the location of the center of the torus | |
R | the major radius of the torus | |
r | the minor radius of the torus |
void PLib::NurbsSurface< T, N >::degreeElevate | ( | int | tU, | |
int | tV | |||
) |
Degree elevate the surface in the U and V direction.
tU | elevate the degree of the surface in the u direction by this amount. | |
tV | elevate the degree of the surface in the v direction by this amount. |
void PLib::NurbsSurface< T, N >::degreeElevateU | ( | int | t | ) | [virtual] |
Degree elevate the surface in the U direction.
t | elevate the degree in the u direction by this amount. |
Reimplemented in PLib::NurbsSurfaceSP< T, N >, and PLib::NurbsSurfaceSP< float, 3 >.
void PLib::NurbsSurface< T, N >::degreeElevateV | ( | int | t | ) | [virtual] |
Degree elevate the surface in the V direction.
t | elevate the degree in the v direction by this amount. |
Reimplemented in PLib::NurbsSurfaceSP< T, N >, and PLib::NurbsSurfaceSP< float, 3 >.
int PLib::NurbsSurface< T, N >::decompose | ( | NurbsSurfaceArray< T, N > & | S | ) | const |
Decompose the surface into Bézier patches.
This function decomposes the curve into an array of homogenous Bézier patches.
S | an array of Bézier segments |
void PLib::NurbsSurface< T, N >::findSpan | ( | T | u, | |
T | v, | |||
int & | spanU, | |||
int & | spanV | |||
) | const |
finds the span in the U and V direction
Finds the span in the U and V direction. The spanU is the index k for which the parameter u is valid in the [u_k,u_{k+1}] range. The spanV is the index k for which the parameter v is valid in the [v_k,v_{k+1}] range.
u | find the U span for this parametric value | |
v | find the V span for this parametric value | |
spanU | the U span | |
spanV | the V span |
int PLib::NurbsSurface< T, N >::findSpanU | ( | T | u | ) | const |
finds the span in the U direction
Finds the span in the U direction. The span is the index k for which the parameter u is valid in the [u_k,u_{k+1}] range.
u | --> find the span for this parametric value |
int PLib::NurbsSurface< T, N >::findSpanV | ( | T | v | ) | const |
finds the span in the V direction
Finds the span in the V direction. The span is the index k for which the parameter v is valid in the [v_k,v_{k+1}] range.
v | find the span for this parametric value |
int PLib::NurbsSurface< T, N >::findMultU | ( | int | r | ) | const |
Finds the multiplicity of a knot in the U knot.
r | the knot to observe |
int PLib::NurbsSurface< T, N >::findMultV | ( | int | r | ) | const |
finds the multiplicity of a knot in the V knot
r | the knot to observe |
void PLib::NurbsSurface< T, N >::refineKnots | ( | const Vector< T > & | nU, | |
const Vector< T > & | nV | |||
) | [virtual] |
Refine both knot vectors.
nU | the U knot vector to refine from | |
nV | the V knot vector to refine from |
Reimplemented in PLib::HNurbsSurface< T, N >, PLib::HNurbsSurfaceSP< T, N >, and PLib::NurbsSurfaceSP< T, N >.
void PLib::NurbsSurface< T, N >::refineKnotU | ( | const Vector< T > & | X | ) | [virtual] |
Refines the U knot vector.
X | the knot vector to refine from |
Reimplemented in PLib::HNurbsSurface< T, N >, PLib::HNurbsSurfaceSP< T, N >, and PLib::NurbsSurfaceSP< T, N >.
void PLib::NurbsSurface< T, N >::refineKnotV | ( | const Vector< T > & | X | ) | [virtual] |
Refines the V knot vector.
X | the knot vector to refine from |
Reimplemented in PLib::HNurbsSurface< T, N >, PLib::HNurbsSurfaceSP< T, N >, and PLib::NurbsSurfaceSP< T, N >.
void PLib::NurbsSurface< T, N >::mergeKnots | ( | const Vector< T > & | nU, | |
const Vector< T > & | nV | |||
) | [virtual] |
merges a U and V knot vector with the surface knot vectors
nU | the U knot vector to merge with | |
nV | the V knot vector to merge with |
Reimplemented in PLib::HNurbsSurfaceSP< T, N >, and PLib::NurbsSurfaceSP< T, N >.
void PLib::NurbsSurface< T, N >::mergeKnotU | ( | const Vector< T > & | X | ) | [virtual] |
merges the U knot vector with another one
X | a knot vector |
Reimplemented in PLib::HNurbsSurfaceSP< T, N >, and PLib::NurbsSurfaceSP< T, N >.
void PLib::NurbsSurface< T, N >::mergeKnotV | ( | const Vector< T > & | X | ) | [virtual] |
merges the V knot vector with another one
X | a knot vector |
Reimplemented in PLib::HNurbsSurfaceSP< T, N >, and PLib::NurbsSurfaceSP< T, N >.
T PLib::NurbsSurface< T, N >::area | ( | T | eps = 0.001 , |
|
int | n = 100 | |||
) | const |
Computes the area of the surface.
Computes an approximation of the area of the surface using a numerical automatic integrator.
That integrator uses a Chebyshev Series Expansion to perform its approximation. This is why you can change the value n which sets the number of elements in the series.
The method is simple, integrate between each span. This is necessary in case the tangant of a point at u_i is undefined. Add the result and return this as the approximation.
eps | the accepted relative error | |
n | the number of element in the Chebyshev series |
T PLib::NurbsSurface< T, N >::areaIn | ( | T | us, | |
T | ue, | |||
T | vs, | |||
T | ve, | |||
T | eps, | |||
int | n | |||
) | const |
Computes the area of the surface inside [u_s,u_e].
Computes an approximation of the area of the surface using a numerical automatic integrator. The area is computed for the range [u_s,u_e]
That integrator uses a Chebyshev Series Expansion to perform its approximation. This is why you can change the value n which sets the number of elements in the series.
The method is similar to the one used by area excepted that it needs to check for the range.
us | the starting range | |
ue | the end of the range | |
vs | the starting range | |
ve | the end of the range | |
n | the number of element in the Chebyshev series | |
eps | the accepted relative error |
T PLib::NurbsSurface< T, N >::areaF | ( | T | u, | |
T | v | |||
) | const |
area needs to integrate a function over an interval to determine the area of the NURBS surface. Well, this is the function.
u | the parameter | |
v | the parameter |
void PLib::NurbsSurface< T, D >::isoCurveU | ( | T | u, | |
NurbsCurve< T, D > & | c | |||
) | const |
Generates an iso curve in the U direction.
Generates an iso-parametric curve which goes through the parametric value u along the U direction.
u | the U parametric value | |
c | the iso-parametric curve |
void PLib::NurbsSurface< T, D >::isoCurveV | ( | T | v, | |
NurbsCurve< T, D > & | c | |||
) | const |
Generates an iso curve in the V direction.
Generates an iso-parametric curve which goes through the parametric value v along the V direction.
v | the V parametric value | |
c | the iso-parametric curve |
int PLib::NurbsSurface< T, N >::read | ( | const char * | filename | ) |
read a surface from a file
filename | the filename to read from |
Reimplemented in PLib::HNurbsSurface< T, N >, PLib::HNurbsSurfaceGL, and PLib::HNurbsSurface< float, N >.
int PLib::NurbsSurface< T, N >::write | ( | const char * | filename | ) | const |
Write a surface to a file.
filename | the filename to write to |
Reimplemented in PLib::HNurbsSurface< T, N >, PLib::HNurbsSurfaceGL, and PLib::HNurbsSurface< float, N >.
int PLib::NurbsSurface< T, N >::read | ( | ifstream & | fin | ) | [virtual] |
Read a surface from an input stream.
fin | the input file stream |
Reimplemented in PLib::HNurbsSurface< T, N >, PLib::HNurbsSurfaceSP< T, N >, PLib::NurbsSurfaceGL, PLib::HNurbsSurfaceGL, PLib::NurbsSurfaceSP< T, N >, PLib::HNurbsSurface< float, N >, PLib::HNurbsSurfaceSP< float, 3 >, and PLib::NurbsSurfaceSP< float, 3 >.
int PLib::NurbsSurface< T, N >::write | ( | ofstream & | fout | ) | const |
Write a surface to a file stream.
fout | the output filestream to write to. |
Reimplemented in PLib::HNurbsSurface< T, N >, PLib::NurbsSurfaceGL, PLib::HNurbsSurfaceGL, and PLib::HNurbsSurface< float, N >.
int PLib::NurbsSurface< T, N >::writeVRML | ( | const char * | filename, | |
const Color & | color, | |||
int | Nu, | |||
int | Nv, | |||
T | u_s, | |||
T | u_e, | |||
T | v_s, | |||
T | v_e | |||
) | const [inline, virtual] |
Write the NURBS surface to a VRML file.
Writes a VRML file which represents the surface for the parametric space [uS,uE] and [vS,vE]. It does not optimize the number of points required to represent the surface.
filename | the file name for the output VRML file | |
Nu | the number of points in the u direction | |
Nv | the number of points in the v direction | |
uS | the starting value of u | |
uE | the end value of u | |
vS | the starting value of v | |
vE | the end value of v |
Reimplemented from PLib::ParaSurface< T, N >.
int PLib::NurbsSurface< T, N >::writeVRML | ( | ostream & | fout, | |
const Color & | color, | |||
int | Nu, | |||
int | Nv, | |||
T | u_s, | |||
T | u_e, | |||
T | v_s, | |||
T | v_e | |||
) | const [inline, virtual] |
Write the NURBS surface to a VRML file.
Writes a VRML file which represents the surface for the parametric space [uS,uE] and [vS,vE]. It does not optimize the number of points required to represent the surface.
filename | the file name for the output VRML file | |
Nu | the number of points in the u direction | |
Nv | the number of points in the v direction | |
uS | the starting value of u | |
uE | the end value of u | |
vS | the starting value of v | |
vE | the end value of v |
Reimplemented from PLib::ParaSurface< T, N >.
int PLib::NurbsSurface< T, N >::writeVRML97 | ( | const char * | filename, | |
const Color & | color, | |||
int | Nu, | |||
int | Nv, | |||
T | u_s, | |||
T | u_e, | |||
T | v_s, | |||
T | v_e | |||
) | const [inline, virtual] |
Write the NURBS surface to a VRML file.
Writes a VRML file which represents the surface for the parametric space [uS,uE] and [vS,vE]. It does not optimize the number of points required to represent the surface.
filename | the file name for the output VRML file | |
Nu | the number of points in the u direction | |
Nv | the number of points in the v direction | |
uS | the starting value of u | |
uE | the end value of u | |
vS | the starting value of v | |
vE | the end value of v |
Reimplemented from PLib::ParaSurface< T, N >.
int PLib::NurbsSurface< T, N >::writeVRML97 | ( | ostream & | fout, | |
const Color & | color, | |||
int | Nu, | |||
int | Nv, | |||
T | u_s, | |||
T | u_e, | |||
T | v_s, | |||
T | v_e | |||
) | const [inline, virtual] |
Write the NURBS surface to a VRML97 file.
Writes a VRML97 file which represents the surface for the parametric space [uS,uE] and [vS,vE]. It does not optimize the number of points required to represent the surface.
filename | the file name for the output VRML file | |
Nu | the number of points in the u direction | |
Nv | the number of points in the v direction | |
uS | the starting value of u | |
uE | the end value of u | |
vS | the starting value of v | |
vE | the end value of v |
Reimplemented from PLib::ParaSurface< T, N >.
ostream & PLib::NurbsSurface< T, N >::print | ( | ostream & | o | ) | const |
Sends the NURBS Surface to ostream for display.
int PLib::NurbsSurface< T, N >::writeVRML | ( | const char * | filename, | |
const Color & | color = whiteColor , |
|||
int | Nu = 20 , |
|||
int | Nv = 20 | |||
) | const [inline, virtual] |
int PLib::NurbsSurface< T, N >::writeVRML | ( | ostream & | fout, | |
const Color & | color = whiteColor , |
|||
int | Nu = 20 , |
|||
int | Nv = 20 | |||
) | const [inline] |
< Calls the ParaSurface routine with proper values
int PLib::NurbsSurface< T, N >::writeVRML97 | ( | const char * | filename, | |
const Color & | color = whiteColor , |
|||
int | Nu = 20 , |
|||
int | Nv = 20 | |||
) | const [inline, virtual] |
int PLib::NurbsSurface< T, N >::writeVRML97 | ( | ostream & | fout, | |
const Color & | color = whiteColor , |
|||
int | Nu = 20 , |
|||
int | Nv = 20 | |||
) | const [inline] |
< Calls the ParaSurface routine with proper values
int PLib::NurbsSurface< T, N >::writePOVRAY | ( | ostream & | povray, | |
int | patch_type = 1 , |
|||
double | flatness = 0.01 , |
|||
int | num_u_steps = 8 , |
|||
int | num_v_steps = 8 | |||
) | const |
Writes a set of povray bicubic patches to the ostream.
patch_type | the type of the patch | |
flatness | the flatness level | |
num_u_steps | the minimum number of triangles in the U direction | |
num_v_steps | the minimum number of triangles in the V direction | |
povray | the output stream |
int PLib::NurbsSurface< T, N >::writePOVRAY | ( | T | tolerance, | |
ostream & | povray, | |||
const Color & | color = Color(250,250,250) , |
|||
int | smooth = 0 , |
|||
T | ambient = 0.2 , |
|||
T | diffuse = 0.6 | |||
) | const |
Writes the surface as a mesh of triangles.
Writes the surface as a mesh of triangles. You might have to change the values for the tolerance to get exactly what you're looking for.
povray | the output stream | |
tolerance | the tolerance when performing the tesselation | |
color | the color of the object | |
diffuse | the diffuse factor | |
ambient | the ambient factor | |
smooth | flags which indicates if we generate smooth triangles |
int PLib::NurbsSurface< T, N >::writePOVRAY | ( | const char * | filename, | |
const Color & | col, | |||
const Point_nD< T, N > & | cView, | |||
const Point_nD< T, N > & | up, | |||
int | patch_type = 1 , |
|||
double | flatness = 0.01 , |
|||
int | num_u_steps = 8 , |
|||
int | num_v_steps = 8 | |||
) | const |
Writes a set of povray bicubic patches.
patch_type | the type of the patch | |
flatness | the flatness level | |
num_u_steps | the minimum number of triangles in the U direction | |
num_v_steps | the minimum number of triangles in the V direction |
int PLib::NurbsSurface< T, N >::writePOVRAY | ( | T | tolerance, | |
const char * | filename, | |||
const Color & | col, | |||
const Point_nD< T, N > & | cView, | |||
const Point_nD< T, N > & | up, | |||
int | smooth = 0 , |
|||
T | ambient = 0.2 , |
|||
T | diffuse = 0.6 | |||
) | const |
Writes a set of povray bicubic patches.
tolerance | the tolerance when performing the tesselation | |
filename | the file to write to | |
color | the color of the object | |
diffuse | the diffuse factor | |
ambient | the ambient factor | |
smooth | flags which indicates if we generate smooth triangles |
int PLib::NurbsSurface< T, N >::writeRIB | ( | ostream & | rib | ) | const |
Writes a NuPatch for render man.
Writes a stream which is compatible with Render Man specifications of a NURBS surface.
rib | the rib ostream |
int PLib::NurbsSurface< T, N >::writeRIB | ( | const char * | filename, | |
const Color & | col, | |||
const Point_nD< T, N > & | view | |||
) | const |
Writes a NuPatch for render man.
Writes a file whith follows the RIB protocol of RenderMan. It generates a file which views the whole object. The material used for rendering is plastic.
filename | the file to write to | |
col | the color of the object | |
view | the view point |
void PLib::NurbsSurface< T, N >::tesselate | ( | T | tolerance, | |
BasicList< Point_nD< T, N > > & | points, | |||
BasicList< int > & | connect, | |||
BasicList< Point_nD< T, N > > * | Norm = 0 | |||
) | const |
Generates a list of triangles for a surface.
This function is deprecated, please use the NurbsSubSurface class which implements everything that this function was suppose to do.
tolerance | the tolerance for the tesselation. | |
points | the list of points | |
connect | how the points should be connected |
int PLib::NurbsSurface< T, N >::writePS | ( | const char * | filename, | |
int | nu, | |||
int | nv, | |||
const Point_nD< T, N > & | camera, | |||
const Point_nD< T, N > & | lookAt, | |||
int | cp = 0 , |
|||
T | magFact = T(-1) , |
|||
T | dash = T(5) | |||
) | const |
Writes a post-script file representing the curve.
filename | the file to write the postscript file to | |
nu | the number of lines in the U direction | |
nv | the number of lines in the V direction | |
camera | where the camera is | |
lookAt | where the camera is looking at | |
plane | where is the projection plane from the camera | |
cp | a flag indicating if the control points should be drawn, 0 = no and 1 = yes | |
magFact | a magnification factor, the 2D point of the control points will be magnified by this value. The size is measured in postscript points. If the magFact is set to a value smaller or equal to 0, than the program will try to guess a magnification factor such that the curve is large enough to fill the page. | |
dash | the size of the dash in postscript points . A size smaller or equal to 0 indicates that the line joining the control points is plain. |
int PLib::NurbsSurface< T, N >::writePSp | ( | const char * | , | |
int | nu, | |||
int | nv, | |||
const Point_nD< T, N > & | camera, | |||
const Point_nD< T, N > & | lookAt, | |||
const Vector< Point_nD< T, N > > & | , | |||
const Vector< Point_nD< T, N > > & | , | |||
int | cp = 0 , |
|||
T | magFact = 0.0 , |
|||
T | dash = 5.0 | |||
) | const |
writes a post-script file representing the curve
Writes the curve in the postscript format to a file, it also draws the points defined in points with their associated vectors if vector is used.
filename | the file to write the postscript file to | |
nu | the number of lines in the U direction | |
nv | the number of lines in the V direction | |
camera | where the camera is | |
lookAt | where the camera is looking at | |
plane | where is the projection plane from the camera | |
points | draws these additional points as empty circles | |
vectors | specify a vector associated with the points (this can be an empty vector) | |
cp | a flag indicating if the control points should be drawn, 0 = no and 1 = yes | |
magFact | a magnification factor, the 2D point of the control points will be magnified by this value. The size is measured in postscript points. If the magFact is set to a value smaller or equal to 0, than the program will try to guess a magnification factor such that the curve is large enough to fill the page. | |
dash | the size of the dash in postscript points . A size smaller or equal to 0 indicates that the line joining the control points is plain. |
int PLib::NurbsSurface< T, N >::writeOOGL | ( | const char * | filename, | |
T | fDu, | |||
T | fDv, | |||
T | fBu = 0.0 , |
|||
T | fBv = 0.0 , |
|||
T | fEu = 1.0 , |
|||
T | fEv = 1.0 , |
|||
bool | bDrawCP = false | |||
) | const |
Write the NURBS surface to a OOGL mesh file.
Writes a OOGL mesh file which represents the surface for the parametric space [fBu,fEu] and [fBv,fEv]. It does not optimize the number of points required to represent the surface.
filename | the file name for the output OOGL file | |
fDu | the parameter step size in u | |
fDv | the parameter step size in v | |
OOGLheader_options | OOGL mesh format header options (evrything before the MESH keyword). If you want the mesh to be closed in the u/v direction you have to give a string containing [u][v] where [] means optional and indicates the direction to be wrapped. See Geomview documentation. | |
fBu | the initial parameter value in u | |
fBv | the initial parameter value in v | |
fEu | the end parameter value in u | |
fEv | the end parameter value in v | |
bDrawCP | draws the control points as circles |
int PLib::NurbsSurface< T, N >::writeOOGL | ( | const char * | filename | ) | const |
Write the NURBS surface to a OOGL mesh file.
Writes a OOGL bezier file which represents the NURBS surface decomposed into its Bezier patches.
filename | the file name for the output OOGL file |
int PLib::NurbsSurface< T, N >::writeDisplayQUADMESH | ( | const char * | filename, | |
int | iNu = 100 , |
|||
int | iNv = 100 , |
|||
const Color & | color = blueColor , |
|||
T | fA = .25 , |
|||
T | fO = 0.2 | |||
) | const |
Write the NURBS surface to a mesh file.
This function writes a surface in QUADMESH ascii format to interface with Display (Copyright 1993,1994,1995 David MacDonald, McConnell Brain Imaging Centre), Montreal Neurological Institute, McGill University.
filename | the file name for the output OOGL file |
void PLib::NurbsSurface< T, N >::transform | ( | const MatrixRT< T > & | A | ) |
Performs geometrical modifications.
Each control points will be modified by a rotation-translation matrix.
A | the rotation-translation matrix |
void PLib::NurbsSurface< T, N >::modCP | ( | int | i, | |
int | j, | |||
const HPoint_nD< T, N > & | p | |||
) | [inline] |
p | Modifies a control point |
void PLib::NurbsSurface< T, N >::modCPby | ( | int | i, | |
int | j, | |||
const HPoint_nD< T, N > & | p | |||
) | [inline] |
p | Modifies a control point |
T PLib::NurbsSurface< T, N >::modU | ( | int | i | ) | const [inline] |
modifies a knot
T& PLib::NurbsSurface< T, N >::modV | ( | int | i | ) | [inline] |
modifies a knot
T PLib::NurbsSurface< T, N >::modV | ( | int | i | ) | const [inline] |
modifies a knot
void PLib::NurbsSurface< T, N >::modKnotU | ( | const Vector< T > & | uKnot | ) | [inline] |
modifies the U knot vector if uKnot is of a proper size
void PLib::NurbsSurface< T, N >::modKnotV | ( | const Vector< T > & | vKnot | ) | [inline] |
modifies the U knot vector if uKnot is of a proper size
int PLib::NurbsSurface< T, N >::movePoint | ( | T | u, | |
T | v, | |||
const Point_nD< T, N > & | delta | |||
) |
Moves a point on the surface.
This moves the point s(u,v) by delta.
u | the parameter in the u direction | |
v | the parameter in the v direction | |
delta | the displacement of the point at S(u,v) |
int PLib::NurbsSurface< T, N >::movePoint | ( | const Vector< T > & | ur, | |
const Vector< T > & | vr, | |||
const Vector< Point_nD< T, N > > & | D, | |||
const Vector_INT & | Du, | |||
const Vector_INT & | Dv | |||
) |
Moves a point with some constraint.
This will modify the NURBS surface by respecting a certain number of constraints. u_r and v_r specifies the parameters on which the constraints should be applied. The constraint are defined by D_i(u,v) which requires 3 vectors to fully qualify. $D$ specifies the value of the constraint and Du and Dv are used to specify on which parameter the constraint is applied.
ur and vr should be in an increasing order.
ur | the vector of parameters in the u direction | |
vr | the vector of parameters in the v direction | |
D | a vector of the value of D_i^(k,l)(u,v) | |
Du | a vector specifying the index of the value of u for D_i | |
Dv | a vector specifying the index of the value of v for D_i |
int PLib::NurbsSurface< T, N >::movePoint | ( | const Vector< T > & | ur, | |
const Vector< T > & | vr, | |||
const Vector< Point_nD< T, N > > & | D, | |||
const Vector_INT & | Du, | |||
const Vector_INT & | Dv, | |||
const Vector_INT & | Dk, | |||
const Vector_INT & | Dl | |||
) |
Moves a point with some constraint.
This will modify the NURBS surface by respecting a certain number of constraints. u_r and v_r specifies the parameters on which the constraints should be applied. The constraint are defined by D_i^{(k,l)}(u,v) which requires 5 vectors to fully qualify. D specifies the value of the constraint and Du and Dv are used to specify on which parameter the constraint is applied and Dk and Dl specify the partial degree of the constraint.
The values in D should be ordered in respect with i,k and l. ur and vr should be in an increasing order.
ur | the vector of parameters in the u direction | |
vr | the vector of parameters in the v direction | |
D | a vector of the value of D_i^(k,l)(u,v) | |
Du | a vector specifying the index of the value of u for D_i | |
Dv | a vector specifying the index of the value of v for D_i | |
Dk | a vector specifying the value of k for D_i | |
Dl | a vector specifying the value of l for D_i |
int PLib::NurbsSurface< T, N >::movePoint | ( | const Vector< T > & | ur, | |
const Vector< T > & | vr, | |||
const Vector< Point_nD< T, N > > & | D, | |||
const Vector_INT & | Du, | |||
const Vector_INT & | Dv, | |||
const Vector_INT & | Dk, | |||
const Vector_INT & | Dl, | |||
const BasicArray< Coordinate > & | fixCP | |||
) |
Moves a point with some constraint.
This will modify the NURBS surface by respecting a certain number of constraints. u_r and v_r specifies the parameters on which the constraints should be applied. The constraint are defined by $D_i^{(k,l)}(u,v)$ which requires 5 vectors to fully qualify. D specifies the value of the constraint and Du and Dv are used to specify on which parameter the constraint is applied and Dk and Dl specify the partial degree of the constraint.
A second constraint fixCP consists of specifying which control points can not be moved by the routine.
The values in D should be ordered in respect with i,k and l. ur and vr should be in an increasing order.
ur | the vector of parameters in the u direction | |
vr | the vector of parameters in the v direction | |
D | a vector of the value of D_i^(k,l)(u,v) | |
Du | a vector specifying the index of the value of u for D_i | |
Dv | a vector specifying the index of the value of v for D_i | |
Dk | a vector specifying the value of k for D_i | |
Dl | a vector specifying the value of l for D_i | |
fixCP | a vector specifying which control points can not be modified. |
NurbsSurface< T, N > & PLib::NurbsSurface< T, N >::transpose | ( | void | ) |
Transpose the U and V coordinates of a surface.
Transpose the U and V coordinates of a surface. After this operation the (u,v) points correspond to (v,u).
void gordonSurface | ( | NurbsCurveArray< T, N > & | lU, | |
NurbsCurveArray< T, N > & | lV, | |||
const Matrix< Point_nD< T, N > > & | intersections, | |||
NurbsSurface< T, N > & | gS | |||
) | [friend] |
Interpolation of a surface from 2 sets of orthogonal curves.
Interpolation of a surface from 2 sets of orthogonal curves. See A10.3 at page 494 on the NURBS book for more details about the implementation.
lU | an array of curves in the U direction | |
lV | an array of curves in the V direction | |
intersections | a matrix of 3D points specifying where the the curves intersect | |
gS | the Gordon surface |
void globalSurfInterpXY | ( | const Matrix< Point_nD< T, N > > & | Q, | |
int | pU, | |||
int | pV, | |||
NurbsSurface< T, N > & | S | |||
) | [friend] |
Generates a surface using global interpolation.
Generates a NURBS surface using global interpolation. The data points are assumed to be part of grided points in x-y. i.e. the original data set as points covering the xy plane at regular x and y intervals with only the z being a free variable
Q | a matrix of 3D points | |
pU | the degree of interpolation in the U direction | |
pV | the degree of interpolation in the V direction | |
S | the interpolated surface |
void globalSurfInterpXY | ( | const Matrix< Point_nD< T, N > > & | Q, | |
int | pU, | |||
int | pV, | |||
NurbsSurface< T, N > & | S, | |||
const Vector< T > & | uk, | |||
const Vector< T > & | vk | |||
) | [friend] |
generates a surface using global interpolation
Generates a NURBS surface using global interpolation. The data points are assumed to be part of grided points in x-y. i.e. the original data set as points covering the xy plane at regular x and y intervals with only the z being a free variable
Q | a matrix of 3D points | |
pU | the degree of interpolation in the U direction | |
pV | the degree of interpolation in the V direction | |
S | the interpolated surface |
void globalSurfApprox | ( | const Matrix< Point_nD< T, N > > & | Q, | |
int | pU, | |||
int | pV, | |||
NurbsSurface< T, N > & | S, | |||
double | error = 0 | |||
) | [friend] |
Generates a surface using global approximation.
Q | a matrix of 3D points | |
pU | the degree of interpolation in the U direction | |
pV | the degree of interpolation in the V direction | |
S | the interpolated surface |
int surfMeshParams | ( | const Matrix< Point_nD< T, N > > & | Q, | |
Vector< T > & | uk, | |||
Vector< T > & | vl | |||
) | [related] |
Computes the parameters for global surface interpolation.
Computes the parameters for global surface interpolation. For more information, see A9.3 on p377 on the NURBS book.
Q | the matrix of 3D points | |
uk | the knot coefficients in the U direction | |
vl | the knot coefficients in the V direction |
int surfMeshParamsH | ( | const Matrix< HPoint_nD< T, N > > & | Q, | |
Vector< T > & | uk, | |||
Vector< T > & | vl | |||
) | [related] |
Computes the parameters for global surface interpolation.
Computes the parameters for global surface interpolation. For more information, see A9.3 on p377 on the NURBS book.
Q | the matrix of 3D points | |
uk | the knot coefficients in the U direction | |
vl | the knot coefficients in the V direction |
Vector<T> PLib::NurbsSurface< T, N >::U [protected] |
the U knot vector
Vector<T> PLib::NurbsSurface< T, N >::V [protected] |
the V knot vector
Matrix< HPoint_nD<T,N> > PLib::NurbsSurface< T, N >::P [protected] |
The matrix of control points.
int PLib::NurbsSurface< T, N >::degU [protected] |
the degree of the surface in U
int PLib::NurbsSurface< T, N >::degV [protected] |
the degree of the surface in V