wangph 发表于 2008-11-13 21:30:00

有没有判断一个点是否在一条线上的函数?

<p>请问有没有判断一个点是否在一条线上的函数,这条线可能是Line,也可能是Polyline</p>

nonsmall 发表于 2008-11-14 08:43:00

<p><table class="HeadingTable" cellspacing="0" cellpadding="0" width="103%" border="0"><tbody><tr><td colspan="2"><div class="TopHead">vlax-curve-getClosestPointTo</div></td></tr><tr valign="bottom"><td colspan="2" height="33"><table class="TabTable" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td width="10">&nbsp;</td></tr></tbody></table></td></tr></tbody></table></p><p class="cr_leadin" id="crleadin">返回曲线上离指定点最近的点(在 WCS 上)</p><pre class="prog_in_end">(vlax-curve-getClosestPointTo curve-obj givenPnt )</pre><p class="Heading-2">参数</p><p class="define_head">curve-obj</p><p class="define_text">要测量的 VLA 对象。</p><p class="define_head">givenPnt</p><p class="define_text">点(在 WCS 上),寻找曲线上距该点最近的点。</p><p class="define_head">extend</p><p class="define_text">如果指定该参数且其值不为 nil,vlax-curve-getClosestPointTo 在搜索最近点时扩展曲线。</p><p class="Heading-2">返回值</p><p class="body">如果成功则返回表示曲线上一点的三维点表,否则返回 nil。</p><p class="body">----------------------------------------</p><p>如果返回的点和givenPnt是同一个点说明在该线上</p>

nonsmall 发表于 2008-11-14 08:55:00

(if (equal 0 (distance (setq pt1 (getpoint "\n选择需要判断的点")) (setq pt2 (vlax-curve-getClosestPointTo (vlax-ename-&gt;vla-object (car(entsel "\n选择一条线"))) pt1))) 0.00001) T nil)

wangph 发表于 2008-11-14 11:53:00

谢谢楼上的
页: [1]
查看完整版本: 有没有判断一个点是否在一条线上的函数?