# teaching machines

## Fabrication Summer Camp: Day 4

May 27, 2021 by . Filed under public, twoville.

Welcome to the fourth day of our summer camp! Laser and vinyl cutters create flat objects. Today we break out of the flat plane into the third dimension. In order to cut these objects with our tools, they must start out flat. But the objects can be folded and assembled into solid shapes. Solid objects that have been laid flat by unfolding them along their edges are sometimes called nets. We’ll make a few nets today.

### Tetrahedron

A tetrahedron is the simplest shape that occupies all three dimensions. It is made of four equilateral triangles. There are several ways to unfold one so that it lies flat. Consider this method:

1. Set the tetrahedron so it’s resting flat on a table.
2. Peel one of the side triangles down so it lies flat.
3. Peel one of the remaining side triangles down so it lies flat.
4. Peel the last side triangle down so it lies flat.

What shape do the flattened triangles form? A bigger equilateral triangle.

We can make this shape in Twoville as a polygon with a bit of turtle geometry:



s = 10

with viewport
size = [s * 4, s * 4]

with polygon()
color = :cornflower
with turtle()
position = [10, 10]
repeat 3
move().distance = s
move().distance = s
turn().degrees = 120

var twovilleDiv = jQuery('#twoville_tetrahedron1');
twovilleDiv.closest('pre').replaceWith(twovilleDiv);
document.getElementById('twoville_form_tetrahedron1').submit();

s = 10

with viewport
size = [s * 4, s * 4]

with polygon()
color = :cornflower
with turtle()
position = [10, 10]
repeat 3
move().distance = s
move().distance = s
turn().degrees = 120



Notice how the internal edges are not visible. We don’t want our cutter to cut through the paper along these edges. However, wouldn’t it be nice if the cutter made a slight cut along them to make the paper easier to fold? Such a cut is called a score. Our cutter can be made to score paper. Let’s trace out these score lines using a path:



s = 10

with viewport
size = [s * 4, s * 4]

with polygon()
color = :cornflower
with turtle()
position = [10, 10]
repeat 3
move().distance = s
move().distance = s
turn().degrees = 120

with path()
with stroke
color = :red
size = 0.1
opacity = 0
with turtle()
position = [10 + s, 10]
repeat 3
move().distance = s
turn().degrees = 120

var twovilleDiv = jQuery('#twoville_tetrahedron2');
twovilleDiv.closest('pre').replaceWith(twovilleDiv);
document.getElementById('twoville_form_tetrahedron2').submit();

s = 10

with viewport
size = [s * 4, s * 4]

with polygon()
color = :cornflower
with turtle()
position = [10, 10]
repeat 3
move().distance = s
move().distance = s
turn().degrees = 120

with path()
with stroke
color = :red
size = 0.1
opacity = 0
with turtle()
position = [10 + s, 10]
repeat 3
move().distance = s
turn().degrees = 120



I’ve colored these lines in red. When I load this design into the cutter, I’ll state that all red lines are scores rather than cuts. I shouldn’t use red for anything else.

Suppose we cut this flat and assembled it into a solid tetrahedron again. The triangles would not stick to each other. We could attach them with tape, which would be visible. To attach them invisibly, we could add tabs along the edges that folded under the neighboring triangle. With a little glue, these tabs would hold the tetrahedron together.

In Twoville, we can add tabs by inserting a tab command right before an command that makes a straight line. Here we add a tab to the first triangle along each edge:



s = 10

with viewport
size = [s * 4, s * 4]

with polygon()
color = :cornflower
with turtle()
position = [10, 10]
repeat 3
tab()
move().distance = s
move().distance = s
turn().degrees = 120

with path()
with stroke
color = :red
size = 0.1
opacity = 0
with turtle()
position = [10 + s, 10]
repeat 3
move().distance = s
turn().degrees = 120

var twovilleDiv = jQuery('#twoville_tetrahedron3');
twovilleDiv.closest('pre').replaceWith(twovilleDiv);
document.getElementById('twoville_form_tetrahedron3').submit();

s = 10

with viewport
size = [s * 4, s * 4]

with polygon()
color = :cornflower
with turtle()
position = [10, 10]
repeat 3
tab()
move().distance = s
move().distance = s
turn().degrees = 120

with path()
with stroke
color = :red
size = 0.1
opacity = 0
with turtle()
position = [10 + s, 10]
repeat 3
move().distance = s
turn().degrees = 120



The tabs also need score lines. We add new segments to our path by tracing along the outer edge again. However, this time we use jump to skip over the triangle that doesn’t have a tab:



s = 10

with viewport
size = [s * 4, s * 4]

with polygon()
color = :cornflower
with turtle()
position = [10, 10]
repeat 3
tab()
move().distance = s
move().distance = s
turn().degrees = 120

with path()
with stroke
color = :red
size = 0.1
opacity = 0
with turtle()
position = [10 + s, 10]
repeat 3
move().distance = s
turn().degrees = 120
with turtle()
position = [10, 10]
repeat 3
move().distance = s
jump().distance = s
turn().degrees = 120

var twovilleDiv = jQuery('#twoville_tetrahedron4');
twovilleDiv.closest('pre').replaceWith(twovilleDiv);
document.getElementById('twoville_form_tetrahedron4').submit();

s = 10

with viewport
size = [s * 4, s * 4]

with polygon()
color = :cornflower
with turtle()
position = [10, 10]
repeat 3
tab()
move().distance = s
move().distance = s
turn().degrees = 120

with path()
with stroke
color = :red
size = 0.1
opacity = 0
with turtle()
position = [10 + s, 10]
repeat 3
move().distance = s
turn().degrees = 120
with turtle()
position = [10, 10]
repeat 3
move().distance = s
jump().distance = s
turn().degrees = 120



When we cut this out, we end up with a tetrahedron that almost makes itself. We just apply a little glue.

### Sealed Box

Now it’s your turn design a net that folds into a box. A box has six sides: four walls on the side, one on the top, and one on the bottom. Here’s one possible unfolding with the four walls on the side in a long strip:

Draw your unfolded box on your graph paper. Label the coordinates of all the faces’ corners. Mark the edges where you would like tabs to appear. Not all of them need tabs; you will need to fold this in your brain to identify the ones that do.

Have your drawing checked by a teacher. After any issues are resolved, head to the computer and code it up. Add score lines between the faces and along the tabs in red. Then we’ll cut it.

### Lidded Box

In our remaining time, you challenge is to make a box with a lid. The bottom of the box is made up of its rectangular base and four walls, plus some tabs to make the walls stick together. The top of the box is made up of its rectangular top and four walls, plus some tabs. Both parts look something like this without tabs:

Where do the tabs go?

For the bottom to fit inside the top, the bottom must be slightly smaller than the top. If you use variables, you can save yourself some effort. Design just one piece in terms of a variable. To produce the second piece, change the value of the variable slightly.

As always, start by drawing your design on graph paper. Check in with a teacher. Then code up your design and we’ll get it cut.