Informal learningTechnology

Tinkercad released Codeblocks last June, and now that it's out of beta, Pioneer Pioneer Rob Morrill tells us how he uses it at St. Matthew's Episcopal Day School.

Tinkercad has brought coding to its 3D modeling platform with the introduction of the web app Codeblocks. Rather than drawing the design, as one might in a turtle art graphics environment, this is object-oriented programming, meaning that you place a predefined object on the workplane and then modify it. The basket in the example below consists of a six-sided torus shape that is repeatedly rotated up and around 27 times to form a circle.

In traditional Tinkercad, you build models by dragging basic shapes like a box, cone, or wedge onto the workplane. Codeblocks is similar, but rather than dragging a shape out to the workplane and then resizing it, you drag a block of code for an object whose parameters you can adjust.

Note that the shape loads on the workplane at X, Y, Z coordinates 0, 0, 0. This means that half of a 20 x 20 x 20 millimeter cube will be underneath the workplane. Red, green, and blue lines delineate X, Y, and Z respectively. Following the Add Box block with a purple Move block with a value of 10 for the Z axis will raise the cube to sit on the workplane.

Here, a box and a sphere have been added and raised in the Z axis, while the cone was not only raised and rotated 180 degrees, but also turned into a hole.

Adding a Create Group block groups these three shapes together.

The power of Codeblocks becomes apparent the more you take advantage of coding aspects like loops and variables to control and iterate your designs. Here is a simple loop that uses a variable to rotate rings around 0, 0, 0.

This laser-cut cardboard disk helps students understand the polar and Cartesian movements in the Codeblocks environment.

Add a torus shape to 0, 0, 0.

Move the torus in a positive Y direction.

Rotate the torus around 0, 0, 0.

Add, move, and rotate a second torus.

Add, move, and rotate a third torus.

Repeat 8 times.

This basket is made up of hearts that have been duplicated and rotated.

The export button allows you to export as STL or OBJ files for 3D printing, but you can also export the design as a “Part”.

When you save a Part, the design becomes available back in traditional Tinkercad, where you can resize it and add it to other creations.

The red elements of this design have been added to the original blue Codeblocks design using traditional Tinkercad.

These earrings were designed in Codeblocks and then laser cut.

The sides of this lamp were designed using a combination of traditional Tinkercad and Codeblocks.

This clock’s face was designed in Codeblocks and laser cut.

For a good introduction to generative design, see “Some Thoughts on Generative Art” by Anders Hoff, and watch Kate Compton’s presentation “Generative Art (and Games and More)” from JSConf Iceland.

Codeblocks also makes it easy to experiment with generative design. The building heights in this cityscape and the ridges in this Martian crater were randomly generated.

Another great feature of Codeblocks for teachers and learners is the ease with which you can comment on your code. This helps students make their thinking visible, which aids both in their own metacognition as well as in allowing teachers to gain insight into their understanding.