黄金分割圆的迭代: (defun c:tt () (CMDLA0) (defun aaa (s1 / p1 leng l1 p2) (setq p1 (xyp-get-CurveStartPoint s1) leng (xyp-get-CurveLength s1) l1 (* leng (/ 2 (+ (sqrt 5) 1))) p2 (XYP-GET-CURVEPOINTATDIST s1 (- leng l1)) ) (xyp-add-line p1 p2) (xyp-put "color" (entlast) 6) (distance p1 p2) ) (setvar "osmode" 0) (xyp-MkLaCo "TEST" 1) (setq s1 (car (entsel)) p10 (xyp-get-dxf 10 s1) l (aaa s1) p0 (xyp-get-CurveStartPoint s1) r1 (xyp-get-dxf 40 s1) ) (command "circle" "2p" p0 (polar p0 0 l)) (setq s2 (entlast) p20 (xyp-get-dxf 10 s2) r2 (xyp-get-dxf 40 s2) ) (repeat 100 (setq r3 (* (aaa s2) 0.5)) (command "circle" p10 (+ r1 r3)) (setq s4 (entlast)) (command "circle" p20 (+ r2 r3)) (setq s5 (entlast)) (command "circle" (cadr (xyp-get-Inters s4 s5 0)) r3) (setq s2 (entlast) p20 (xyp-get-dxf 10 s2) r2 (xyp-get-dxf 40 s2) ) (entdel s4) (entdel s5) ) (CMDLA1) ) |