谢谢你,T先生的链接。另一种方法是在实体变得难以操作时生成曲面。这些都是一般的建议程序,我以一种简单的方式重写了例程,以满足我们的需要。首先,这是一个绘制螺旋的程序,如果标高(螺距)设置为零,则绘制螺旋。圈数可能是实数(!)您可以独立设置起点和终点半径,因此很容易绘制锥形弹簧。半径可以接受负值(试试这个:Rb=10;Rt=-10;标高=0,转角=2)。
我将带着另一个程序返回,在螺旋路径上挤出一个形状,生成一个曲面。所以离我近一点!
- (defun C:Helcon()
- (setq segs 20); segments/turn
- (setq spin -1); -1=CW, 1=CCW
- (setq ri (getreal "base radius ") rf (getreal "top radius "))
- (initget (+ 1 4))
- (setq h (getreal "elevation "))
- (initget (+ 1 2 4))
- (setq tu (getreal "turns "))
- (setq old (getvar "osmode"))
- (setvar "cmdecho" 0)
- (setq fi1 (/ (* 2 PI) segs) i 0)
- (setq points (fix (* tu segs))
- h1 (/ h points) r1 (/ (- rf ri) points)
- s (getpoint "center of base ")
- end (list (car s) (cadr s) (+ h (caddr s))))
- (setvar "osmode" 0 )
- (command "line" s end "")
- (command "chprop" "l" "" "c" 1 "")
- (command "3dpoly")
- (setq i 0)
- (repeat (1+ points)
- (setq fi (* i fi1) h (* i h1) r (+ ri (* i r1)))
- (setq x (* r (cos fi)) y (* spin r (sin fi)))
- (command (list (+ (car s) x) (+ (cadr s) y) (+ (caddr s) h)))
- (setq i (1+ i)))
- (command "")
- (setvar "osmode" old))
|