明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: 菜卷鱼

[源码] 简单的投影程序

  [复制链接]
 楼主| 发表于 2014-1-11 14:39 | 显示全部楼层
本帖最后由 菜卷鱼 于 2014-1-11 15:04 编辑

圆弧部分已经解决!
  1. ((= ac0 "ARC")
  2.   (setq dr40 (cdr (assoc 40 info)))
  3.   (setq pt10 (cdr (assoc 10 info)))
  4.   (setq starc (cdr (assoc 50 info)))
  5.   (setq edarc (cdr (assoc 51 info)))
  6. (if
  7. (or
  8. (and(= starc 0)(= edarc pi))
  9. (and(= starc pi)(= edarc 0))
  10. (and(= starc pi2)(= edarc 3pi2))
  11. (and(= starc 3pi2)(= edarc pi2))
  12. )
  13. (setq clt (cons pt10 clt))
  14. )
  15.   (cond
  16.     ((or

  17. (and (<= starc pi2)(<= pi2 edarc)(< edarc 3pi2))
  18. (and (<= pi2 edarc)(< edarc 3pi2 starc))
  19. )
  20.      (setq pltud (cons (polar pt10 pi2 dr40) pltud))
  21.     )                                                      ;;上
  22. ( (or
  23. (and (<= starc pi2) (>= edarc 3pi2))
  24. (and (<= starc pi2) (< edarc pi2))
  25. (and (> starc 3pi2) (>= edarc 3pi2))
  26. )
  27.      (setq pltud (cons (polar pt10 pi2 dr40)
  28.            (cons (polar pt10 3pi2 dr40) pltud)
  29.      )
  30.      )
  31.     )                                                      ;;LT上下
  32. ((<= pi2 edarc starc 3pi2)
  33.      (setq pltud (cons (polar pt10 pi2 dr40)
  34.            (cons (polar pt10 3pi2 dr40) pltud)
  35.      )
  36.      )
  37.     )                                                      ;;RG上下
  38. ((and
  39. (> starc pi2) (<= starc 3pi2)
  40. (or (>= edarc 3pi2)(and (>= edarc 0)(< edarc pi2))))
  41.      (setq pltud (cons (polar pt10 3pi2 dr40) pltud))
  42.     )         
  43. )                                                         ;;下
  44. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  45. (cond
  46. ((and (<= starc pi edarc) (> starc 0) )
  47.      (setq pltlr (cons (polar pt10 pi dr40) pltlr))
  48.     )                                                     ;;;左
  49. ((<= pi edarc starc)
  50.      (setq pltlr (cons (polar pt10 0 dr40)
  51.            (cons (polar pt10 pi dr40) pltlr)
  52.      )
  53.      )
  54.     )                                                     ;;;UP左右
  55. ((>= pi starc edarc)
  56.      (setq pltlr (cons (polar pt10 0 dr40)
  57.            (cons (polar pt10 pi dr40) pltlr)
  58.      )
  59.      )
  60.     )                                                     ;;;DN左右
  61. ((< edarc pi starc)
  62.      (setq pltlr (cons (polar pt10 0 dr40) pltlr))
  63.     )                                                     ;;;右
  64.   )
  65. )

评分

参与人数 1明经币 +1 收起 理由
机械工程师 + 1 很给力!

查看全部评分

发表于 2014-1-11 17:24 | 显示全部楼层
这种投影程序适用范围不是很广,像基本的不通孔,沉孔都无法做到,刚测试了一下,

不知道你的投影是第一角还是第三角投影法? 上图中两方框选中的线条无论怎么投影都是虚线

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
 楼主| 发表于 2014-1-11 20:53 来自手机 | 显示全部楼层
flyfox1047 发表于 2014-1-11 17:24
这种投影程序适用范围不是很广,像基本的不通孔,沉孔都无法做到,刚测试了一下,

不知道你的投影是第一 ...

所以说是粗糙的投影程序啊,没分视角,水平太低了,更高级的功能搞不出来
发表于 2014-1-12 00:39 | 显示全部楼层
支持一下!
发表于 2014-1-12 08:10 | 显示全部楼层
支持源码!
发表于 2014-1-12 09:27 | 显示全部楼层
高手如云,我等膜拜
发表于 2014-1-14 14:20 | 显示全部楼层
本帖最后由 crazylsp 于 2014-1-14 14:23 编辑

赞一个真的非常好的好
发表于 2014-1-15 09:54 | 显示全部楼层
挺好的程序,看看啊 学习了!
发表于 2014-1-15 16:17 | 显示全部楼层
是要先有cad三D图形了,再用这个进行投影的吗?
 楼主| 发表于 2014-1-16 08:24 | 显示全部楼层
shalei021647 发表于 2014-1-15 16:17
是要先有cad三D图形了,再用这个进行投影的吗?

没有你想象的那么高级,只能投影简单的2D图形
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-20 08:27 , Processed in 0.246165 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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