|
cur_nurbsarr - geometric procedure
Description
| Creates a NURBS curve from control points and optional weights and knots.
Input data is given in arrays. If you dont know what order to use we recomend order = 4
(NURBS order = NURBS degree +1).
Knots may be uniformly spaced or non uniformly.
To get a rational curve, weights may be given. Default is 1.0 for all weights (non rational).
|
Syntax
| cur_nurbsarr(id, order, ncpts, cpts, weights, knots :attributes); |
REF |
id |
INT |
order |
INT |
ncpts |
VECTOR |
cpts( ) |
FLOAT |
weights( ) |
FLOAT |
knots( ) |
Principal parameters
|
id |
- Local identity |
order |
- Nurbs order (order=degree+1) |
ncpts |
- Number off control points |
cpts( ) |
- Array with control points |
Optional parameters
|
weights( ) |
- Array with weights (number of weights shall be same as ncpts) |
knots( ) |
- Array with knot values (number of knot values shall be ncpts + order) |
Attributes |
PEN |
- Pen or colour number |
LEVEL |
- Level number |
BLANK |
- Visible(0) or invisible(1) |
CFONT |
- Solid(0), dashed(1) or centerline(2) |
CDASHL |
- Dashlength |
WIDTH |
- Linewidth |
Examples |
CONSTANT INT order=4;
CONSTANT INT ncpts=5;
VECTOR cpts(5);
FLOAT weights(5);
FLOAT knots(9);
cur_nurbsarr(#10,order, ncpts, cpts, weights, knots);
|
Comments |
A NURBS curve interpolates start and end point if the first and last knot value
is repeated order times.
A uniform knotvector for the example above could be: {0 0 0 0 0.5 1 1 1 1} This curve
will then have 2 segments (NURBS spans).
The curve will be evaluated with the given (possibly non uniform) knotvector, but the varkon
parameterization for successive operations, on( ), norm( ) etc. vill be similar as for other
curvetypes, i.e. 0-1 for first segment, 1-2 for second segment etc.
Limitations:
A NURBS curve can not yet be trimmed or included in a composite curve.
inv_arcl( ) may fail for some NURBS-curves.
|
|
|