This reference page is linked to from the following overview topics: FBX SDK 2012, Supported Scene Elements, FBX Node Attributes, List of Python FBX classes.
A Non-Uniform Rational B-Spline (NURBS) curve is a type of parametric geometry.
A NURBS curve is defined by the degree, form, knot vector and control points.
Let M be the degree of the curve. Let N be the number of control points of the curve.
The form of the curve can be open, closed or periodic. A curve with end points that do not meet is defined as an open curve. The number of knots in an open curve is defined as N+(M+1).
A closed curve simply has its last control point equal to its first control point. Note that this does not imply tangent continuity at the end point. The curve may have a kink at this point. In FBX the last control point is not specified by the user in the InitControlPoints() method. For example, if there are to be 10 control points in total, and the curve is to be closed, than only 9 control points need to be passed into the InitControlPoints() method. The last control point is implied to be equal to the first control point. Thus N represents the number of unique CVs.
A periodic curve has its last M control points equal to its first M control points. A periodic curve is tangent continuous at the ends. Similar to a closed curve, when creating a periodic curve, only the unique control points need to be set. For example a periodic curve of degree 3 with 10 control points requires only 7 CVs to be specified in the InitControlPoints() method. The last 3 CVs, which are the same as the first 3, are not included.
The calculation of the number of knots in closed and periodic curves is more complex. Since we have excluded one CV in N in a closed curve, the number of knots is N+(M+1)+1. Similarly, we excluded M CVs in periodic curves so the number of knots is N+(M+1)+M.
Note that FBX stores one extra knot at the beginning and and end of the knot vector, compared to some other graphics applications such as Maya. The two knots are not used in calculation, but they are included so that no data is lost when converting from file formats that do store the extra knots.
Definition at line 85 of file kfbxnurbscurve.h.
#include <kfbxnurbscurve.h>
Public Types |
|
enum | EDimension { e2D = 2, e3D, eDIMENSIONS_COUNT = 2 } |
The dimension of the CVs. More... |
|
enum | EType { eOPEN, eCLOSED, ePERIODIC, eTYPE_COUNT } |
The curve's form. More... |
|
enum | EError
{ eNurbCurveTypeUnknown, eWeightTooSmall, eKnotVectorError, eWrongNumberOfControlPoint, eErrorCount } |
Error identifiers. More... |
|
Public Member Functions |
|
virtual KFbxNodeAttribute::EAttributeType |
GetAttributeType () const |
Returns the EAttributeType::eNURBS_CURVE
node attribute type. |
|
void | InitControlPoints (int pCount, EType pVType) |
Allocates memory space for the control
points array as well as for the knot vector. |
|
double * | GetKnotVector () const |
Returns the knot vector. |
|
int | GetKnotCount () const |
Returns the number of elements in the knot
vector. |
|
void | SetOrder (int pOrder) |
Sets the order of the curve. |
|
int | GetOrder () const |
Returns the NURBS curve order. |
|
void | SetStep (int pStep) |
Sets the step of the curve. |
|
int | GetStep () const |
Returns the NURBS curve step. |
|
void | SetDimension (EDimension pDimension) |
Sets the dimension of the CVs. |
|
EDimension | GetDimension () const |
Returns the control points dimension.
|
|
bool | IsRational () |
Determines if the curve is rational or not.
|
|
int | GetSpanCount () const |
Calculates the number of curve spans with
the following: Where S = Number of spans N = Number of CVs M =
Order of the curve. |
|
EType | GetType () const |
Returns NURBS type. |
|
bool | IsPolyline () const |
Checks if the curve is a poly line. |
|
bool | IsBezier () const |
This function determines if this NURBS curve
is a Bezier curve. |
|
int | TessellateCurve (KArrayTemplate< KFbxVector4 > &pPointArray, int pStep=16) |
Evaluate the point on the curve. |
|
KFbxLine * | TessellateCurve (int pStep=16) |
Evaluate the point on the curve. |
|
virtual KFbxObject & | Copy (const KFbxObject &pObject) |
Copy an object content into this object.
|
|
bool | FullMultiplicity () const |
Public Attributes |
|
bool | mIsRational |
Protected Member Functions |
|
KFbxNurbsCurve (KFbxSdkManager &pManager, char const *pName) | |
void | Reset () |
virtual void | Destruct (bool pRecursive, bool pDependents) |
enum EDimension |
The dimension of the CVs.
Definition at line 96 of file kfbxnurbscurve.h.
{ e2D = 2, e3D, eDIMENSIONS_COUNT = 2 };
enum EType |
The curve's form.
Definition at line 108 of file kfbxnurbscurve.h.
{ eOPEN, eCLOSED, ePERIODIC, eTYPE_COUNT };
enum EError |
Error identifiers.
eNurbCurveTypeUnknown | |
eWeightTooSmall | |
eKnotVectorError | |
eWrongNumberOfControlPoint | |
eErrorCount |
Reimplemented from KFbxGeometry.
Definition at line 234 of file kfbxnurbscurve.h.
{ eNurbCurveTypeUnknown, eWeightTooSmall, eKnotVectorError, eWrongNumberOfControlPoint, /* eUMultiplicityVectorError, eVMultiplicityVectorError, , eVKnotVectorError, */ eErrorCount } EError;
KFbxNurbsCurve | ( | KFbxSdkManager & | pManager, |
char const * | pName | ||
) | [protected] |
virtual KFbxNodeAttribute::EAttributeType GetAttributeType | ( | ) | const [virtual] |
Returns the EAttributeType::eNURBS_CURVE node attribute type.
Reimplemented from KFbxGeometry.
void InitControlPoints | ( | int | pCount, |
EType | pVType | ||
) |
Allocates memory space for the control points array as well as for the knot vector.
pCount | Number of control points. |
pVType | NURBS type. |
double* GetKnotVector | ( | ) | const [inline] |
Returns the knot vector.
Definition at line 127 of file kfbxnurbscurve.h.
{ return mKnotVector; }
int GetKnotCount | ( | ) | const |
Returns the number of elements in the knot vector.
void SetOrder | ( | int | pOrder | ) | [inline] |
Sets the order of the curve.
pOrder | The curve order. |
Definition at line 138 of file kfbxnurbscurve.h.
{ mOrder = pOrder; }
int GetOrder | ( | ) | const [inline] |
Returns the NURBS curve order.
Definition at line 143 of file kfbxnurbscurve.h.
{ return mOrder; }
void SetStep | ( | int | pStep | ) | [inline] |
Sets the step of the curve.
pOrder | The curve step. |
Definition at line 149 of file kfbxnurbscurve.h.
{ mStep = pStep; }
int GetStep | ( | ) | const [inline] |
Returns the NURBS curve step.
Definition at line 155 of file kfbxnurbscurve.h.
{ return mStep; }
void SetDimension | ( | EDimension | pDimension | ) | [inline] |
Sets the dimension of the CVs.
For 3D curves: control point = ( x, y, z, w ), where w is the weight. For 2D curves: control point = ( x, y, 0, w ), where the z component is unused, and w is the weight.
pDimension | The control points dimension(3D or 2D). |
Definition at line 162 of file kfbxnurbscurve.h.
{ mDimension = pDimension; }
EDimension GetDimension | ( | ) | const [inline] |
Returns the control points dimension.
Definition at line 167 of file kfbxnurbscurve.h.
{ return mDimension; }
bool IsRational | ( | ) |
Determines if the curve is rational or not.
True
if the curve is rational, return
false
if not.int GetSpanCount | ( | ) | const |
Calculates the number of curve spans with the following: Where S = Number of spans N = Number of CVs M = Order of the curve.
S = N - M + 1;
In this calculation N includes the duplicate CVs for closed and periodic curves.
EType GetType | ( | ) | const [inline] |
Returns NURBS type.
Definition at line 191 of file kfbxnurbscurve.h.
{ return mNurbType; }
bool IsPolyline | ( | ) | const [inline] |
Checks if the curve is a poly line.
(A poly line is a linear NURBS curve )
True
if curve is a poly line, return
false
if it is not a poly line.Definition at line 198 of file kfbxnurbscurve.h.
{ return ( GetOrder() == 2 ); }
bool IsBezier | ( | ) | const |
This function determines if this NURBS curve is a Bezier curve.
Bezier curves are a special case of NURBS curve.
True
if curve is a Bezier curve. If it is not a
Bezier curve return false
.int TessellateCurve | ( | KArrayTemplate< KFbxVector4 > & | pPointArray, |
int | pStep = 16 |
||
) |
Evaluate the point on the curve.
Save the result as a point array. Meanwhile, return the length of the point array.
pPointArray | Save the evaluate result as a point array. |
pStep | The evaluation frequency between two neighbor knots. Its default value is 16, which is same as Maya. |
KFbxLine* TessellateCurve | ( | int | pStep = 16 |
) |
Evaluate the point on the curve.
Per the evaluation result, create a KFbxLine and return the pointer to the line.
pStep | The evaluation frequency between two neighbor knots. Its default value is 16, which is same as Maya. |
virtual KFbxObject& Copy | ( | const KFbxObject & | pObject | ) | [virtual] |
Copy an object content into this object.
pObject | The source object to copy data from. |
Reimplemented from KFbxGeometry.
bool FullMultiplicity | ( | ) | const |
void Reset | ( | ) | [protected] |
virtual void Destruct | ( | bool | pRecursive, |
bool | pDependents | ||
) | [protected, virtual] |
Reimplemented from KFbxGeometry.
bool mIsRational |
Definition at line 259 of file kfbxnurbscurve.h.