BezierCurve

References
Represents a Bezier curve.

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

Constructors

BezierCurve

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

BezierCurve

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

BezierCurve

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

BezierCurve

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

Finalizer

~BezierCurve

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

Properties

ControlVertexCount

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

Dimension

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

IsRational

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

IsValid

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

Methods

ChangeDimension

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

CreateBeziers

#Since v6.0
public static BezierCurve[] CreateBeziers(Curve sourceCurve)
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.
sourceCurve (Curve)The curve to fit Beziers to
A new array of Bezier curves

CreateCubicBeziers

#Since v5.0
public static BezierCurve[] CreateCubicBeziers(Curve sourceCurve, double distanceTolerance, double kinkTolerance)
Constructs an array of cubic, non-rational Beziers that fit a curve to a tolerance.
sourceCurve (Curve)A curve to approximate.
distanceTolerance (double)The max fitting error. Use RhinoMath.SqrtEpsilon as a minimum.
kinkTolerance (double)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
public static BezierCurve CreateLoftedBezier(IEnumerable<Point2d> points)
Loft a bezier through a list of points
points (IEnumerable<Point2d>)2 or more points to interpolate
new bezier curve if successful

CreateLoftedBezier

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

CurvatureAt

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

Derivative

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

Dispose

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

Dispose

#
protected virtual void Dispose(bool disposing)
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.

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

GetBoundingBox

#Since v5.0
[ConstOperation] public BoundingBox GetBoundingBox(bool accurate)
Bounding box solver. Gets the world axis aligned bounding box for the curve.
accurate (bool)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
[ConstOperation] public Point2d GetControlVertex2d(int index)
Get location of a control vertex.
index (int)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
[ConstOperation] public Point3d GetControlVertex3d(int index)
Gets the 3D location of a control vertex at the specified index.
index (int)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
[ConstOperation] public Point4d GetControlVertex4d(int index)
Gets the homogeneous (4D) value of a control vertex at the specified index.
index (int)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
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
info (SerializationInfo)The System.Runtime.Serialization.SerializationInfo to populate with data.
context (StreamingContext)The destination (see System.Runtime.Serialization.StreamingContext) for this serialization.

IncreaseDegree

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

MakeNonRational

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

MakeRational

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

PointAt

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

Split

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

TangentAt

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

ToNurbsCurve

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