
306 Chapter 16 Composite Surfaces
16.10 Implementation
The routines in this section are written for rational surfaces. By setting all weights
equal to one, the standard piecewise polynomial case is recovered.
The routine that converts a rational bicubic B-spline control net into the
piecewise bicubic Bezier form:
void ratbspl_to_bez_surf(bspl_x,bspl_y,bspl_w,lu,lv,knot_u,
knot_v,bez_x,bez_y,bez_w,dux_x,aux_y,aux_w)
/*
Converts B-spline control
net
into piecewise
Bezier control
net
(bicubic).
Input: bspl_x,bspl_y: B-spline control
net
(one coordinate only)
bspl_w: B-spline weights
lu,lv: no.
of
intervals
in u-
and
v-directi on
knot_u, knot_v: knot vectors
in u-
and
v-directi on
Output: bez_x,bez_y: piecewise bicubic Bezier net.
bez_w: Bezier weights.
Work space:aux_x,aux_y,aux_w: needed
to
store intermediate results.
Remark:
The
piecewise Bezier
net
only stores each control point once,
i.e., neighboring patches share
the
same boundary.
Knots
are
simple (but,
in
the
language
of
Chapter 10,
the
boundary knots have multiplicity
three).
V
Once the piecewise rational Bezier representation of a bicubic spline surface
is achieved, the following routine plots the whole surface:
void piot_ratbez_surfaces(bez_x,bez_y,bez_w,1u,1v,u_points,v_points,
seale_x,scale_y,val ue)
/* Plots piecewise cubic surface,
i.e.,
generates postscript output
Input: bez_x, bez_y: control nets
lu,lv:
no. of
segments
in u- and v-
direction
u_points,v_points:
per
patch: v_points many
isoparametric curves with
u_points
points
on
each
value:
minmax
box of all
control nets,
seale_x,seale_y: scale factors
for
postscript
V
Tensor product spline interpolation (bicubic) is carried out by the following
routine. It uses Bessel end conditions.