BSpline Class |
public class BSpline
The BSpline type exposes the following members.
Name | Description | |
---|---|---|
BSpline(IListPoint3D) | Constructor | |
BSpline(IListPoint3D, IListDouble) | Constructor | |
BSpline(IListPoint3D, Int32) | Constructor | |
BSpline(IListPoint3D, IListDouble, Int32) | Constructor |
Name | Description | |
---|---|---|
ControlPoints | Gets s list of control points. | |
CurveDegree | Gets a degree of the curve (see definition of the B-spline on the internet for more info). Default value is 3. | |
Weights | Gets s list of weights. |
Name | Description | |
---|---|---|
CreateBSpline(Int32) | Returns a Point3DCollection that defines the B-spline based on the controlPoints (defined with the constructor) and positionsPerSegment. | |
CreateBSpline(IListPoint3D, Int32) | Returns a Point3DCollection that defines the B-spline based on the controlPoints and positionsPerSegment. | |
CreateNURBSCurve(Int32) | Returns a Point3DCollection that defines the NURBS curve based on the controlPoints and weights (defined with the constructor) and positionsPerSegment. | |
CreateNURBSCurve(IListPoint3D, IListDouble, Int32) | Returns a Point3DCollection that defines the NURBS curve (Non-uniform rational B-spline) based on the controlPoints, weights and positionsPerSegment. | |
GetPositionOnBSpline | Returns a Point3D that lies on the B-spline based on the controlPoints (defined with the constructor) and t. The t argument can have any value from 0 to 1; 0 meaning the first control point and 1 meaning the last control point. | |
GetPositionOnNURBSCurve | Returns a Point3D that lies on the NURBS curve based on the controlPoints and weights (defined with the constructor) and t. The t argument can have any value from 0 to 1; 0 meaning the first control point and 1 meaning the last control point. |
B-spline is a curve that is defined by control points.
It is also possible to create NURBS curve (Non-uniform rational B-spline). The difference between normal B-spline and NURBS curve is that NURBS curve uses weighted control points. For example if all the control points have weight of 1, and the 3rd control point have weight 5, the curve will go closer to the 3rd control point (making it more important). It is also possible to make the weight 0.5 - this would make the control point less important so the curve would go farther away from that control point.
B-spline does not create the curve that goes through control point but only goes from the first to the last control points. Other control points are used to define the shape of the curve. To create a curve that goes through all control points (Bezier curve) use the BezierCurve class.
To make the curve smooth, more points are created between two control points. The number of additional points is defined by positionsPerSegment number.
The easiest way to create the curve is to use the static CreateBSpline(IListPoint3D, Int32) or CreateNURBSCurve(IListPoint3D, IListDouble, Int32) methods. Both methods return Point3DCollection that define the curve.
For advanced usage it is possible to create an instance of the BSpline class. This enables calling GetPositionOnBSpline(Double) method than can return any position on the curve defined by the t parameter. The t parameter can have any value from 0 to 1; 0 meaning the first control point and 1 meaning the last control point.