明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1276|回复: 2

我的惭开线做不了

[复制链接]
发表于 2006-1-8 16:37 | 显示全部楼层 |阅读模式

我做了一个惭开线程序,运行时出现:symbolp nil .我是个初学者,请各位大虾指点一个:

(defun c:involute(/ p0 phi phimas phimin)
(setq p0 (getpoint "\n输入基圆的圆心: "))
(setq r (getdist p0 "请输入基圆的半径: "))
(command "circle" p0 r);
(setq phimin (getreal "\n输入渐开线的起始角(弧度):"))
(setq phimax (getreal "\n输入渐开线的终止角(弧度):"))
(setq dphi (getreal "\n输入角度增量(弧度):"))
(setq n (/ (- phimax phimin) dphi));
(setq dphi (/ (- phimax phimin) n)); 
(setq x0 (car p0) yo (cadr p0));
(setq phi phimin)
(setq x1 (+ x0 (* r (+ (cos phi) (* phi (sin phi))))))
(setq y1 (+ x0 (* r (- (sin phi) (* phi (cos phi))))))
(while (<= phimax)
(setq phi (+ phi dphi))
(setq x2 (+ x0 (* r (+ (cos phi) (* phi (sin phi))))))
(setq y2 (+ x0 (* r (- (sin phi) (* phi (cos phi))))))
(set p1 (list x1 y1))
(set p2 (list x2 y2))
(command "pline" p1 p2"");
(setq x1 x2 y1 y2)))

发表于 2006-1-8 19:54 | 显示全部楼层
...
(while (<= phi phimax)  ; 这里少了 phi
(setq phi (+ phi dphi))
(setq x2 (+ x0 (* r (+ (cos phi) (* phi (sin phi))))))
(setq y2 (+ x0 (* r (- (sin phi) (* phi (cos phi))))))
(setq p1 (list x1 y1))  ;- 这里应该是 setq 而不是 set
(setq p2 (list x2 y2))  ;-
...
 楼主| 发表于 2006-1-10 18:37 | 显示全部楼层

谢谢zara大侠的帮忙,现已调试成功!以后还请多指教

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-28 01:34 , Processed in 0.187873 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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