|
|
I have written a macro to facilitate the creation of Bézier curves. It
will be included in the SphereSweep module in the Object Collection.
Below is the proposed text of its documentation, with an accompanying
illustration. I would appreciate feedback on how clearly it explains
the macro.
Due to a glitch in the NNTP-to-HTTP conversion, you may see some funny
characters in the word "Bézier" if you are using the Web view. They are
supposed to be an e with an acute accent. Don't worry about those; they
will appear correctly in the user manual (unless you are using an
obsolete Web browser that doesn't understand the HTML 5 character
encoding directive).
_________________________________________________
Macro SSwp_Bezier (v_Ctrls, s_File, VDim, Places)
As a convenience for facilitating continuity between Bézier spline
segments, this macro accepts a set of points and vectors, and
converts them to an array of Bézier control points. The returned
array may be passed directly to a SphereSweep object macro; or its
elements may be used to construct a lathe or prism primitive.
Optionally, the points may be written to a file.
The set of points and vectors is an n x 3 array, where n is the
number of distinct points through which the spline passes. (For this
array, the last point of a Bézier segment and the first point of the
next segment are considered to be the same point.) Each element
[][1] is a point through which the spline passes. Elements [][0] and
[][2] are vectors pointing to the previous and next intermediate
control points, respectively, in the spline. (The spline does not
typically pass through the intermediate control points.) By making
these vectors collinear, while pointing in opposite directions,
smooth transitions may be maintained between spline segments.
Elements [0][0] and [n - 1][2] are ignored.
The illustration shows an example of how this array translates to
the final set of control points.
Arguments
v_Ctrls:
The array of points and vectors. This argument is input only and
is not altered.
s_File:
The name of a file to which to write the output array. Use "-"
(hyphen) to write to the debug stream or "" (the null string) for
no written output.
VDim:
The dimension size of the points to be written to the file
Places:
The number of decimal places to be written
Post a reply to this message
Attachments:
Download 'spheresweep_bezier.png' (21 KB)
Preview of image 'spheresweep_bezier.png'
|
|