Returns a 3-D vector that is the tangent to a curve at a parameter.
rhinoscriptsyntax.CurveTangent (curve_id, parameter, segment_index=-1)
rhinoscript.curve.CurveTangent (curve_id, parameter, segment_index=-1)
curve_id |
Required. String or Guid. The object's identifier. |
parameter |
Required. Number. The parameter to evaluate. |
segment_index |
Optional. Number. If curve_id identifies a polycurve object, then segment_index identifies the curve segment of the polycurve to query. |
Vector3d |
A 3-D vector if successful. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a curve", rs.filter.curve)
if obj:
point = rs.GetPointOnCurve(obj)
if point:
param = rs.CurveClosestPoint(obj, point)
normal = rs.CurveTangent(obj, param)
print normal