FitCurve

Reduces the number of curve control points while maintaining the curve's same general shape.  Use this function for replacing curves with too many control points.  For more information, see the Rhino help file for the FitCrv command.

Syntax

Rhino.FitCurve (strObject [, intDegree [, dblTolerance [, dblAngleTolerance]]])

Parameters

strObject

Required.  String.  The object's identifier.

intDegree

Optional.  Number.  The curve degree, which must be greater than 1. The default is 3.

dblTolerance

Optional.  Number.  The fitting tolerance.  If dblTolerance is not specified or <= 0.0, the document absolute tolerance is used.

dblAngleTolerance

Optional.  Number.  The kink smoothing tolerance in degrees.  If dblAngleTolerance is 0.0, all kinks are smoothed.  If dblAngleTolerance is > 0.0, kinks smaller than dblAngleTolerance are smoothed.  If dblAngleTolerance is not specified or < 0.0, the document angle tolerance is used for the kink smoothing.

Returns

String

The identifier of the new object if successful.

Null

If not successful, or on error.

Example

Const rhCurve = 4

Dim strOldCurve, strNewCurve

strOldCurve = Rhino.GetObject("Select curve to fit", rhCurve)

If Not IsNull(strOldCurve) Then

  strNewCurve = Rhino.FitCurve(strOldCurve)

  If Not IsNull(strNewCurve) Then

    Rhino.DeleteObject strOldCurve

  End If

End If

Also See

FitSurface