Skip to content

Instantly share code, notes, and snippets.

@calebhsu
Last active August 30, 2015 15:19
Show Gist options
  • Save calebhsu/c561d610ff0096c20b9e to your computer and use it in GitHub Desktop.
Save calebhsu/c561d610ff0096c20b9e to your computer and use it in GitHub Desktop.
Coat rack using CraftML tags
<craft name="coatrack">
<param name="length" type="int" default="60"/>
<param name="width" type="int" default="15"/>
<param name="pegs" type="int" default="5"/>
<craft name="peg">
<stack spacing="-0.5">
<sphere radius="2" color="white"></sphere>
<cylinder radius="1" height="5" color="black"></cylinder>
</stack>
</craft>
<stack>
<!-- Pegs -->
<row spacing="{{(length - 20) / pegs}}">
<repeat n="{{pegs}}">
<peg></peg>
</repeat>
</row>
<!-- Base -->
<cube size="{{length}} {{width}} 5" color="brown"></cube>
</stack>
</craft>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment