#coding=utf-8
import rhinoscriptsyntax as rs
getresult = rs.GetCurveObject("选择要测量长度的曲线")
if getresult:
curve_id = getresult[0]
point0 = rs.GetPointOnCurve( curve_id )
if point0:
point1 = rs.GetPointOnCurve( curve_id )
if point1:
t0 = rs.CurveClosestPoint( curve_id, point0)
t1 = rs.CurveClosestPoint( curve_id, point1)
curve = rs.AddSubCrv( curve_id, t0, t1 )
distance = rs.CurveLength(curve)
rs.DeleteObject(curve)
if distance:
print ("曲线的长度为" + str(distance))
xkdsofa 发表于 2017-6-13 18:53
那个是可以,但是要更加优化的使用,因为会经常会用到,提取出来,又用量线长的量,是做了很多的时间去为了 ...
欢迎光临 Rhino3D犀牛中文网 (https://rhino3d.asia/) | Powered by Discuz! X3.3 |