Click or drag to resize
AB4D logo

BSpline Class

BSpline class is used to create a 3D B-spline.
Inheritance Hierarchy
SystemObject
  Ab3d.UtilitiesBSpline

Namespace:  Ab3d.Utilities
Assembly:  Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 10.0.8000.1045
Syntax
C#
public class BSpline

The BSpline type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyControlPoints
Gets s list of control points.
Public propertyCurveDegree
Gets a degree of the curve (see definition of the B-spline on the internet for more info). Default value is 3.
Public propertyWeights
Gets s list of weights.
Top
Methods
  NameDescription
Public methodCreateBSpline(Int32)
Returns a Point3DCollection that defines the B-spline based on the controlPoints (defined with the constructor) and positionsPerSegment.
Public methodStatic memberCreateBSpline(IListPoint3D, Int32)
Returns a Point3DCollection that defines the B-spline based on the controlPoints and positionsPerSegment.
Public methodCreateNURBSCurve(Int32)
Returns a Point3DCollection that defines the NURBS curve based on the controlPoints and weights (defined with the constructor) and positionsPerSegment.
Public methodStatic memberCreateNURBSCurve(IListPoint3D, IListDouble, Int32)
Returns a Point3DCollection that defines the NURBS curve (Non-uniform rational B-spline) based on the controlPoints, weights and positionsPerSegment.
Public methodGetPositionOnBSpline
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.
Public methodGetPositionOnNURBSCurve
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.
Top
Remarks

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.

See Also