Michal curve
by mbican
Short link: http://malsys.cz/g/wBpo9Buo
Comments
comments powered by DisqusSource code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | lsystem MichalCurve { set symbols axiom = L(1,1); set iterations = 11; set initialAngle = 270; interpret F as DrawForward(8); interpret T(x) as TurnLeft(x*90); rewrite A(x,y) to L(x,y); rewrite B(x,y) to S(x,y); rewrite C(x,y) to L(x,y); rewrite D(x,y) to S(x,y); rewrite E(x,y) to S(x,y); rewrite G(x,y) to L(x,y); rewrite H(x,y) to S(x,y); rewrite I(x,y) to L(x,y); rewrite J(x,y) to S(x,y); rewrite M(x) to T(-x) A(-x,1) F B(-x,1) F T(x) C(x,1) F D(x,1) F E(x,1) T(x) F T(x) G(x,1) F T(-x) H(-x,1) F I(-x,1) T(-x) F J(x,1); rewrite L(x,y) where y < 0 to U(x); rewrite L(x,y) where y > 0 to M(x); rewrite S(x,y) where y < 0 to M(x); rewrite S(x,y) where y > 0 to U(x); rewrite U(x) to J(x,-1) F T(-x) I(-x,-1) F H(-x,-1) T(-x) F G(x,-1) T(x) F T(x) E(x,-1) F D(x,-1) F C(x,-1) T(x) F B(-x,-1) F A(-x,-1) T(-x); } process all with SvgRenderer; |
Thumbnail extension
1 2 3 | lsystem MichalCurveThumbnail extends MichalCurve { set iterations = 5; } |