new icn messageflickr-free-ic3d pan white
Mengerism (All symmetric 3-units) | by Syntopia
Back to photostream

Mengerism (All symmetric 3-units)

A 3-unit Menger sponge contains 27 cells (3x3x3). This gives 2^27 = 134217728 possible recursive patterns (too many).

 

Now if we only want symmetric structures (under the symmetry group for the cube), there are only four different types of cells in the sponge, which we can label according to their distance from the center cube:

 

Distance 0: the cube center cell

Distance 1: the 6 side center cells

Distance 2: the 12 cells two steps away.

Distance 3: the 8 corner cells.

 

Now, this means there are only 16 (2^4) different symmetric unit-3 menger sponges.

Labeling these from 0-15 (using the distances above as base-2 bases) gives a natural enumeration. The original Menger cube ((lower left corner) is number 12 with this enumeration (It uses Distance 2 and 3 patterns = 1100 in binary) .

 

The 16 possible Mengers are depicted above. They are drawn to level 2 (a maximum of 9x9x9=729 cells), but the recursion level may be increased in the code below.

 

The EisenScript is below (notice that the preprocessor commands require a version of Structure Synth from SVN (post 0.8.5) - so this will not work with the current binary releases). The recursion level may be changed using the 'maxdepth' parameter:

 

// ---- Set the bit pattern of the Menger enumeration here.

#define DISTANCE0 OFF

#define DISTANCE1 OFF

#define DISTANCE2 ON

#define DISTANCE3 OFF

 

#define WIDTH 0.05

#define STEP 10

 

// Camera settings. Place these before first rule call.

set translation [0.566876 -3.52063 -20]

set rotation [0.596494 -0.797386 0.0913825 0.253351 0.295103 0.921269 -0.761576 -0.526383 0.378044]

set pivot [0 0 0]

set scale 5.35875

 

set background #fff

 

ON

 

rule ON maxdepth 1 > MyBox {

{ s 1/3 } DISTANCE0

 

{ s 1/3 x -1 } DISTANCE1

{ s 1/3 x +1 } DISTANCE1

{ s 1/3 y -1 } DISTANCE1

{ s 1/3 y +1 } DISTANCE1

{ s 1/3 z -1 } DISTANCE1

{ s 1/3 z +1 } DISTANCE1

 

{ s 1/3 x -1 y -1 } DISTANCE2

{ s 1/3 x 1 y -1 } DISTANCE2

{ s 1/3 y -1 z -1 } DISTANCE2

{ s 1/3 y -1 z +1 } DISTANCE2

{ s 1/3 x -1 y 1 } DISTANCE2

{ s 1/3 x 1 y 1 } DISTANCE2

{ s 1/3 y 1 z -1 } DISTANCE2

{ s 1/3 y 1 z +1 } DISTANCE2

{ s 1/3 x -1 z -1 } DISTANCE2

{ s 1/3 x -1 z +1 } DISTANCE2

{ s 1/3 x 1 z -1 } DISTANCE2

{ s 1/3 x 1 z +1 } DISTANCE2

 

{ s 1/3 x 1 y -1 z -1 } DISTANCE3

{ s 1/3 x -1 y -1 z -1} DISTANCE3

{ s 1/3 x -1 y -1 z +1} DISTANCE3

{ s 1/3 x 1 y -1 z +1 } DISTANCE3

{ s 1/3 x -1 y 1 z -1 } DISTANCE3

{ s 1/3 x -1 y 1 z +1 } DISTANCE3

{ s 1/3 x 1 y 1 z -1 } DISTANCE3

{ s 1/3 x 1 y 1 z +1 } DISTANCE3

}

 

// ---- All this below is just to improve the visual style. A single box would do the job

 

rule MyBox {

{ s 0.9 color white } box

{ color black } frame

 

}

 

rule frame {

{ s WIDTH 1 WIDTH x STEP z STEP } box

{ s WIDTH 1 WIDTH x STEP z -STEP } box

{ s WIDTH 1 WIDTH x -STEP z STEP } box

{ s WIDTH 1 WIDTH x -STEP z -STEP } box

 

{ s 1 WIDTH WIDTH y STEP z STEP } box

{ s 1 WIDTH WIDTH y STEP z -STEP } box

{ s 1 WIDTH WIDTH y -STEP z STEP } box

{ s 1 WIDTH WIDTH y -STEP z -STEP } box

 

{ s WIDTH WIDTH 1 y STEP x STEP } box

{ s WIDTH WIDTH 1 y STEP x -STEP } box

{ s WIDTH WIDTH 1 y -STEP x STEP } box

{ s WIDTH WIDTH 1 y -STEP x -STEP } box

 

}

 

rule Off {

}

6,830 views
8 faves
8 comments
Uploaded on January 15, 2009