nurbsc(3G)nurbsc(3G)NAMEnurbsc - controls the shape of a NURBS curve
FORTRAN 77 SPECIFICATION
subroutine nurbsc(knotcount, knotlist, offset, ctlarray,
+ order, type)
integer*4 knotcount, offset
double precision knotlist(knotcount), ctlarray(*)
integer*4 order, type
PARAMETERS
knotcount number of knots in knotlist. knotcount equals the number of
control points plus the order.
knotlist array of knotcount non-decreasing knot values.
offset offset (in bytes) between successive curve control points.
ctlarray pointer to an array of control points. The coordinates must
agree with the type specified below.
order order of the NURBS curve. order equals degree + 1, hence, a
cubic curve has an order of 4. The maximum order is given
by getgdesc (GD_NURBS_ORDER).
type type of curve:
N_P2D for a polynomial (u,v) trimming curve
N_P2DR for a rational (wu,wv,w) trimming curve
N_V3D for a polynomial (x,y,z) curve
N_V3DR for a rational (x,y,z,w) curve
DESCRIPTION
Use nurbsc to describe a NURBS curve.
The curve is either a curve in space, or a curve used to trim (define the
visible region of) a NURBS surface. Curve types NV3D and NV3DR specify
curves in space; types NP2D and NP2DR specify curves used as trimming
curves.
Use bgncur and endcur to delimit the NURBS curve, unless it is a trimming
curve, in which case it will appear within a bgntri/endtri block.
Specify the knot sequence, the control points and the order of the NURBS
curve.
You specify trimming regions within a NURBS surface definition (see
bgnsur). to define the visible regions of the NURBS surface. Trimming
loops are closed, oriented curves that define the trimming regions. You
can describe a trimming loop by using a series of NURBS curves, piecewise
Page 1
nurbsc(3G)nurbsc(3G)
linear curves (see pwlcur), or both.
Use bgntri to mark the beginning of a trimming loop definition; use
endtri to mark the end of a trimming loop definition.
The system displays the region of the NURBS surface that is to the left
of the trimming curve as the parameter increases. Thus, for a counter-
clockwise oriented trimming curve, the region inside the curve is
displayed. For a clockwise oriented trimming curve, the region outside
the curve is displayed.
The offset parameter is used in case the control points are part of an
array of larger structure elements. The nurbscurve routine searches for
the n-th control point pair or triple beginning at byte address
ctlarray + n * offset.
See the Graphics Library Programming Guide for a mathematical description
of a NURBS curve.
EXAMPLE
double ctlpts [4] [3] ={
{-.75, -.75, 0.0}, {-.5, .75, 0.0}, {.5, .75, 0.0} {.75, -.75, 0.0}
};
double knots[8] = {0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0};
bgncurve()
nurbscurve(8, knots, 3*sizeof(double), &ctlpts[0] [0], 4, N_V3D);
endcurve();
SEE ALSO
bgncur, bgnsur, bgntri, endcur, endsur, endtri, getnur, nurbss, pwlcur,
setnur
Page 2