Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pnunibspcurv(3P+) — PHIGS 1.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

NON-UNIFORM B-SPLINE CURVE(3P+)  —  MISC. REFERENCE MANUAL PAGES

NAME

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

SYNOPSIS

C Syntax

void
pnunibspcurv (order, knots, rationality, ctlpoints, min, max)
Pintorder;spline order
Pfloatlst∗knots;list of knots
Prationalrationality;rationality specifier
Ppointlst34∗ctlpoints;list of 3D or 4D control points
Pfloatmin, max;parameter range

FORTRAN Syntax

SUBROUTINE pnubsc (ORDER, NKNOTS, KNOTS, RATSEL, NCPTS, CPTS, MIN, MAX)
INTEGERORDERspline order
INTEGERNKNOTSnumber of knots
REALKNOTS(NKNOTS)list of knots
INTEGERRATSELrationality specifier (PRAT, PNRAT)
INTEGERNCPTSnumber of control points
REALCPTS(4,NCPTS)control points (MC)
REALMIN, MAXparameter 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. 

This is a SunPHIGS Extension function based on PHIGS+ and is not part of the PHIGS standard. 

C Input Parameters

All of the following data types are defined in phigs.h. 

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

knotsA pointer to a Pfloatlst structure containing a non-decreasing sequence of real numbers specifying the curve’s knot vector.  Pfloatlst is defined as:

typedef struct {
Pintnumber;/∗ number of Pfloats in list ∗/
Pfloat∗floats;/∗ list of floats ∗/
} Pfloatlst;

rationality
The rationality of the curve. Prational is defined as:

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

ctlpoints
A pointer to a Ppointlst34 structure containing the list of the curve’s control points.  The points are specified in Modelling Coordinates. Ppointlst34 is defined as:

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

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

Ppoint3 is defined as:

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

Ppoint4 is defined as:

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.

FORTRAN Input Parameters

All of the following data types are predefined in phigs77.h. 

ORDER
The order of the curve.  The degree of the curve’s basis functions is one less than ORDER . 

NKNOTS
The number of knots in the curve’s knot vector.

KNOTS(NKNOTS)
An array containing a non-decreasing sequence of real numbers specifying the curve’s knot vector.

RATSEL
An integer specifying the rationality and hence the dimensionality of the control points.  Valid values are defined as:

PRAT  Rational
PNRAT  Non-rational

NCPTS
The number of control points.

CPTS(4,NCPTS)
The x, y, z, and w coordinates of the curve’s control points.  The points are specified in Modelling Coordinates and correspond to the array positions as follows:

CPTS(1,∗) = x Coordinate
CPTS(2,∗) = y Coordinate
CPTS(3,∗) = z Coordinate
CPTS(4,∗) = w Coordinate

The w coordinates are not used if the rationality is PNRAT. 

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. 

The parameter range values, min and max, specify over what range the curve is evaluated. The value min must be less than max and greater than or equal to the order-th knot value.  The value max must be less than or equal to the (k+1-order)-th knot value, where k is the number of knots. 

At structure traversal time, a non-uniform B-spline curve primitive is drawn using the extended polyline attributes.  The curve approximation criteria is applied between min and max.  See SET EXTENDED POLYLINE REPRESENTATION 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 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 EXTENDED POLYLINE REPRESENTATION (3P+)
INTRO PHIGS+ (3P+)

Sun Release 4.0  —  Last change: 2 August 1989

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