倔强的蚂蚁 发表于 2013-11-19 08:25:58

如何从一个点表中把其中的点都提取出来?

比如有(x1 y1 z1 x2 y2 z2)
怎么提取为(x1 y1 z1)    (x2 y2 z2)

求曲线交点的时候,有时候会有两个以上交点,但有的点并不需要,就想提取有用的点。



llsheng_73 发表于 2013-11-19 09:04:24

(setq jd'(x1 y1 z1 x2 y2 z2) i 0 a'())
(repeat (/ (length jd)3)
   (setq a(append a(list(list(nth i jd)(nth(1+ i) jd)(nth(+ 2 i)jd))))
            i(+ 3 i))
)

ll_j 发表于 2013-11-19 09:05:08

http://bbs.xdcad.net/thread-668406-1-1.html

倔强的蚂蚁 发表于 2013-11-19 11:16:07

llsheng_73 发表于 2013-11-19 09:04 static/image/common/back.gif
(setq jd'(x1 y1 z1 x2 y2 z2) i 0 a'())
(repeat (/ (length jd)3)
   (setq a(append a(list(list(nth...

非常感谢!

倔强的蚂蚁 发表于 2013-11-19 11:22:37

ll_j 发表于 2013-11-19 09:05 static/image/common/back.gif
http://bbs.xdcad.net/thread-668406-1-1.html

谢谢帮助!

NJZX05 发表于 2013-11-19 11:28:04

(setq PtLst nil)
(while Pts (setq PtLst (append PtLst (list (list (car Pts) (cadr Pts) (caddr Pts)))) Pts (cdddr pts)))

倔强的蚂蚁 发表于 2013-11-19 12:47:44

NJZX05 发表于 2013-11-19 11:28 static/image/common/back.gif
(setq PtLst nil)
(while Pts (setq PtLst (append PtLst (list (list (car Pts) (cadr Pts) (caddr Pts)) ...

谢谢!

llsheng_73 发表于 2013-11-19 13:55:48

NJZX05 发表于 2013-11-19 11:28 static/image/common/back.gif
(setq PtLst nil)
(while Pts (setq PtLst (append PtLst (list (list (car Pts) (cadr Pts) (caddr Pts)) ...

这个更简洁,效率也应该相当高学习了
页: [1]
查看完整版本: 如何从一个点表中把其中的点都提取出来?