我是LISP初学者,编了个生成管法兰的小程序,但不知道哪的原因,输入相同参数,生成的图形各种各样。请大师帮忙,指点迷津,非常感谢,期待您的答复。 法兰的参数一例参数如下:x y 任取,f1=2,A=108 D1=220,K=180,C=22,N=130,H1=12,H=52,d2=156 程序如下: (defun c:falan () (setq m_x (getreal "x=")) (setq m_y (getreal "y=")) (setq m_f1 (getdist "f1=")) (setq m_A (getdist "A=")) (setq m_D1 (getdist "D=")) (setq m_K (getdist "K=")) (setq m_C (getdist "C=")) (setq m_N (getdist "N=")) (setq m_H1 (getdist "H1=")) (setq m_H (getdist "H=")) (setq m_d2 (getdist "d=")) (command "rectang" (list (+ m_x (/ m_d2 2)) m_y) (list (- m_x (/ m_d2 2)) (+ m_y m_f1)) ) (command "rectang" (list (+ m_x (/ m_D1 2)) (+ m_y m_f1)) (list (- m_x (/ m_D1 2)) (+ m_y m_C)) ) (command "rectang" (list (+ m_x (/ m_A 2)) (- (+ m_y m_H) m_H1)) (list (- m_x (/ m_A 2)) (+ m_y m_H)) ) (command "line" (list (+ m_x (/ m_N 2)) (+ m_y m_C)) (list (+ m_x (/ m_A 2)) (+ m_y (- m_H m_H1))) "" ) (command "line" (list (- m_x (/ m_N 2)) (+ m_y m_C)) (list (- m_x (/ m_A 2)) (+ m_y (- m_H m_H1))) "" ) (command "line" (list m_x (- m_y 20)) (list m_x (+ m_y m_H 20)) "" ) (command "line" (list (+ m_x (/ m_K 2)) (- m_y 10)) (list (+ m_x (/ m_K 2)) (+ (+ m_y m_C) 10)) "" ) (command "line" (list (- m_x (/ m_K 2)) (- m_y 10)) (list (- m_x (/ m_K 2)) (+ (+ m_y m_C) 10)) "" ) (prin1) )
|