A general purpose curve evaluator.
Rhino.CurveEvaluate (strObject, dblParameter, intDerivative)
strObject |
Required. String. The object's identifier. |
dblParameter |
Required. Number. The evaluation parameter. |
intDerivative |
Required. Number. The number of derivatives to evaluate. |
Array |
An array of length (intDerivative+1) if successful. The array elements are as follows:
|
|||||||||||||||
Null |
If not successful, or on error. |
Sub TestCurveEvaluate()
Dim crv, pt, t, der, res, msg, i
crv = Rhino.GetObject("Select curve to evaluate", 4, True)
If IsNull(crv) Then Exit Sub
pt = Rhino.GetPointOnCurve(crv, "Point to evaluate")
If Not IsArray(pt) Then Exit Sub
der = Rhino.GetInteger("Number of derivatives to evaluate", 1, 1)
If Not IsNumeric(der) Then Exit Sub
t = Rhino.CurveClosestPoint(crv, pt)
res = Rhino.CurveEvaluate(crv, t, der)
If Not IsArray(res) Then
Rhino.Print "Failed to evaluate curve."
Exit Sub
End If
For i = 0 to UBound(res)
msg = msg & CStr(i) & " = " & Rhino.Pt2Str(res(i), 6) & vbCrLf
Next
MsgBox msg, vbOKOnly, "Derivative = " & CStr(der)
End Sub