大家帮忙看下这个画楼梯的小程序有什么错误?为什么会导致在画图时用滚轮缩小图形后,程序画出来的图就不对了?(defun C:qt (/ pa hh ww n pp p1 p2) (setq pa (getpoint "\n 左下角点:")) (setq hh (getreal "\n 台阶高度:")) (setq ww (getreal "\n 台阶宽度:")) (if (null ww) (setq ww 520.0)) ;当宽度未赋值时,定义宽度为520
(defun C:qt (/ pa hh ww n pp p1 p2)
(setq pa (getpoint "\n 左下角点:"))
(setq hh (getreal "\n 台阶高度:"))
(setq ww (getreal "\n 台阶宽度:"))
(if (null ww) (setq ww 520.0)) ;当宽度未赋值时,定义宽度为520
(setq n (getint "重复次数:"))
(setq pp pa)
(repeat n
(setq p1 (polar pp (/ pi 2) hh))
(setq p2 (polar p1 0 ww))
(command "line" pp p1 p2 "")
(setq pp p2)
)
(prin1)
)
(prompt "\n <
(prin1)
[ 本帖最后由 taotaokeai 于 2011-12-16 21:11 编辑 ]