Functions | |
HC_KEY | Insert_NURBS_Curve (int degree, int cpcount, const HC_POINT *control_points, const float *weights, const float *knots, double start_u, double end_u) |
HC_KEY | DInsert_NURBS_Curve (int degree, int cpcount, const HCD_POINT *control_points, const float *weights, const float *knots, double start_u, double end_u) |
HC_KEY Insert_NURBS_Curve | ( | int | degree, |
int | cpcount, | ||
const HC_POINT * | control_points, | ||
const float * | weights, | ||
const float * | knots, | ||
double | start_u, | ||
double | end_u | ||
) |
Generates a Non-Uniform Rational B-Spline (NURBS) curve.
degree | - Degree of the curve. |
cpcount | - Number of valid points in control_points. |
control_points | - points. (A simple N x 3 array may also be used.) Passed by reference always. |
weights | - Control point weights. |
knots | - Knot sequence. |
start_u | - Start parameter. |
end_u | - End parameter. |
A NURBS curve is a parametric HOOPS Visualize primitive. Its goemetric properties are determined by a set of mathematical functions.
For drawing purposes, a NURBS curve is a polyline. Visibility and other drawing attributes can be set as usual on the segment.
The order of the curve determines the form of the parametric equations which define the curve, as well as how smooth the curve can be. The order is equal to 1 plus the maximum exponent (degree) of the variables in the parametric equations. The control points are points in object space that affect the shape of the curve, while the knot sequence defines how the control points afffect the curve. The weights control the influence of the control points.
The relationships among the NURBS parameters are as follows:
Knot values must be nondecreasing, and all weights should be nonnegative.
If NULL is passed in for weights, weights will be given a default value of 1.0 (the curve is nonrational). If NULL is passed in for knots, then all knots will have default values of "0,1,2,...,knot count" (the curve is uniform) .
start_u and end_u are used to make the start and end of the curve invisible.
start_u and end_u are in normalized parameter space, and must range from 0.0 to 1.0. start_u must be less than end_u.
The invisible parts of the curve are never selectable.
This function's double parameters are internally truncated to float. If you require extra precision, use this function's double-precision variant, DInsert_NURBS_Curve.
OpenGL contains an optimized API for supporting NURBS curves that does not support clipping the ends with start_u and end_u. Thus, curves that are entirely visible (i.e. start_u = 0, end_u = 1) are much faster than trimmed curves when using the OpenGL driver.
There are no options defined for NURBS curves and the options string is ignored.
HC_KEY DInsert_NURBS_Curve | ( | int | degree, |
int | cpcount, | ||
const HCD_POINT * | control_points, | ||
const float * | weights, | ||
const float * | knots, | ||
double | start_u, | ||
double | end_u | ||
) |
Similar to Insert_NURBS_Curve(), but accepts parameters of type double for increased precision. Unlike Insert_NURBS_Curve, the parameters are not truncated.
degree | - Degree of the curve. |
cpcount | - Number of valid points in control_points. |
control_points | - points. (A simple N x 3 array may also be used.) Passed by reference always. |
weights | - Control point weights. |
knots | - Knot sequence. |
start_u | - Start parameter. |
end_u | - End parameter. |
No additional details. See Insert_NURBS_Curve().