Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pnunibspsurf(3P+) — PHIGS 1.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

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

NAME

NON-UNIFORM B-SPLINE SURFACE − create a non-uniform B-spline surface structure element

SYNOPSIS

C Syntax

pnunibspsurf ( uorder, vorder, uknots, vknots, rationality, grid, range, nloops, tloops )
Pintuorder;u spline order
Pintvorder;v spline order
Pfloatlst∗uknots;u knots
Pfloatlst∗vknots;v knots
Prationalrationality;rationality selector
Ppointgrid34∗grid;grid of 3D or 4D control points
Ppcslimit∗range;{u, v} parameter range
Pintnloops;number of trim curve loops
Ptrimcurvelst∗tloops;trim curve loops

FORTRAN Syntax

SUBROUTINE pnubss ( UORDER, VORDER, NUKNTS, NVKNTS, UKNOTS, VKNOTS, RATSEL,
     NUCPTS, NVCPTS, DIMU, USTART, VSTART, CPTS, URANGE, VRANGE, NLOOPS, LOOPS,
     VIS, ORDER, TRATS, NTKNTS, TKSTRT, TKNOTS, NTCPTS, TCSTRT, TCPTS, TMIN, TMAX)
INTEGERUORDERorder in u dimension
INTEGERVORDERorder in v dimension
INTEGERNUKNTSnumber of knots in u dimension
INTEGERNVKNTSnumber of knots in v dimension
REALUKNOTS(NUKNTS) knots in u dimension
REALVKNOTS(NVKNTS) knots in v dimension
INTEGERRATSELsurface rationality
INTEGERNUCPTSnumber of ctrl points in u dimension
INTEGERNVCPTSnumber of ctrl points in v dimension
INTEGERDIMUu dimension of control points array
INTEGERUSTART, VSTARTindices of control point’s start location
REALCPTS(4, DIMU, ∗)control points
REALURANGE(2)u dimension limits
REALVRANGE(2)v dimension limits
INTEGERNLOOPSnumber of trim loops
INTEGERLOOPS(NLOOPS)number of trim curves in each loop
INTEGERVIS(nt)visibility flags for all trim curves
INTEGERORDER(nt)curve orders for all trim curves
INTEGERTRATS(nt)curve types for all trim curves
INTEGERNTKNTS(nt)number of knots in each curve
INTEGERTKSTRT(nt)start indices of knot lists in TKNOTS
REALTKNOTS(∗)knots, for all trim curves
INTEGERNTCPTS(nt)number of ctrl points in each curve
INTEGERTCSTRT(nt)start indices of control point lists in TCPTS
REALTCPTS(3, ∗)control points, for all trim curves
REALTMIN(nt), TMAX(nt) parameter limits for all trim curves
Note: In the array dimensions above, nt means the total number of trim curves.

Required PHIGS Operating States

(PHOP, ∗, STOP, ∗)

DESCRIPTION

Purpose

NON-UNIFORM B-SPLINE SURFACE creates a structure element containing the definition of a non-uniform B-spline surface. 

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 predefined in phigs.h. 

uorder, vorder
Order of the surface in the u and v dimensions, respectively. 

uknots, vknots
Pointers to Pfloatlst structures listing the knots for the u and v dimensions of the surface.  Pfloatlst is defined as:

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

rationality
Prational is defined as:

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

gridPointer to a Ppointgrid34 structure containing the surface control points.  Ppointgrid34 is defined as:

typedef struct { /∗ grid of 3D or 4D points, [u_dim] [v_dim] ∗/
    Ppcsdimnumber;/∗ number of points in each dimension ∗/
    union {
Ppoint3∗point3d;/∗ array of 3D points ∗/
Ppoint4∗point4d;/∗ array of 4D points ∗/
    } points;
} Ppointgrid34;

Ppcsdim is defined as:

typedef struct {
Pintu_dim;/∗ dimension (number of divisions) along u ∗/
Pintv_dim;/∗ dimension (number of divisions) along v ∗/
} Ppcsdim;

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;

rangePointer to a Ppcslimit structure containing the u and v parameter limits for the surface. Ppcslimit is defined as:

typedef struct {
Pfloatumin;/∗ u min ∗/
Pfloatumax;/∗ u max ∗/
Pfloatvmin;/∗ v min ∗/
Pfloatvmax;/∗ v max ∗/
} Ppcslimit;

