本帖最后由 sz721 于 2012-4-23 14:52 编辑
- (defun c:DTY ( / _GenerateFunctionPoints fun p1 gr )
- (setq fun sin)
- (defun _GenerateFunctionPoints ( p1 p2 / d a1 a2 i j )
- (setq d (distance p1 p2) a1 (angle p1 p2) a2 (+ a1 (/ pi 2.)) i 0 p3 (polar p1 a2 (fun 0.)))
- (while (<= (setq x (* 0.1 (setq i (1+ i)))) d)
- (grdraw p3 (setq p3 (polar (polar p1 a1 x) a2 (fun x))) 3)
- )
- )
- (if (setq p1 (getpoint "\n请指定第一点: "))
- (while (= 5 (car (setq gr (grread 't 13 0)))) (redraw)
- (_GenerateFunctionPoints p1 (cadr gr))
- )
- )
- (princ)
- )
|