Returns the curvature of a curve at a parameter. See the Rhino help file for details on curve curvature.
rhinoscriptsyntax.CurveCurvature (curve_id, parameter)
rhinoscript.curve.CurveCurvature (curve_id, parameter)
curve_id |
Required. String or Guid. The object's identifier. |
parameter |
Required. Number. The parameter to evaluate. |
Tuple |
A tuple of curvature information if successful. The tuple will contain the following information:
|
||||||||||||||||||
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a curve")
if rs.IsCurve(obj):
point = rs.GetPointOnCurve(obj, "Pick a test point")
if point:
param = rs.CurveClosestPoint(obj, point)
if param:
data = rs.CurveCurvature(obj, param)
if data:
print "Curve curvature evaluation at parameter", param, ":"
print " 3-D Point:", data[0]
print " 3-D Tangent:", data[1]
print " Center of radius of curvature:", data[2]
print " Radius of curvature:", data[3]
print " 3-D Curvature:", data[4]