# teaching machines

## Octajewel

March 23, 2017 by . Filed under madeup, public, spring 2017.

Madeup has a good number of solidifiers, but I’m always encountering compelling algorithmic shapes that don’t like to be modeled out of cylinders, boxes, spheres, extrusions, or revolutions. This has led to the addition of parametric surfaces, boolean mesh operations, and metaballs. But none of these were up to task of modeling my three-year-old’s Duplo fire hydrant, which has a square base, but a round everything else. How do I model an object whose cross section changes so drastically?

Ask a conventional 3D modeler how they’d do this, and they would suggest lofting. With lofting, we model the interesting contours of an object and then fill the space between these contours with triangles.

Here’s an interactive version:



for i through 8
angle = 45 * i
x = radius * cos (angle + twist)
z = radius * sin (angle + twist)
moveto x, y, z
end
end

moveto 0, -7, 0
a = path

octagon 0, 5, 0
b = path

octagon 1.5, 4, 45 * 0.5
c = path

moveto 0, 1.5, 0
d = path

loft {a, b, c, d}

var mupDiv = jQuery('#mup_octajewel');
mupDiv.closest('pre').replaceWith(mupDiv);
document.getElementById('mup_form_octajewel').submit();

for i through 8
angle = 45 * i
x = radius * cos (angle + twist)
z = radius * sin (angle + twist)
moveto x, y, z
end
end

moveto 0, -7, 0
a = path

octagon 0, 5, 0
b = path

octagon 1.5, 4, 45 * 0.5
c = path

moveto 0, 1.5, 0
d = path

loft {a, b, c, d}



Now to try out the fire hydrant.