Skip to content

Instantly share code, notes, and snippets.

@heavyimage
Created January 5, 2025 00:46
Show Gist options
  • Save heavyimage/8c7ba8667f3f820f8a1e970947d811d3 to your computer and use it in GitHub Desktop.
Save heavyimage/8c7ba8667f3f820f8a1e970947d811d3 to your computer and use it in GitHub Desktop.
// set seed to 77
set maxobjects 1000000
set minsize 0.1
rule innerbox w 2 {}
rule innerbox w 2 {box}
rule innerbox w 4 {lopbox}
rule innerbox w 4 {{s 1.25} lopbox}
rule innerbox w 1 {
lopbox
{x 0.75 s 0.1 0.1 1.6} box
{x -0.75 s 0.1 0.1 1.6} box
{z 0.75 s 1.5 0.1 0.1} box
{z -0.75 s 1.5 0.1 0.1} box
}
rule lopbox w 1 {{rx 90} lopbox}
rule lopbox w 1 {{rx 180} lopbox}
rule lopbox w 1 {{rx -90} lopbox}
rule lopbox w 1 {{rz 90} lopbox}
rule lopbox w 1 {{rz -90} lopbox}
rule lopbox {
{s 0.5 0.75 0.5 x 0.5 y 0.175 z 0.5} innerbox
{s 0.5 0.75 0.5 x -0.5 y 0.175 z 0.5} innerbox
{s 0.5 0.75 0.5 x 0.5 y 0.175 z -0.5} innerbox
{s 0.5 0.75 0.5 x -0.5 y 0.175 z -0.5} innerbox
{s 0.5 0.25 0.5 x 0.5 y -1.5 z -0.5} innerbox
{s 0.5 0.25 0.5 x -0.5 y -1.5 z -0.5} innerbox
{s 0.5 0.25 0.5 x 0.5 y -1.5 z 0.5} innerbox
{s 0.5 0.25 0.5 x -0.5 y -1.5 z 0.5} innerbox
}
{c white s 10} lopbox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment