Class Bezier
A Bezier curve. Parameterization of the curve is 0 -> 1.
Examples
var a = Vector3.Origin;
var b = new Vector3(5, 0, 1);
var c = new Vector3(5, 5, 2);
var d = new Vector3(0, 5, 3);
var e = new Vector3(0, 0, 4);
var f = new Vector3(5, 0, 5);
var ctrlPts = new List<Vector3> { a, b, c, d, e, f };
var bezier = new Bezier(ctrlPts);
Inherited Members
Namespace: Elements.Geometry
Assembly: Hypar.Elements.dll
Syntax
public class Bezier : BoundedCurve, ICurve, ITransformable<Curve>, IBoundedCurve
Constructors
Bezier(List<Vector3>, FrameType)
Construct a bezier.
Declaration
public Bezier(List<Vector3> controlPoints, FrameType frameType = FrameType.Frenet)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<Vector3> | controlPoints | The control points of the curve. |
FrameType | frameType | The frame type to use when calculating frames. |
Properties
ControlPoints
A collection of points describing the bezier's frame. https://en.wikipedia.org/wiki/B%C3%A9zier_curve
Declaration
public List<Vector3> ControlPoints { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Vector3> |
Domain
The domain of the curve.
Declaration
[JsonIgnore]
public override Domain1d Domain { get; }
Property Value
Type | Description |
---|---|
Domain1d |
Overrides
FrameType
The frame type to use when calculating transforms along the curve.
Declaration
public FrameType FrameType { get; set; }
Property Value
Type | Description |
---|---|
FrameType |
Methods
AccelerationAt(Double)
Get the acceleration of the curve at parameter u.
Declaration
public Vector3 AccelerationAt(double u)
Parameters
Type | Name | Description |
---|---|---|
System.Double | u | A parameter between 0.0 and 1.0. |
Returns
Type | Description |
---|---|
Vector3 |
ArcLength(Double, Double)
Calculate the length of the bezier between start and end parameters.
Declaration
public override double ArcLength(double start, double end)
Parameters
Type | Name | Description |
---|---|---|
System.Double | start | |
System.Double | end |
Returns
Type | Description |
---|---|
System.Double | The length of the bezier between start and end. |
Overrides
BinormalAt(Double)
Get the binormal to the curve at parameter u.
Declaration
public Vector3 BinormalAt(double u)
Parameters
Type | Name | Description |
---|---|---|
System.Double | u | A parameter between 0.0 and 1.0. |
Returns
Type | Description |
---|---|
Vector3 |
Bounds()
Get the bounding box of the curve's control points.
Declaration
public override BBox3 Bounds()
Returns
Type | Description |
---|---|
BBox3 |
Overrides
GetSubdivisionParameters(Double, Double)
Get parameters to be used to find points along the curve for visualization.
Declaration
public override double[] GetSubdivisionParameters(double startSetbackDistance = 0, double endSetbackDistance = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Double | startSetbackDistance | An optional setback from the start of the curve. |
System.Double | endSetbackDistance | An optional setback from the end of the curve. |
Returns
Type | Description |
---|---|
System.Double[] | A collection of parameter values. |
Overrides
Length()
Get a piecewise linear approximation of the length of the curve. https://en.wikipedia.org/wiki/Arc_length
Declaration
public override double Length()
Returns
Type | Description |
---|---|
System.Double |
Overrides
NormalAt(Double)
Get the normal of the curve at parameter u.
Declaration
public Vector3 NormalAt(double u)
Parameters
Type | Name | Description |
---|---|---|
System.Double | u | A parameter between 0.0 and 1.0. |
Returns
Type | Description |
---|---|
Vector3 |
ParameterAtDistanceFromParameter(Double, Double)
Get the parameter at a distance from the start parameter along the curve.
Declaration
public override double ParameterAtDistanceFromParameter(double distance, double start)
Parameters
Type | Name | Description |
---|---|---|
System.Double | distance | The distance from the start parameter. |
System.Double | start | The parameter from which to measure the distance. |
Returns
Type | Description |
---|---|
System.Double |
Overrides
PointAt(Double)
Get the point on the curve at parameter u.
Declaration
public override Vector3 PointAt(double u)
Parameters
Type | Name | Description |
---|---|---|
System.Double | u | The parameter between 0.0 and 1.0. |
Returns
Type | Description |
---|---|
Vector3 |
Overrides
TangentAt(Double)
Get the tangent to the curve at parameter u.
Declaration
public Vector3 TangentAt(double u)
Parameters
Type | Name | Description |
---|---|---|
System.Double | u | A parameter between 0.0 and 1.0. |
Returns
Type | Description |
---|---|
Vector3 |
TransformAt(Double)
Get the transform on the curve at parameter u.
Declaration
public override Transform TransformAt(double u)
Parameters
Type | Name | Description |
---|---|---|
System.Double | u | The parameter along the curve between 0.0 and 1.0. |
Returns
Type | Description |
---|---|
Transform |
Overrides
Transformed(Transform)
Construct a transformed copy of this Curve.
Declaration
public override Curve Transformed(Transform transform)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The transform to apply. |
Returns
Type | Description |
---|---|
Curve |
Overrides
TransformedBezier(Transform)
Construct a transformed copy of this Bezier.
Declaration
public Bezier TransformedBezier(Transform transform)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The transform to apply. |
Returns
Type | Description |
---|---|
Bezier |
VelocityAt(Double)
Get the velocity to the curve at parameter u.
Declaration
public Vector3 VelocityAt(double u)
Parameters
Type | Name | Description |
---|---|---|
System.Double | u | A parameter between 0.0 and 1.0. |
Returns
Type | Description |
---|---|
Vector3 |