Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ spline(3G) — HP-UX 5.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

knot_vectors(3G)

curve_resolution(3G)

vertex_format(3G)

SPLINE(3G)

NAME

draw a space curve or surface. 

SYNOPSIS

C Syntax:

void spline_curve2d (fildes,plist,numpts,order,rational);
int fildes, numpts, order, rational;
float plist[];

void spline_curve3d (fildes,plist,numpts,order,rational);
int fildes, numpts, order, rational;
float plist[];

void spline_surface(fildes,plist,numpts_u,numpts_v,order_u,order_v,rational);
int fildes, numpts_u, numpts_v, order_u, order_v,,
float plist[];

FORTRAN77 Syntax:

subroutine spline_curve2d(fildes,plist,numpts,order,rational)
integer*4 fildes, numpts, order, rational
real plist (numpts*3)

subroutine spline_curve3d(fildes,plist,numpts,order,rational)
integer*4 fildes, numpts, order, rational
real plist (numpts*3)

subroutine spline_surface (fildes,plist,numpts_u,numpts_v,
order_u,order_v,rational)
integer*4 fildes, numpts_u, numpts_v, order_u, order_v,
real plist (numpts_u*numpts_v*3)

Pascal Syntax:

procedure spline_curve2d(fildes:integer;
var plist array [lo..hi:integer] of real;
numpts, order, rational:integer);

procedure spline_curve3d(fildes:integer;
var plist array [lo..hi:integer] of real;
numpts, order, rational:integer);

procedure spline_surface(fildes:integer;
var plist array[lo..hi:integer] of real;
numpts_u, numpts_v, order_u, order_v, rational:integer);

DESCRIPTION

Input Parameters

fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened. 

numpts Number of points in the plist array

numpts_u,numpts_v Number of points along each axis in the plist array

plist Array of spline control points

order, order_u, order_v
space curve or surface order:
LINEAR = 2, QUADRATIC = 3, CUBIC = 4

rational Specifies whether the spline is RATIONAL (1) or NONRATIONAL (0)

Discussion

spline_curve draws a spline curve of the specified order, using the points in the plist array as control points and the current interpolation matrices specified by the u knot vector.  The curve is drawn using the current polyline attributes. 

spline_surface draws a spline surface of the specified orders, using the points in the plist array as control points and the current interpolation matrices specified by the u and v knot vectors.  Use curve_resolution to set the size of polylines or polygons that make up the curve or surface. 

The data in the plist array is two dimensional coordinate data (x,y), or (x,y,h) for spline_curve2d, three dimensional (x,y,z) or (x,y,z,h) for spline_curve3d, and three dimensional (x,y,z) or (x,y,z,h) for spline_surface where h is the rational coordinate.  The spline_surface data is ordered first along the u-axis and then along the v-axis; that is, the individual rows of the plist array are assummed to contain the data to be interpolated for a constant v value. 

The current vertex_format affects spline surface generation.  If coord = 3, use = 3, and rgb = FALSE (normals per vertex), spline surface generation generates normals per vertex and performs smooth (Gouraud) shading.  Constant (faceted) shading is used for spline surfaces in all other cases.  The direction of these normals is effected by the clockwise parameter of vertex_format.  If counter clockwise polygons are specified then the normals are calculated as the u-derivative cross the v-derivative.  If clockwise polygons are specified then the normals are calculated as the v-deriative cross the u-derivative.  Spline surfaces also use the current interior_style, so interior_style must be set to INT_SOLID for any shading to occur. 

Surfaces that degenerate to a line or point are illegal if normals per vertex are specified in vertex_format. Surfaces do not update the current position.  Curves update the current position to the last point on the curve.

SEE ALSO

knot_vectors(3G), curve_resolution(3G), vertex_format(3G),
Starbase Graphics Techniques.

Hewlett-Packard Company  —  May 11, 2021

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