明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1233|回复: 7

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

[复制链接]
发表于 2013-11-19 08:25 | 显示全部楼层 |阅读模式
比如有(x1 y1 z1 x2 y2 z2)
怎么提取为(x1 y1 z1)    (x2 y2 z2)

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



发表于 2013-11-19 09:04 | 显示全部楼层
(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))
)
发表于 2013-11-19 09:05 | 显示全部楼层
 楼主| 发表于 2013-11-19 11:16 | 显示全部楼层
llsheng_73 发表于 2013-11-19 09:04
(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 | 显示全部楼层
ll_j 发表于 2013-11-19 09:05
http://bbs.xdcad.net/thread-668406-1-1.html

谢谢帮助!
发表于 2013-11-19 11:28 | 显示全部楼层
(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 | 显示全部楼层
NJZX05 发表于 2013-11-19 11:28
(setq PtLst nil)
(while Pts (setq PtLst (append PtLst (list (list (car Pts) (cadr Pts) (caddr Pts)) ...

谢谢!
发表于 2013-11-19 13:55 | 显示全部楼层
NJZX05 发表于 2013-11-19 11:28
(setq PtLst nil)
(while Pts (setq PtLst (append PtLst (list (list (car Pts) (cadr Pts) (caddr Pts)) ...

这个更简洁,效率也应该相当高学习了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-18 20:00 , Processed in 0.205613 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表