Mondrian Cube

Mondrian Cube Variants

Structure Synth script for some variants of Mondrian Cube . Images rendered in SunFlow

Mondrian Cube 1

// 3D Mondrian Cube 1

set background #fff

set colorpool list:#F00,#0404A2,#FFFE33,#FFF

mondrian

rule mondrian { a2 } rule a2 w 3 maxdepth 2 > d { { s 0.3334 1 1 x -1 } a2

{ s 0.6666 1 1 x 0.25 } a2

} rule a2 w 3 maxdepth 2 > d { { s 1 0.3334 1 y -1 } a2

{ s 1 0.6666 1 y 0.25 } a2

} rule a2 w 3 maxdepth 2 > d { { s 1 1 0.3334 z -1 } a2

{ s 1 1 0.6666 z 0.25 } a2

} rule a2 w 3 maxdepth 2 > d { { s 0.5 1 1 x -0.5 } a2

{ s 0.5 1 1 x 0.5 } a2

} rule a2 w 3 maxdepth 2 > d { { s 1 0.5 1 y -0.5 } a2

{ s 1 0.5 1 y 0.5 } a2

} rule a2 w 3 maxdepth 2 > d { { s 1 1 0.5 z -0.5 } a2

{ s 1 1 0.5 z 0.5 } a2

} rule d { { s 1 1 1 } square

} rule square { { s 0.95 color random } box { color #eee } frame

} rule square { { s 0.95 color random } box { color #222 } frame

} rule frame { { s 0.1 1 0.05 y 0 x 4.5 z 9.5 } box { s 0.1 1 0.05 y 0 x -4.5 z 9.5 } box 1 * { rz 90 s 0.1 1 0.05} 1 * { y 0 x -4.5 z 9.5 } box 1 * { rz -90} 1 * { s 0.1 1 0.05 y 0 x -4.5 z 9.5 } box { s 0.1 1 0.05 y 0 x 4.5 z -9.5 } box { s 0.1 1 0.05 y 0 x -4.5 z -9.5 } box 1 * { rz 90 s 0.1 1 0.05 } 1 * { y 0 x -4.5 z -9.5 } box 1 * { rz -90 } 1 * { s 0.1 1 0.05 y 0 x -4.5 z -9.5 } box { s 0.05 0.05 1 y 9.5 x -9.5 z 0 } box { s 0.05 0.05 1 y 9.5 x 9.5 z 0 } box { s 0.05 0.05 1 y -9.5 x -9.5 z 0 } box { s 0.05 0.05 1 y -9.5 x 9.5 z 0 } box }

Smiley face

Mondrian Cube 2

//3D Mondrian Cube 2

set background #fff

set colorpool list:#F00,#0404A2,#FFFE33,#FFF

mondrian

rule mondrian { a2 } rule a2 w 3 maxdepth 3 > d { { s 0.3334 1 1 x -1 } a2

{ s 0.6666 1 1 x 0.25 } a2

} rule a2 w 3 maxdepth 3 > d { { s 1 0.3334 1 y -1 } a2

{ s 1 0.6666 1 y 0.25 } a2

} rule a2 w 3 maxdepth 3 > d { { s 1 1 0.3334 z -1 } a2

{ s 1 1 0.6666 z 0.25 } a2

} rule a2 w 3 maxdepth 3 > d { { s 0.5 1 1 x -0.5 } a2

{ s 0.5 1 1 x 0.5 } a2

} rule a2 w 3 maxdepth 3 > d { { s 1 0.5 1 y -0.5 } a2

{ s 1 0.5 1 y 0.5 } a2

} rule a2 w 3 maxdepth 3 > d { { s 1 1 0.5 z -0.5 } a2

{ s 1 1 0.5 z 0.5 } a2

} rule d { { s 1 color random} box }

Smiley face

Mondrian Cube 3

//3D Mondrian Cube 3

#define dis 0.5

set background #000

set colorpool list:#F00,#0404A2,#FFFE33,#FFF

4 * { x 0.5 z -0.5 ry 90 } a2

1 * { z -0.5 y 0.5 rx 90 } 2 * { z 1 rx 180 } a2

{ z -0.5 s 1.1 color #eee } frame

rule a2 w 3 maxdepth 2 > d { { s 0.5 x dis y dis } a2

{ s 0.5 x -dis y dis } a2

{ s 0.5 x dis y -dis } a2

{ s 0.5 x -dis y -dis } a2

} rule a2 w 3 maxdepth 1 > d { { s 0.5 x dis y dis } a2

{ s 0.5 x -dis y dis} a2

{ s 0.5 x dis y -dis } a2

{ s 0.5 x -dis y -dis } a2

} rule a2 w 1 maxdepth 2 > d { { s 0.5 1 1.25 x dis } a2

{ s 0.5 1 1.25 x -dis } a2

} rule a2 w 1 maxdepth 1 > d { { s 1 0.5 1.25 y dis } a2

{ s 1 0.5 1.25 y -dis } a2

} rule d { { s 0.95 color random } box { color #eee } frame

} rule d { { s 0.95 color random } box { color #222 } frame

} rule frame { { s 0.1 1 0.05 y 0 x 4.5 z 9.5 } box { s 0.1 1 0.05 y 0 x -4.5 z 9.5 } box 1 * { rz 90 s 0.1 1 0.05 } 1 * { y 0 x -4.5 z 9.5 } box 1 * { rz -90 } 1 * { s 0.1 1 0.05 y 0 x -4.5 z 9.5 } box { s 0.1 1 0.05 y 0 x 4.5 z -9.5 } box { s 0.1 1 0.05 y 0 x -4.5 z -9.5 } box 1 * { rz 90 s 0.1 1 0.05 } 1 * { y 0 x -4.5 z -9.5 } box 1 * { rz -90} 1 * { s 0.1 1 0.05 y 0 x -4.5 z -9.5 } box { s 0.05 0.05 1 y 9.5 x -9.5 z 0 } box { s 0.05 0.05 1 y 9.5 x 9.5 z 0 } box { s 0.05 0.05 1 y -9.5 x -9.5 z 0 } box { s 0.05 0.05 1 y -9.5 x 9.5 z 0 } box }

Smiley face

Mondrian Cube 4

//3D Mondrian Cube 4

#define dis 0.55

set colorpool list:#F00,#0404A2,#FFFE33,#FFF

set background #fff

4 * { x 0.55 z -0.55 ry 90 } a2

1 * { z -0.55 y 0.55 rx 90 } 2 * { z 1.1 rx 180 } a2

rule a2 w 3 maxdepth 2 > d { { s 0.5 0.5 1 x dis y dis } a2

{ s 0.5 0.5 1 x -dis y dis } a2

{ s 0.5 0.5 1 x dis y -dis } a2

{ s 0.5 0.5 1 x -dis y -dis } a2

} rule a2 w 3 maxdepth 2 > d { { s 0.5 0.5 1 x dis y dis } a2

{ s 0.5 0.5 1 x -dis y dis } a2

{ s 0.5 0.5 1 x dis y -dis } a2

{ s 0.5 0.5 1 x -dis y -dis } a2

} rule a2 w 3 maxdepth 1 > d { { s 0.5 0.5 1 x dis y dis } a2

{ s 0.5 0.5 1 x -dis y dis } a2

{ s 0.5 0.5 1 x dis y -dis } a2

{ s 0.5 0.5 1 x -dis y -dis } a2

} rule d w 2 { { s 0.9 0.9 0.01 color random } box { s 1 1 0.25 color #111 } frame

} rule d w 2 { { s 0.9 0.9 0.01 color random } box { s 1 1 0.25 color #eee } frame

} rule frame { { s 1.1 0.1 0.1 y 5 x 0 } box { s 0.1 1 0.1 y 0 x 5 } box { s 1.1 0.1 0.1 y -5 x 0 } box { s 0.1 1 0.1 y 0 x -5 } box }

Smiley face

Mondrian Cube 5

//3D Mondrian Cube 5

#define dis 0.55

set colorpool list:#F00,#0404A2,#FFFE33,#FFF

set background #000

a2

rule a2 w 3 maxdepth 2 > d { { s 0.5 0.5 0.5 x dis y dis z dis } a2

{ s 0.5 0.5 0.5 x -dis y dis z dis } a2

{ s 0.5 0.5 0.5 x dis y -dis z dis } a2

{ s 0.5 0.5 0.5 x -dis y -dis z dis } a2

{ s 0.5 0.5 0.5 x dis y dis z -dis } a2

{ s 0.5 0.5 0.5 x -dis y dis z -dis } a2

{ s 0.5 0.5 0.5 x dis y -dis z -dis } a2

{ s 0.5 0.5 0.5 x -dis y -dis z -dis } a2

} rule a2 w 3 maxdepth 1 > d { { s 0.5 0.5 0.5 x dis y dis z dis } a2

{ s 0.5 0.5 0.5 x -dis y dis z dis } a2

{ s 0.5 0.5 0.5 x dis y -dis z dis } a2

{ s 0.5 0.5 0.5 x -dis y -dis z dis } a2

{ s 0.5 0.5 0.5 x dis y dis z -dis } a2

{ s 0.5 0.5 0.5 x -dis y dis z -dis } a2

{ s 0.5 0.5 0.5 x dis y -dis z -dis } a2

{ s 0.5 0.5 0.5 x -dis y -dis z -dis } a2

} rule a2 w 3 maxdepth 1 > d { { s 0.5 0.5 0.5 x dis y dis z dis } a2

{ s 0.5 0.5 0.5 x -dis y dis z dis } a2

{ s 0.5 0.5 0.5 x dis y -dis z dis } a2

{ s 0.5 0.5 0.5 x -dis y -dis z dis } a2

{ s 0.5 0.5 0.5 x dis y dis z -dis } a2

{ s 0.5 0.5 0.5 x -dis y dis z -dis } a2

{ s 0.5 0.5 0.5 x dis y -dis z -dis } a2

{ s 0.5 0.5 0.5 x -dis y -dis z -dis } a2

} rule d w 2 { { color #eee } frame

{ color random } box } rule d w 2 { { color #222 } frame

{ color random } box } rule frame { { s 0.1 1.1 0.1 x 5 z 5 } box { s 0.1 1.1 0.1 x 5 z -5 } box { s 0.1 1.1 0.1 x -5 z 5 } box { s 0.1 1.1 0.1 x -5 z -5 } box { s 1 0.1 0.1 y 5 z 5 } box { s 1 0.1 0.1 y 5 z -5 } box { s 1 0.1 0.1 y -5 z 5 } box { s 1 0.1 0.1 y -5 z -5 } box { s 0.1 0.1 1 y 5 x 5 } box { s 0.1 0.1 1 y 5 x -5 } box { s 0.1 0.1 1 y -5 x 5 } box { s 0.1 0.1 1 y -5 x -5 } box }

Smiley face

Mondrian Cube 6

// 3D Mondrian Cube 6

set background white

set colorpool list:#F00,#0404A2,#FFFE33,#FFF

4 * { x 0.5 z -0.5 ry 90 } a2

1 * { z -0.5 y 0.5 rx 90 } 2 * { z 1 rx 180 } a2

{ z -0.5 s 1.09 color #555 } frame

rule a2 w 2 maxdepth 2 > d { { s 0.3334 1 1 x -1 } a2

{ s 0.3334 1 1 x 0.0 } a2

{ s 0.3334 1 1 x 1.0 } a2

} rule a2 w 2 maxdepth 2 > d { { s 1 0.3334 1 y -1 } a2

{ s 1 0.3334 1 y 1 } a2

{ s 1 0.3334 1 y 0 } a2

} rule d { { s 1 1 0.1 } square

} rule square { { s 0.95 color random } box { color #eee } frame

} rule square { { s 0.95 color random } box { color #222 } frame

} rule frame { { s 0.1 1 0.05 y 0 x 4.5 z 9.5 } box { s 0.1 1 0.05 y 0 x -4.5 z 9.5 } box 1 * { rz 90 s 0.1 1 0.05} 1 * { y 0 x -4.5 z 9.5 } box 1 * { rz -90} 1 * { s 0.1 1 0.05 y 0 x -4.5 z 9.5 } box { s 0.1 1 0.05 y 0 x 4.5 z -9.5 } box { s 0.1 1 0.05 y 0 x -4.5 z -9.5 } box 1 * { rz 90 s 0.1 1 0.05 } 1 * { y 0 x -4.5 z -9.5 } box 1 * { rz -90 } 1 * { s 0.1 1 0.05 y 0 x -4.5 z -9.5 } box { s 0.05 0.05 1 y 9.5 x -9.5 z 0 } box { s 0.05 0.05 1 y 9.5 x 9.5 z 0 } box { s 0.05 0.05 1 y -9.5 x -9.5 z 0 } box { s 0.05 0.05 1 y -9.5 x 9.5 z 0 } box }

Smiley face