Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

NON-UNIFORM B-SPLINE CURVE(3P+)  —  Kubota Pacfic Computer Inc. (29 February 1991)

NAME

NON-UNIFORM B-SPLINE CURVE − create a non-uniform B-spline curve structure element

SYNOPSIS

C Syntax

void
pnuni_bsp_curv (order, knots, rationality, cpoints, min, max)
Pintorder;spline order
Pfloat_list∗knots;list of knots
Prationalrationality;rationality specifier
Ppoint_list34∗cpoints;list of 3D or 4D control points
Pfloatmin, max;parameter range

Required PHIGS Operating States

(PHOP, ∗, STOP, ∗)

DESCRIPTION

Purpose

NON-UNIFORM B-SPLINE CURVE creates a structure element containing the definition of a non-uniform B-spline curve.  The curve may be rational or non-rational. 

C Input Parameters

orderThe order of the curve.  The degree of the curve’s basic functions is one less than order. 

knotsA 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:

typedef struct {
Pintnum_floats;/∗ number of Pfloats in list ∗/
Pfloat∗floats;/∗ list of floats ∗/
} Pfloat_list;

rationality
The rationality of the curve.  Prational is defined in phigs.h as follows:

typedef enum {
PNON_RATIONAL = 0,
PRATIONAL = 1
} Prational;

cpoints
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:

typedef struct {/∗ list of 3D or 4D points ∗/
Pintnum_points;/∗ number of control points ∗/
union {
Ppoint3∗point3d;/∗ array of 3D points ∗/
Ppoint4∗point4d;/∗ array of 4D points ∗/
} points;
} Ppoint_list34;

The point4d member of the points union is used if rationality is PRATIONAL; otherwise, the point3d member is used. 

Ppoint3 is defined in phigs.h as follows:

typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
Pfloatz;/∗ z coordinate ∗/
} Ppoint3;

Ppoint4 is defined in phigs.h as follows:

typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
Pfloatz;/∗ z coordinate ∗/
Pfloatw; /∗ w coordinate ∗/
} Ppoint4;

min, max
The parameter limits specifying the range over which the curve is to be evaluated.

Execution

Depending on the edit mode, a NON-UNIFORM B-SPLINE CURVE 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 NON-UNIFORM B-SPLINE CURVE structure element. 

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. 

The knots must form a non-decreasing sequence of numbers. 

The rationality selector parameter may have the enumerated value Rational or Non-rational.  When Rational is specified, the control points are specified as 4D homogeneous modelling coordinates. When Non-rational is specified, the control points are 3D PHIGS modelling coordinates. 

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. 

At structure traversal time, a non-uniform B-spline curve primitive is drawn using the extended polyline attributes.  See SET POLYLINE REPRESENTATION PLUS and SET CURVE APPROXIMATION CRITERIA for more information on display attributes. 

Attributes Applied

The attributes listed below are used to display the NON-UNIFORM B-SPLINE CURVE primitive when the structure is traversed. The Aspect Source Flags (ASFs) 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. 

polyline colourpolyline colour index ASF
linewidth scale factorlinewidth scale factor ASF
linetypelinetype ASF
polyline shading methodpolyline shading method ASF
curve approximation criteriacurve approximation criteria ASF
polyline index
depth cue index
name set

ERRORS

005Ignoring function, function requires state (PHOP, ∗, STOP, ∗)

600Ignoring function, not enough control points for specified order

601Ignoring function, knot sequence is not non-decreasing

602Ignoring function, order is inconsistent with number of knots and control points specified

615Ignoring function, parameter range is inconsistent with knots

SEE ALSO

ADD TRIMMING CURVE (3P+)
SET CURVE APPROXIMATION CRITERIA (3P+)
INQUIRE CURVE AND SURFACE FACILITIES (3P+)
SET POLYLINE REPRESENTATION PLUS (3P+)

September 02, 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026