Brief Index      Full Index      I.M. Reference

Insert_NURBS_Curve


Functions

void 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 KInsert_NURBS_Curve (int degree, int cpcount, const HC_POINT *control_points, const float *weights, const float *knots, double start_u, double end_u)
void QInsert_NURBS_Curve (const char *segment, int degree, int cpcount, const HC_POINT *control_points, const float *weights, const float *knots, double start_u, double end_u)
HC_KEY QKInsert_NURBS_Curve (const char *segment, int degree, int cpcount, const HC_POINT *control_points, const float *weights, const float *knots, double start_u, double end_u)
void 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 DKInsert_NURBS_Curve (int degree, int cpcount, const HCD_POINT *control_points, const double *weights, const double *knots, double start_u, double end_u)
void DQInsert_NURBS_Curve (const char *segment, int degree, int cpcount, const HCD_POINT *control_points, const double *weights, const double *knots, double start_u, double end_u)
HC_KEY DQKInsert_NURBS_Curve (const char *segment, int degree, int cpcount, const HCD_POINT *control_points, const double *weights, const double *knots, double start_u, double end_u)

Function Documentation

void 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.

Parameters:
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.

DETAILS

A NURBS curve is a parametric HOOPS primitive, i.e., it's 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:

  • order = degree + 1, where degree is the maximum exponent in the parametric equations.  For example, use 2 for a quadratic curve.
    - to define a curve, you need at least order control points
    - maximum continuity = order - 2
    - number of knots = order + cpcount
    - maximum knot multiplicity = order
    - continuity = order - (multiplicity + 1)

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.

NOTES

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 HOOPS' OpenGL driver.

If there is an error the KInsert routine returns "-1".

In the current version of HOOPS, there are no options defined for NURBS curves and the options string is ignored.

RESTRICTIONS

See also:
Edit_NURBS_Curve, Show_NURBS_Curve, InsertShell, Insert_Mesh, Insert_Grid, Insert_Polygon, Insert_Polyline, Set_Rendering_Options, Set_Visibility, Set_Color, Renumber_Key.

HC_KEY KInsert_NURBS_Curve ( int  degree,
int  cpcount,
const HC_POINT *  control_points,
const float *  weights,
const float *  knots,
double  start_u,
double  end_u 
)

Similar to Insert_NURBS_Curve(), but returns an HC_KEY to the object.

Parameters:
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.
Returns:
key

DETAILS

No additional details. See Insert_NURBS_Curve()

void QInsert_NURBS_Curve ( const char *  segment,
int  degree,
int  cpcount,
const HC_POINT *  control_points,
const float *  weights,
const float *  knots,
double  start_u,
double  end_u 
)

Similar to Insert_NURBS_Curve(), but operates on a given segment rather than the currently open one.

Parameters:
segment - Segment(s) to be inserted into, if other than the currently open segment.
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.

DETAILS

No additional details. See Insert_NURBS_Curve()

HC_KEY QKInsert_NURBS_Curve ( const char *  segment,
int  degree,
int  cpcount,
const HC_POINT *  control_points,
const float *  weights,
const float *  knots,
double  start_u,
double  end_u 
)

Similar to Insert_NURBS_Curve(), but operates on a given segment and returns an HC_KEY to the object.

Parameters:
segment - Segment(s) to be inserted into, if other than the currently open segment.
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.
Returns:
key

DETAILS

No additional details. See Insert_NURBS_Curve()

void 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 and/or returns double precision values. This command can only be used when the application source includes the HOOPS double-precision header, hcd.h.

Parameters:
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.

DETAILS

No additional details. See Insert_NURBS_Curve().

HC_KEY DKInsert_NURBS_Curve ( int  degree,
int  cpcount,
const HCD_POINT *  control_points,
const double *  weights,
const double *  knots,
double  start_u,
double  end_u 
)

Similar to DInsert_NURBS_Curve(), but returns an HC_KEY to the object.

Parameters:
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.
Returns:
key

DETAILS

No additional details. See Insert_NURBS_Curve()

void DQInsert_NURBS_Curve ( const char *  segment,
int  degree,
int  cpcount,
const HCD_POINT *  control_points,
const double *  weights,
const double *  knots,
double  start_u,
double  end_u 
)

Similar to DInsert_NURBS_Curve(), but operates on a given segment rather than the currently open one.

Parameters:
segment - Segment(s) to be inserted into, if other than the currently open segment.
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.

DETAILS

No additional details. See Insert_NURBS_Curve()

HC_KEY DQKInsert_NURBS_Curve ( const char *  segment,
int  degree,
int  cpcount,
const HCD_POINT *  control_points,
const double *  weights,
const double *  knots,
double  start_u,
double  end_u 
)

Similar to DInsert_NURBS_Curve(), but operates on a given segment and returns an HC_KEY to the object.

Parameters:
segment - Segment(s) to be inserted into, if other than the currently open segment.
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.
Returns:
key

DETAILS

No additional details. See Insert_NURBS_Curve()

Main Index
Brief Index      Full Index      I.M. Functions