BezierCurve

References
Represents a Bezier curve.

Note: as an exception, the bezier curve is not derived from Curve.

Constructors

BezierCurve

#Since v5.0
Create bezier curve with controls defined by a list of 2d points
public BezierCurve(
controlPoints
)

BezierCurve

#Since v5.0
Create bezier curve with controls defined by a list of 3d points
public BezierCurve(
controlPoints
)

BezierCurve

#Since v5.0
Create bezier curve with controls defined by a list of 4d points
public BezierCurve(
controlPoints
)

BezierCurve

#
Protected constructor for internal use.
protected BezierCurve(
info,
Serialization data.
context
Serialization stream.
)

Finalizer

~BezierCurve

#
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
~BezierCurve()

Properties

ControlVertexCount

#Since v5.0
Number of control vertices in this curve
public int ControlVertexCount { get; }

Dimension

#Since v6.3
Dimension of Bezier
public int Dimension { get; }

IsRational

#Since v5.0
Gets a value indicating whether or not the curve is rational. Rational curves have control-points with custom weights.
public bool IsRational { get; }

IsValid

#Since v5.0
Tests an object to see if it is valid.
public bool IsValid { get; }

Methods

ChangeDimension

#Since v5.0
Change dimension of bezier.
public bool ChangeDimension(
desiredDimension
)
true if successful. false if desired_dimension < 1

CreateBeziers

#Since v6.0
Create an array of Bezier curves that fit to an existing curve. Please note, these Beziers can be of any order and may be rational.
public static BezierCurve[] CreateBeziers(
sourceCurve
The curve to fit Beziers to
)
A new array of Bezier curves

CreateCubicBeziers

#Since v5.0
Constructs an array of cubic, non-rational Beziers that fit a curve to a tolerance.
public static BezierCurve[] CreateCubicBeziers(
sourceCurve,
A curve to approximate.
distanceTolerance,
The max fitting error. Use RhinoMath.SqrtEpsilon as a minimum.
kinkTolerance
If the input curve has a g1-discontinuity with angle radian measure greater than kinkTolerance at some point P, the list of beziers will also have a kink at P.
)
A new array of bezier curves. The array can be empty and might contain null items.

CreateLoftedBezier

#Since v5.0
Loft a bezier through a list of points
public static BezierCurve CreateLoftedBezier(
points
2 or more points to interpolate
)
new bezier curve if successful

CreateLoftedBezier

#Since v5.0
Loft a bezier through a list of points
public static BezierCurve CreateLoftedBezier(
points
2 or more points to interpolate
)
new bezier curve if successful

CurvatureAt

#Since v5.0
Evaluate the curvature vector at a curve parameter.
[ConstOperation] public Vector3d CurvatureAt(
t
Evaluation parameter.
)
Remarks: No error handling.
Curvature vector of the curve at the parameter t.

Derivative

#Since v9.0
[ConstOperation] public BezierCurve Derivative()

Dispose

#Since v5.0
Actively reclaims unmanaged resources that this instance uses.
public void Dispose()

Dispose

#
For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

protected virtual void Dispose(
disposing
true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.
)

GetBoundingBox

#Since v5.0
Bounding box solver. Gets the world axis aligned bounding box for the curve.
[ConstOperation] public BoundingBox GetBoundingBox(
accurate
If true, a physically accurate bounding box will be computed. If not, a bounding box estimate will be computed. For some geometry types there is no difference between the estimate and the accurate bounding box. Estimated bounding boxes can be computed much (much) faster than accurate (or "tight") bounding boxes. Estimated bounding boxes are always similar to or larger than accurate bounding boxes.
)
The bounding box of the geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.

GetControlVertex2d

#Since v5.0
Get location of a control vertex.
[ConstOperation] public Point2d GetControlVertex2d(
index
Control vertex index (0 <= index < ControlVertexCount)
)
If the bezier is rational, the euclidean location is returned.
ArgumentOutOfRangeExceptionwhen index is out of range

GetControlVertex3d

#Since v5.0
Gets the 3D location of a control vertex at the specified index.
[ConstOperation] public Point3d GetControlVertex3d(
index
Control vertex index (0 <= index < ControlVertexCount).
)
The 3D location of the control vertex. If the Bezier is rational, the euclidean location is returned. Returns Point3d.Unset if the index is out of range or the control vertex cannot be retrieved.
ArgumentOutOfRangeExceptionThrown when index is out of range.

GetControlVertex4d

#Since v5.0
Gets the homogeneous (4D) value of a control vertex at the specified index.
[ConstOperation] public Point4d GetControlVertex4d(
index
Control vertex index (0 <= index < ControlVertexCount).
)
The homogeneous value of the control vertex. If the Bezier is not rational, the weight is 1. Returns Point4d.Unset if the index is out of range or the control vertex cannot be retrieved.
ArgumentOutOfRangeExceptionThrown when index is out of range.

GetObjectData

#Since v6.3
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public virtual void GetObjectData(
info,
The System.Runtime.Serialization.SerializationInfo to populate with data.
context
The destination (see System.Runtime.Serialization.StreamingContext) for this serialization.
)

IncreaseDegree

#Since v5.0
Increase degree of bezier
public bool IncreaseDegree(
desiredDegree
)
true if successful. false if desiredDegree < current degree.

MakeNonRational

#Since v5.0
Make bezier non-rational
public bool MakeNonRational()
true if successful

MakeRational

#Since v5.0
Make bezier rational
public bool MakeRational()
true if successful

PointAt

#Since v5.0
Evaluates point at a curve parameter.
[ConstOperation] public Point3d PointAt(
t
Evaluation parameter.
)
Remarks: No error handling.
Point (location of curve at the parameter t).

Split

#Since v6.0
Divides the Bezier curve at the specified parameter.
[ConstOperation] public bool Split(
t,
parameter must satisfy 0 < t < 1
left,
right
)
true on success

TangentAt

#Since v5.0
Evaluates the unit tangent vector at a curve parameter.
[ConstOperation] public Vector3d TangentAt(
t
Evaluation parameter.
)
Remarks: No error handling.
Unit tangent vector of the curve at the parameter t.

ToNurbsCurve

#Since v5.0
Constructs a NURBS curve representation of this curve.
[ConstOperation] public NurbsCurve ToNurbsCurve()
NURBS representation of the curve on success, null on failure.