一个画节点板的程序,谁能帮我优化一下
www.dimcax.com
一个画节点板的程序,谁能帮我优化一下
这是一个画节点板的程序,谁能帮我优化一下,
它的精度不够,还有各个参数没有初始值或者是上一次输入的默认值
(
defun c:123() (/ jd jd1 zuo you gao xian r a b c d);画节点板
(setvar "cmdecho" 0)
(setq jd (getpoint "\n 请点取基点"))
(setq zuo (getdist jd "\n左点距离:"))
(setq you (getdist jd "\n右点距离:"))
(setq gao (getdist jd "\n节点板高:"))
(setq r (getangle jd "\n板件角度:"))
(setq xian (getdist jd "\n弦杆高:"))
(setq jd1 (polar jd (+ (* pi 1.5) r) (/ xian 2)))
(setq a (polar jd1 (+ pi r) zuo))
(setq d (polar jd1 r you))
(setq b (polar a (+ (* pi 1.5) r) gao))
(setq c (polar d (+ (* pi 1.5) r) gao))
(command "line" a b c d "")
(princ)
)
d