.\"##
.\" $XConsortium: p235,v 5.2 94/04/17 20:57:09 rws Exp $
.\"##
.\"## 
$XMCOPY
.\"## Copyright (c) 1990, 1991 by Sun Microsystems, Inc. 
.\"## 
.\"##                         All Rights Reserved
.\"## 
.\"## Permission to use, copy, modify, and distribute this software and its 
.\"## documentation for any purpose and without fee is hereby granted, 
.\"## provided that the above copyright notice appear in all copies and that
.\"## both that copyright notice and this permission notice appear in 
.\"## supporting documentation, and that the name of Sun Microsystems,
.\"## not be used in advertising or publicity 
.\"## pertaining to distribution of the software without specific, written 
.\"## prior permission.  
.\"## 
.\"## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
.\"## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
.\"## EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
.\"## CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
.\"## USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\"## OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\"## PERFORMANCE OF THIS SOFTWARE.
.ds f \s-2NON-UNIFORM B-SPLINE CURVE\s+2
.TH "NON-UNIFORM B-SPLINE CURVE" 3P+ "29 February 1991"
.SH NAME
NON-UNIFORM B-SPLINE CURVE \- create a non-uniform B-spline curve structure element
.IX "NURB functions" "NON-UNIFORM B-SPLINE CURVE"
.IX "PHIGS Extension Functions" "NON-UNIFORM B-SPLINE CURVE"
.IX "Line Primitives" "NON-UNIFORM B-SPLINE CURVE"
.IX "Primitives, Line Primitives" "NON-UNIFORM B-SPLINE CURVE"
.IX "Splines" "NON-UNIFORM B-SPLINE CURVE"
.SH SYNOPSIS
.SS C Syntax
.ft B
.ta 1.25i 3i
.nf
void
pnuni_bsp_curv (order, knots, rationality, cpoints, min, max)
Pint	order;	\fIspline order\fP
Pfloat_list	*knots;	\fIlist of knots\fP
Prational	rationality;	\fIrationality specifier\fP
Ppoint_list34	*cpoints;	\fIlist of 3D or 4D control points\fP
Pfloat	min, max;	\fIparameter range\fP
.fi
.ft R
.SS Required PHIGS Operating States
(PHOP, *, STOP, *)
.SH DESCRIPTION
.SS Purpose
\s-2NON-UNIFORM B-SPLINE CURVE\s+2
creates a structure element containing 
the definition of a non-uniform
B-spline curve.  The curve may be
rational or non-rational.
.SS C Input Parameters
.IP \fIorder\fR
The order of the curve.  The degree of the curve's basic functions is one
less than \fIorder\fP.
.IP \fIknots\fR
A pointer to a Pfloat_list structure containing a non-decreasing sequence of
real numbers specifying the curve's knot vector.
Pfloat_list is defined in phigs.h as follows:
.sp .2
.nf
.ta .5i +1i +1i
.sp .2
typedef struct {
.sp .2
	Pint	num_floats;	/* number of Pfloats in list */
	Pfloat	*floats;	/* list of floats */
.sp .2
} Pfloat_list;
.fi
.IP \fIrationality\fR
The rationality of the curve.  Prational is defined in phigs.h as follows:
.sp .2
.nf
.ta .5i +\w'PNON_RATIONAL,     'u 
.sp .2
typedef enum {
.sp .2
	PNON_RATIONAL = 0,
	PRATIONAL = 1
.sp .2
} Prational;
.fi
.IP "\fIcpoints\fR"
A pointer to a Ppoint_list34 structure containing the list of the curve's
control points.  The points are specified in Modelling Coordinates.
Ppoint_list34 is defined in phigs.h as follows:
.sp .2
.nf
.ta .5i +.5i +.75i +1i
.sp .2
typedef struct {			/* list of 3D or 4D points */
.sp .2
	Pint		num_points;	/* number of control points */
	union {
		Ppoint3	*point3d;	/* array of 3D points */
		Ppoint4	*point4d;	/* array of 4D points */
	} points;
.sp .2
} Ppoint_list34;
.fi
.IP
The point4d member of the points union is used if rationality 
is \s-2PRATIONAL\s+2; otherwise, the point3d member is used.
.fi
.bp
.IP
Ppoint3 is defined in phigs.h as follows:
.sp .2
.nf
.ta .5i +\w'Pfloat     'u +\w'x;     'u
.sp .2
typedef struct {
.sp .2
	Pfloat	x;	/* x coordinate */
	Pfloat	y;	/* y coordinate */
	Pfloat	z;	/* z coordinate */
.sp .2
} Ppoint3;
.IP
.fi
Ppoint4 is defined in phigs.h as follows:
.sp .2
.nf
.ta .5i +\w'Pfloat     'u +\w'x;     'u
.sp .2
typedef struct {
.sp .2
	Pfloat	x;	/* x coordinate */
	Pfloat	y;	/* y coordinate */
	Pfloat	z;	/* z coordinate */
	Pfloat	w;	/* w coordinate */
.sp .2
} Ppoint4;
.fi
.IP "\fImin, max\fR"
The parameter limits specifying the range over which the curve is to be
evaluated.
.SS Execution
.LP
Depending on the edit mode, a \s-2NON-UNIFORM B-SPLINE CURVE\s+2 element is 
either inserted into the open structure after the element
pointer, or replaces the element pointed at by the element pointer.  The
element pointer is then updated to point to the 
\s-2NON-UNIFORM B-SPLINE CURVE\s+2 structure element.
.LP
The spline order must be greater than zero.
Curves of unsupported order will be displayed by drawing a polyline
connecting the control points.
Curves of order one are drawn as a polymarker using the current polymarker
attributes.
.LP
The knots must form a non-decreasing sequence of numbers.
.LP
The rationality selector parameter may have the enumerated value
\fIRational\fP or \fINon-rational\fP.
When Rational is specified, the control points are specified as 4D
homogeneous modelling coordinates. When Non-rational is specified, 
the control points
are 3D \s-2PHIGS\s+2 modelling coordinates.
.LP
The number of control points must be at least as large as the
order. The number of control points plus the spline order must equal
the number of knots.
.LP
.LP
At structure traversal time, a non-uniform B-spline curve primitive is
drawn using the extended polyline attributes.  
See \s-2SET POLYLINE REPRESENTATION PLUS\s+2 and
\s-2SET CURVE APPROXIMATION CRITERIA\s+2
for more information on display attributes.
.SS Attributes Applied
The attributes listed below are used to display the
\s-2NON-UNIFORM B-SPLINE CURVE\s+2 primitive when the structure is traversed. The Aspect Source 
Flags (\s-2ASF\s+2s) tell where to access the output display attributes. 
These attributes can come directly from the traversal state list,
or they can be accessed indirectly, using the appropriate index 
in the traversal state list and the corresponding bundled 
representation in the PHIGS workstation state list.
.RS
.nf
.ta .5i +\w'back interior reflectance equation   'u 
.sp
polyline colour			polyline colour index \s-2ASF\s+2
linewidth scale factor		linewidth scale factor \s-2ASF\s+2
linetype			linetype \s-2ASF\s+2
polyline shading method		polyline shading method \s-2ASF\s+2
curve approximation criteria	curve approximation criteria \s-2ASF\s+2
polyline index
depth cue index
name set
.fi
.RE
.sp .2
.SH ERRORS
.IP 005
Ignoring function, function requires state (\s-2PHOP, *, STOP, *\s+2)
.IP 600
Ignoring function, not enough control points for specified order
.IP 601
Ignoring function, knot sequence is not non-decreasing
.IP 602
Ignoring function, order is inconsistent with number of knots and control
points specified
.IP 615
Ignoring function, parameter range is inconsistent with knots
.SH SEE ALSO
.nf
.IP
.ta 0.5i
.SM "ADD TRIMMING CURVE (3P+)"
.SM "SET CURVE APPROXIMATION CRITERIA (3P+)"
.SM "INQUIRE CURVE AND SURFACE FACILITIES (3P+)"
.SM "SET POLYLINE REPRESENTATION PLUS (3P+)"
.fi
