BSpline
In the BCurve2D and BCurve3D classes the control points are used to shape the curve and the only points guarenteed to be on the curve are the first and the last control point. The BPline class differes in that the generated curve passes through all the control points. This picture shows a BSpline curve created from 10 control ponts.
BSpline does this by creating additional control points so that the curve between any 2 consectutive vertices is a cubic Bezier curve and the transition between them is smooth.
For best results concentrate the vertices in areas where you want sharp turns. Generally the more vertices the better the result.
Creating the Bezier spline
Constructors | |
---|---|
|
|
Parameter | Comments |
|
array of PVectors defining the vertices the spline must pass through. |
|
the number of slices along the length of the path |
|
this is used to reduce the amount of twist along the length of the shape. If this parameter is omitted Shapes3D will try and find the best value. Alternatively you can specify 1 of 4 possible values - S3D.ORTHO_X, S3D.ORTHO_Y, S3D.ORTHO_Z or S3D.ORTHO_A. |