Skip to content

Instantly share code, notes, and snippets.

@calebhsu
calebhsu / README.md
Last active August 30, 2015 15:19
Chair using CraftML tags
title author
Making a Chair
Caleb Hsu

Objective: Make a chair with adjustable length and leg height.

Start by making the seat of the chair. We can add parameters after we have determined our dimensions.

@calebhsu
calebhsu / README.md
Last active August 30, 2015 15:19
Bed using CraftML tags
title author
Building a Bed
Caleb Hsu

Objective: Build a bed with adjustable length and leg height.

Start by making the mattress. We can add parameters after we have determined our dimensions.

@calebhsu
calebhsu / index.xml
Last active August 30, 2015 15:19
Heart using CraftML tags
<craft name="heart">
<param name="height" type="int" default="5"/>
<g l="centerX() lineupY(-9.7)">
<row spacing="-2">
<repeat n="2">
<cylinder radius="6" height="{{height}}" t="scale(1,1.2,1)"/></cylinder>
</repeat>
</row>
@calebhsu
calebhsu / README.md
Last active August 30, 2015 15:19
Dresser using CraftML tags
title author
Building a Dresser
Caleb Hsu

Objective: Build a dresser of n drawers. The drawers will be stacked on each other within a rectangular frame.

Let's begin by making the frame. We can add parameters after we have determined our dimensions.

@calebhsu
calebhsu / index.xml
Last active October 11, 2015 03:59
Shelves using CraftML tags
<craft>
<info>
<title>Bookshelf</title>
</info>
<style>
* {color: brown;}
</style>
<param name="shelves" type="int" default="3"/>
@calebhsu
calebhsu / README.md
Last active August 30, 2015 15:19
Picket fence using CraftML tags
title author
Building a Picket Fence
Caleb Hsu

Objective: Build a picket fence with adjustable length and height.

Start by creating a row of picket boards. We can add parameters after we have determined our dimensions.

@calebhsu
calebhsu / index.xml
Last active August 30, 2015 15:19
Simple box using CraftML tags
<craft name="box">
<param name="width" type="int" default="30"/>
<param name="length" type="int" default="30"/>
<param name="height" type="int" default="30"/>
<g>
<stack>
<content></content>
<cube size="{{length}} {{width}} 3" t="translate(3,0,0)"/>
</stack>
@calebhsu
calebhsu / index.xml
Last active August 30, 2015 15:19
Rectangular table using CraftML tags
<craft name="table">
<param name="length" type="int" default="60"/>
<param name="width" type="int" default="40"/>
<param name="legHeight" type="int" default="20"/>
<stack color="brown">
<!-- Top -->
<cube size="{{length}} {{width}} 5"></cube>
<!-- Legs -->
@calebhsu
calebhsu / index.xml
Last active August 30, 2015 15:19
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>
@calebhsu
calebhsu / index.xml
Last active August 29, 2015 14:21
Cooking pot using CraftML tags
<craft name="pot">
<stack spacing="-1">
<sphere radius="2.5" t="scale(1.5,1.5,1)" color="black"/>
<stack spacing="-18">
<sphere radius="15.75" resolution="25" t="scale(1.5,1.5,0.9)" color="silver"/>
<stack color="gray">
<cylinder radius="26" height="2"/>
<cylinder radius="25" height="20"/>
</stack>