明经通道 Visual LISP 函数  
vlax-curve-getClosestPointTo
 

返回曲线上离指定点最近的点(在 WCS 上)

(vlax-curve-getClosestPointTo curve-obj givenPnt [extend])

参数

curve-obj

要测量的 VLA 对象。

givenPnt

点(在 WCS 上),寻找曲线上距该点最近的点。

extend

如果指定该参数且其值不为 nil,vlax-curve-getClosestPointTo 在搜索最近点时扩展曲线。

返回值

如果成功则返回表示曲线上一点的三维点表,否则返回 nil。

示例

假定要测量的曲线为下面图形中的圆弧:

返回曲线上距坐标 (6.0, 0.5) 最近的点:

_$ (vlax-curve-getClosestPointTo arcObj '(6.0 0.5 0.0))
(6.0 1.5 0.0)

扩展圆弧后,返回曲线上距坐标 (6.0, 0.5) 最近的点:

_$ (vlax-curve-getClosestPointTo arcObj '(6.0 0.5 0.0) T)
(5.7092 0.681753 0.0)

明经通道 版权所有 未经许可 不得传播

 评论