NCF参数化建筑论坛

标题: CurveClosestPoint求助 [打印本页]

作者: licml    时间: 2010-12-30 18:53
标题: CurveClosestPoint求助
Rhino.CurveClosestPoint (strObject, arrPoint [, intIndex])
这个命令得到的是什么?感觉得到的是曲线上的点的位置参数,不是曲线上和曲线外某个点的距离最近的点。

Dim strObject, arrPoint, dblParam
strObject = Rhino.GetObject("Select a curve")
If Rhino.IsCurve(strObject) Then
arrPoint = Rhino.GetPointOnCurve(strObject, "Pick a test point")
    '为什么testPoint在曲线上?
if IsArray(arrPoint) Then
dblParam = Rhino.CurveClosestPoint(strObject, arrPoint)
Rhino.Print "Curve parameter: " & CStr(dblParam)
End If
End If
作者: aufalpen    时间: 2010-12-31 07:02
本帖最后由 aufalpen 于 2010-12-31 07:05 编辑

1# licml

离test point最近的且在所选曲线上的点。test point若在curve上,那最近点就是它自己。可以试试在曲线外找个test point,用GetObject之类的。
得到的数据类型跟你说的一样。然后如ls所说,用EvaluateCurve得到点的坐标值。




欢迎光临 NCF参数化建筑论坛 (http://bbs.ncf-china.com/) Powered by Discuz! X3.2