Page 1 of 1

abstract to wallpaper

Posted: Sun Jul 10, 2005 9:23 am
by LaT3x
Modificate as you want :)

Code: Select all

startshape C

rule C 
{ 
  CIRCLE { s 2 }
  CIRCLE { s 1.9 b 1}
  B {  } 
  B {  r 180 } 
}

rule B
{
  SQUARE {}
  SQUARE {s .8 b 1}
  B { x 2 s .92 }
}

rule B .1
{
  B { r -45 }
  B { r 45 }
}

rule B .01
{
   A {s .2}
}

rule A
{
  CIRCLE { }
  A { x 2 r 1 s .9999 b .0001}
}
rule A .002
{
  CIRCLE { }
  A2 { r -90 s .9 b .0001}
}

rule A2
{
  CIRCLE { }
  A { x 2 r -1 s .9999 b .0001}
}
rule A2 .002
{
  CIRCLE { }
  A { r 90 s .9999 b .0001}
}

Posted: Sun Jul 10, 2005 12:56 pm
by ehuber
Neat!

Posted: Thu Jul 14, 2005 10:38 am
by odinsdream
I'm really interested in the shapes that are large spirals, but the line hops out of the spiral and starts making another spiral.

Can someone explain how that shape is being created?

Posted: Thu Jul 14, 2005 11:54 am
by aaronstj
The spirals are fairly easy to explain. They're defined by the A and A2 rules (actually, it looks like there's a bug in LaT3x's code that makes a2 basically inconsequential, since both of the A2 rules jump immediately back into A). Here's the code reduced to just the spiral:

Code: Select all

startshape A

rule A
{
  CIRCLE { }
  A { x 2 r 1 s .9999 b .0001}
}
rule A .002
{
  CIRCLE { }
  A { r -90 s .9 b .0001}
}
The first rule is your basic spiral. It drops a circle and then calls itself, offset by a couple of units, rotated, and resized. However, when the second rule is called (which happens about once every 500th time), the spiral takes a 90 degree turn. Those 90 degree turns are where the line "jumps out" of the spiral and starts a new spiral.

Posted: Thu Jul 14, 2005 2:32 pm
by odinsdream
Thanks for the explanation! It's always great to learn how these work.