TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Ben Clark on October 07, 2020, 12:03:53 PM
-
Anyone tried to code this yet? Seems like it would be a good challenge. Similar to doing a mandelbrot fractal, koch snowflake, Sierpinski triangel, etc.
If anyone is into recursion I'm sure it'd be fun :laugh:
-
Found some use for one of my favorite toys, inverted circles...
(defun c:gasket
( / p r i a b c cen lst msg
) (setq i
(getint "\nSpecify Gasket Level (3...10): ")) (<= 3 i 10)
)
)
)
)
(list (/ pi
6) (/ (* 5 pi
) 6) (* 1.5 pi
)) )
)
)
(list (inverted_circle
(car cen
) (circ p r
))) (list (inverted_circle ctr
(circ
(polar p u
(- r c
)) c
))) )
)
(list (/ (* 7 pi
) 6) (/ (* 11 pi
) 6) (/ pi
2)) )
)
)
)
)
cen
)
)
)
)
)
)
)
(defun inverted_circle
(l1 l2
/ p1 r1 p2 r2 a d e1 e2
) e1
(polar p1 a
(/ (* r1 r1
) (+ d r2
))) e2
(polar p1 a
(/ (* r1 r1
) (- d r2
))) )
(circ
(m2p e1 e2
) (/ (distance e1 e2
) 2)) )
-
Incredible!!! I still don't fully understand what an inverted circle is after looking it up, but this is really cool. It will take me some time to understand your code. Well done.
-
In the future you must use three-letters+ for name-of-variabiles
(I see. popf, cwd see my picture). :angel:
Eg. I replace ~ (repeat (- i 3)~ with
~for(;levelator>=0;levelator=levelator-1)~
I think (Pi) is obsolute. I re-use kpi from ObjectARx-Sdk-AutoCad2010.
const double kPi = 3.14159265358979323846;
const double kTwoPi = 6.28318530717958647692;
const double kHalfPi = 1.57079632679489661923;
const double kTolerance = 1.0e-10;
const double kEpsilon = 1.0e-10;
:-o
Found some use for one of my favorite toys, inverted circles...
How to develope Artistic'Sources?