本帖最后由 xyp1964 于 2014-2-2 10:40 编辑
- ;; 怎么判断两多段线相交?接触不算,叠合不算,并标出相交处。[url]http://bbs.mjtd.com/thread-101614-1-1.html[/url];; 需要e派工具箱(XCAD)的支持:[url]http://yunpan.cn/QXQKsW9gAPmpF[/url] 2014-02-01
- (defun c:test1500 ()
- (setq s1 (car (entsel "\n选择曲线1: "))
- s2 (car (entsel "\n选择曲线2: "))
- )
- (if (setq ptn (xyp-get-Inters s1 s2 0)
- ptn (mapcar '(lambda (x) (xyp-3d2d x)) ptn)
- )
- (progn
- (setq ptn1 (xyp-get-Vertexs s1 0)
- ptn2 (xyp-get-Vertexs s2 0)
- mode t
- )
- (foreach pt ptn
- (if (or (member pt ptn1) (member pt ptn2))
- (setq mode nil)
- )
- )
- (if mode
- (mapcar '(lambda (x) (xyp-circle x 100)) ptn)
- (progn
- (alert "不相交")
- (if (> (length ptn) 1)
- (xyp-Pline ptn nil)
- )
- )
- )
- )
- (alert "不相交")
- )
- (princ)
- )
|