nloopsNumber of trimming curve loops. 

tloopsPointer to an array of Ptrimcurvelst structures that specify the trimming curve loops. Each of these structures contains the specification of an individual trimming curve loop (set of trimming curves).  Ptrimcurvelst is defined as:

typedef struct {
Pintnumber;/∗ number of trimming curves in list ∗/
Ptrimcurve∗curves;/∗ list of curves ∗/
} Ptrimcurvelst;

Ptrimcurve is defined as:

typedef struct {
Pvisibilityvisible;/∗ curve visibility flag ∗/
Prationalrationality;/∗ rationality ∗/
Pintorder;/∗ curve order ∗/
Pfloatlstknots;/∗ curve knot vector ∗/
Pfloattmin, tmax;/∗ curve parameter range ∗/
Ppointlst23cpts;/∗ control points ∗/
} Ptrimcurve;

Pvisibility is defined as:

typedef enum {
POFF,
PON
} Pvisibility;

Prational is defined as:

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

Pfloatlst is defined as:

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

Ppointlst23 is defined as:

typedef struct { /∗ list of 2D or 3D points ∗/
Pintnumber;/∗ number of points ∗/
union {
Ppoint∗point2d;/∗ array of 2D points ∗/
Ppoint3∗point3d;/∗ array of 3D points ∗/
} points;
} Ppointlst23;

The point3d member of the points union is used if the rationality member of Ptrimcurve is PRATIONAL; otherwise, the point2d member is used.  Ppoint is defined as:

typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
} Ppoint;

Ppoint3 is defined as:

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

FORTRAN Input Parameters

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

UORDER, VORDER
Order of the surface in the u and v dimensions, respectively. 

NUKNTS, NVKNTS
Number of knots in the u and v dimensions, respectively. 

UKNOTS(NUKNTS)
Array of knots for the u dimension. 

VKNOTS(NVKNTS)
Array of knots for the v dimension. 

RATSEL
Surface rationality is either Rational or Non-rational.  This integer specifies the rationality and hence the dimensionality of the control points.  Valid values defined are:

PRATRational
PNRATNon-rational

NUCPTS, NVCPTS
Number of control points in the u and v dimensions, respectively. 

DIMUThe declared second dimension of the three-dimensional control points array, CPTS . 

USTART, VSTART
The u and v indices of the first array element used in the control points array; e.g., CPTS(1, USTART, VSTART) is the x coordinate of the first control point of the surface.  This allows the use of a sub-array of the CPTS. 

CPTS(4, DIMU, ∗)
Array of control points.  The point coordinates are stored as:

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

The w coordinate is not used if the surface is Non-rational; i.e., RATSEL = PNRAT. 

URANGE(2)
Parameter limits in the u dimension.  URANGE(1) is umin, URANGE(2) is umax. 

VRANGE(2)
Parameter limits in the v dimension.  VRANGE(1) is vmin, VRANGE(2) is vmax. 

NLOOPS
Number of trimming curve loops.

LOOPS(NLOOPS)
Number of trimming curves in each loop.

Note: In the array dimensions below, nt means the total number of trim curves. 

VIS(nt)
Array of visibility flags, one entry for each trimming curve.

ORDER(nt)
Array of curve orders, one entry for each trimming curve.

TRATS(nt)
Array of trimming curve rationalities, one entry for each trimming curve. Each entry is an integer specifying the rationality and hence the dimensionality of the control points.  Valid values defined are:

PRAT  Rational
PNRAT  Non-rational

NTKNTS(nt)
Number of knots in each curve, one entry for each trimming curve.

TKSTRT(nt)
Start positions of the knot lists in the array TKNOTS, one entry for each trimming curve. 

TKNOTS(∗)
Array of knots for all trimming curves. Each curve uses a contiguous segment of the array.  The index of the head of the array segment used by a curve is specified in the TKSTRT array. 

NTCPTS(nt)
Number of control points in each curve, one entry for each trimming curve.

TCSTRT(nt)
Start positions of the control point lists in the array TCPTS , one entry for each trimming curve. 

TCPTS(3, ∗)
Array of control points for all trimming curves. Each curve uses a contiguous segment of the array.  The index of the head of the array segment used by a curve is specified in the TCSTRT array.  The point coordinates are stored in each column of the array as:

