aloy 发表于 2022-7-6 00:30:58

它只解决了一点问题。我用你的解决方案试了一下,效果不错。但是,您必须定义两个关键函数,我在这里不包括这两个函数,因为许多其他函数都与它们相关。
(defun trix2()
(setq lst’((2.0 5.0)(5.0 4.5))((5.0 4.5)(6.7 7.9))((6.7 7.9)(10.4 11.3))((10.4 11.3)(15.0 17.5)))
(setq ptlist’((5.8 6.0)))
(setq lst(mapcar)(λ(a))
(setq ip1(a车))
(setq ip2(cadr a))
(搜索圈)
(如果(/=list2 nil)
(程序
(drawtriangle)
(setq lst(列表(a车)nmax)
lst(追加lst(列表最大值(cadr a)))
)
)(setq a)
)                                             
)lst)
(foreach xlst lst
(如果(>(长度xlst)2)
(setq lstl(追加lstl(列表(car xlst)(cadr xlst)))
lstl(追加lstl(列表(cadr(反向xlst))(car(反向xlst)аа)а)
)
(setq lstl(append lstl(list xlst)))
)
)
)
 
ptlist可以有多达1000个点,由“searchcircle”测试并给出一个列表2。
再次感谢您的回复。
页: 1 [2]
查看完整版本: 一个多段线lisp问题