BezierCurve
ReferencesRepresents a Bezier curve.
Note: as an exception, the bezier curve is not derived from Curve.
Constructors
Create bezier curve with controls defined by a list of 2d points
Parameters:
| controlPoints (IEnumerable<Point2d>) |
Create bezier curve with controls defined by a list of 3d points
Parameters:
| controlPoints (IEnumerable<Point3d>) |
Create bezier curve with controls defined by a list of 4d points
Parameters:
| controlPoints (IEnumerable<Point4d>) |
BezierCurve
#Protected constructor for internal use.
Parameters:
| 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
Number of control vertices in this curve
Gets a value indicating whether or not the curve is rational. Rational curves have control-points with custom weights.
Methods
Change dimension of bezier.
Parameters:
| desiredDimension (int) |
Returns: true if successful. false if desired_dimension < 1
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.
Parameters:
| sourceCurve (Curve) | The curve to fit Beziers to |
Returns: A new array of Bezier curves
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.
Parameters:
| 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. |
Returns: A new array of bezier curves. The array can be empty and might contain null items.
Loft a bezier through a list of points
Parameters:
| points (IEnumerable<Point2d>) | 2 or more points to interpolate |
Returns: new bezier curve if successful
Loft a bezier through a list of points
Parameters:
| points (IEnumerable<Point3d>) | 2 or more points to interpolate |
Returns: new bezier curve if successful
Evaluate the curvature vector at a curve parameter.
Remarks: No error handling.
Parameters:
| t (double) | Evaluation parameter. |
Returns: Curvature vector of the curve at the parameter t.
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.
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.
Parameters:
| disposing (bool) | true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer. |
Bounding box solver. Gets the world axis aligned bounding box for the curve.
Parameters:
| 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. |
Returns: The bounding box of the geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.
Get location of a control vertex.
Parameters:
| index (int) | Control vertex index (0 <= index < ControlVertexCount) |
Returns: If the bezier is rational, the euclidean location is returned.
Exceptions:
| ArgumentOutOfRangeException | when index is out of range |
Gets the 3D location of a control vertex at the specified index.
Parameters:
| index (int) | Control vertex index (0 <= index < ControlVertexCount). |
Returns: 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.
Exceptions:
| ArgumentOutOfRangeException | Thrown when index is out of range. |
Gets the homogeneous (4D) value of a control vertex at the specified index.
Parameters:
| index (int) | Control vertex index (0 <= index < ControlVertexCount). |
Returns: 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.
Exceptions:
| ArgumentOutOfRangeException | Thrown when index is out of range. |
[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.
Parameters:
| info (SerializationInfo) | The System.Runtime.Serialization.SerializationInfo to populate with data. |
| context (StreamingContext) | The destination (see System.Runtime.Serialization.StreamingContext) for this serialization. |
Increase degree of bezier
Parameters:
| desiredDegree (int) |
Returns: true if successful. false if desiredDegree < current degree.
Make bezier non-rational
Returns: true if successful
Evaluates point at a curve parameter.
Remarks: No error handling.
Parameters:
| t (double) | Evaluation parameter. |
Returns: Point (location of curve at the parameter t).
Divides the Bezier curve at the specified parameter.
Parameters:
| t (double) | parameter must satisfy 0 < t < 1 |
| left (out BezierCurve) | |
| right (out BezierCurve) |
Returns: true on success
Evaluates the unit tangent vector at a curve parameter.
Remarks: No error handling.
Parameters:
| t (double) | Evaluation parameter. |
Returns: Unit tangent vector of the curve at the parameter t.
Constructs a NURBS curve representation of this curve.
Returns: NURBS representation of the curve on success, null on failure.