TCPTS(1, t) = u Coordinate
TCPTS(2, t) = v Coordinate
TCPTS(3, t) = w Coordinate

The w coordinate is not used if the curve is Non-rational; i.e., TRATS(t) = PNRAT. 

TMIN(nt), TMAX(nt)
Arrays of parameter limits for the trimming curves, one entry in each array for each trimming curve.

Execution

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

The surface u and v orders must be positive integers.  Surfaces of unsupported orders in either dimension will be displayed by drawing the control grid; i.e., the corresponding surface of order 2 in both dimensions. 

The u and v knots must each 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 must be specified as 4D homogeneous modelling coordinates. When Non-rational is specified, the control points are 3D PHIGS modelling coordinates. 

The number of control points in the u and v directions must be at least as large as the corresponding order.  The number of control points in each direction plus the corresponding spline order must be equal to the corresponding number of knots. 

The parameter range values (umin, umax, vmin, and vmax) specify over what range the B-spline surface is evaluated. Each min must be less than its corresponding max and greater than, or equal to, the corresponding order-th knot value.  Each max must be less than, or equal to, the corresponding (k+1-order)-th knot value, where k is the number of knots.  When trimming curves are not specified (see below), the edges of the surface are at the parameter range values and edges are rendered there, subject to the value of the edge flag attribute. 

At structure traversal time, a NON-UNIFORM B-SPLINE SURFACE primitive is drawn using the attributes that apply to FILL AREA SET 3 primitives, plus the extended interior attributes.  See SET EXTENDED INTERIOR REPRESENTATION for a listing of these. 

Trimming Curves

The surface parameter area to be rendered may be defined by trimming curves.  Trimming curves override the specified surface parameter range values and the parameter range values are ignored during traversal if trimming curves are specified. 

The trimming definition of a surface consists of a list of loops.  Each of these loops is a list of one or more trimming curves. Each trimming curve is a non-uniform rational B-spline curve defined in the 2D parameter space of the surface.  The curves of a loop connect in a head to tail fashion. Each loop must be explicitly closed.  Closure is assumed and not checked. 

The restrictions on trimming curves are the same as those for non-uniform B-spline curves, and are specified in the function NON-UNIFORM B-SPLINE CURVE.  Only the trimming curve’s control polygon will be used when it is of unsupported order or of order 1. 

Trimming loops may not go outside the parameter space of the surface. The trimming curves associated with a surface may touch each other only at their end points. No other pair of trimming curves may connect at that same point. A trimming curve may not be self-touching or self-intersecting. 

If trimming curves are specified, then they define the edges of the surface.  Each trimming curve has a flag that controls its visibility.  These visibility flags have lower precedence than the edge flag attribute and are ignored if the edge flag attribute is set to OFF. 

SunPHIGS Extensions restricts trimming loops of a single surface primitive to a certain canonical form. This form must redundantly identify the interior parameter area in two different ways: according to the odd winding and the curve handedness rules. 

Attributes Applied

The attributes listed below are used to display the NON-UNIFORM B-SPLINE SURFACE 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. 

interior colourinterior colour index ASF
back interior colourback interior colour ASF
interior styleinterior style ASF
back interior styleback interior style ASF
interior style indexinterior style index ASF
back interior style indexback interior style index ASF
interior shading methodinterior shading method ASF
back interior shading methodback interior shading method ASF
interior reflectance equation interior reflectance equation ASF
back interior reflectance equationback interior reflectance equation ASF
area propertiesarea properties ASF
back area propertiesback area properties ASF
interior index
edge colouredge colour index ASF
edge flagedge flag ASF
edgetypeedgetype ASF
edgewidth scale factoredgewidth scale factor ASF
surface approximation criteriasurface approximation criteria ASF
trimming curve approximation criteriatrimming curve approximation criteria ASF
edge index
face distinguishing mode
face culling mode
depth cue index
light source state
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

SET SURFACE APPROXIMATION CRITERIA (3P+)
SET TRIMMING CURVE APPROXIMATION CRITERIA (3P+)
NON-UNIFORM B-SPLINE CURVE (3P+)
SET EXTENDED INTERIOR REPRESENTATION (3P+)
INQUIRE CURVE AND SURFACE FACILITIES (3P+)
INTRO PHIGS+ (3P+)

Sun Release 4.0  —  Last change: 2 August 1989

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