Class BSplineCurve<TPoint>
Class defining a generic B-Spline curve.
Namespace: BRIDGES.Geometry.Kernel
Assembly: BRIDGES.dll
Syntax
public class BSplineCurve<TPoint> : object where TPoint : IAddable<TPoint>, IGroupAction<TPoint, double>
Type Parameters
Name | Description |
---|---|
TPoint | Type of point in the geometric space. |
Constructors
| Improve this Doc View SourceBSplineCurve(Int32, IEnumerable<TPoint>)
Initialises a new instance of BSplineCurve<TPoint> class.
Declaration
public BSplineCurve(int degree, IEnumerable<TPoint> controlPoints)
Parameters
Type | Name | Description |
---|---|---|
Int32 | degree | Degree of the interpolating polynomials in the BSpline basis. |
IEnumerable<TPoint> | controlPoints | Control points of the BSplineCurve<TPoint>. |
BSplineCurve(Int32, IEnumerable<Double>, IEnumerable<TPoint>)
Initialises a new instance of BSplineCurve<TPoint> class by defining its fields.
Declaration
public BSplineCurve(int degree, IEnumerable<double> knotVector, IEnumerable<TPoint> controlPoints)
Parameters
Type | Name | Description |
---|---|---|
Int32 | degree | Degree of the interpolating polynomials in the BSpline basis. |
IEnumerable<Double> | knotVector | Knot vector of the interpolating BSpline polynomial basis. |
IEnumerable<TPoint> | controlPoints | Control points of the BSplineCurve<TPoint>. |
Fields
| Improve this Doc View Source_controlPoints
Control points.
Declaration
protected List<TPoint> _controlPoints
Field Value
Type | Description |
---|---|
List<TPoint> |
_knotVector
Knot vector.
Declaration
protected List<double> _knotVector
Field Value
Type | Description |
---|---|
List<Double> |
Properties
| Improve this Doc View SourceDegree
Gets the degree of the interpolating polynomials in the BSpline basis.
Declaration
public int Degree { get; protected set; }
Property Value
Type | Description |
---|---|
Int32 |
DomainEnd
Class defining a generic B-Spline curve.
Declaration
public double DomainEnd { get; }
Property Value
Type | Description |
---|---|
Double |
DomainStart
Class defining a generic B-Spline curve.
Declaration
public double DomainStart { get; }
Property Value
Type | Description |
---|---|
Double |
EndPoint
Class defining a generic B-Spline curve.
Declaration
public TPoint EndPoint { get; }
Property Value
Type | Description |
---|---|
TPoint |
IsClosed
Class defining a generic B-Spline curve.
Declaration
public bool IsClosed { get; }
Property Value
Type | Description |
---|---|
Boolean |
KnotCount
Number of knots of the interpolating BSpline polynomial basis.
Declaration
public int KnotCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
PointCount
Gets the number of control points of the curve.
Declaration
public int PointCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
StartPoint
Class defining a generic B-Spline curve.
Declaration
public TPoint StartPoint { get; }
Property Value
Type | Description |
---|---|
TPoint |
Methods
| Improve this Doc View SourceControlPoint(Int32)
Returns the control point at the given index.
Declaration
public TPoint ControlPoint(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the control point to look return. |
Returns
Type | Description |
---|---|
TPoint | The control point at the given index. |
Flip()
Class defining a generic B-Spline curve.
Declaration
public void Flip()
Knot(Int32)
Returns the knot at the given index.
Declaration
public double Knot(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the knot to look for. |
Returns
Type | Description |
---|---|
Double | The knot at the given index. |
Length()
Class defining a generic B-Spline curve.
Declaration
public double Length()
Returns
Type | Description |
---|---|
Double |
PointAt(Double, CurveParameterFormat)
Class defining a generic B-Spline curve.
Declaration
public TPoint PointAt(double parameter, CurveParameterFormat format)
Parameters
Type | Name | Description |
---|---|---|
Double | parameter | |
CurveParameterFormat | format |
Returns
Type | Description |
---|---|
TPoint |
SetControlPoints(IEnumerable<TPoint>)
Sets the control points of the current BSplineCurve<TPoint>.
Declaration
protected void SetControlPoints(IEnumerable<TPoint> controlPoints)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TPoint> | controlPoints | Control points of the BSplineCurve<TPoint>. |
SetKnotVector(IEnumerable<Double>)
Sets the knot vector of the current BSplineCurve<TPoint> while ensuring its validity.
Declaration
protected void SetKnotVector(IEnumerable<double> knotVector)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Double> | knotVector | Knot vector to set. |
SetUniformKnotVector(Double, Double, Int32, Int32)
Creates and sets the knot vector for the current BSplineCurve<TPoint> with a uniform middle part.
Declaration
protected void SetUniformKnotVector(double domainStart, double domainEnd, int degree, int knotCount)
Parameters
Type | Name | Description |
---|---|---|
Double | domainStart | Start value of the curve domain. |
Double | domainEnd | End value of the curve domain. |
Int32 | degree | Degree of the interpolating polynomials in the BSpline basis. |
Int32 | knotCount | Number of knots of the interpolating BSpline polynomial basis. |