You're reading: Irregulars

Geogebra to Cake in Five Steps

Flower design using Reflect Object in Circle tool in Geogebra
Tessellated squares design using Reflect Object in Circle tool in Geogebra

In the Aperiodical’s Big Internet Math-Off 2019, Becky Warren posted an entry about Geogebra’s ‘reflect object in circle’ tool (it’s the second article in the post). I enjoyed playing with the tool and, after making a few colourful designs, it occurred to me that one of them would make a great cake for the MathsJam bake-off. It would only work if the curves were accurate; sadly this would be beyond my drawing abilities, and definitely beyond my piping abilities. But with some help from 3D printing I thought I might be able to manage it.

Here are the steps I used to transfer the design to a cake.

Step 1 (Geogebra) – Save as an image

I started by simplifying the design. Squares are straightforward, so I only needed the part within the centre circle. I hid all the squares and removed all the colours, then thickened the lines to make them easier to see. Finally, I took a screenshot and saved it as a bitmap image.

Simplified circle from centre of tessellated squares design

Step 2 (Inkscape) – Convert image to path and generate scad

The next step was to use Inkscape to convert the image into an OpenSCAD file that can be used for 3D printing. If you google ‘Inkscape OpenSCAD’ you’ll find several extensions that will do this; I used Paths2OpenSCAD.

To generate the scad, start by importing the image into Inkscape. Then, with the image selected, go to Path > Trace Bitmap. This opens up a window with lots of options; accept the default and click OK, then close the window. Inkscape has now converted the image into a vector path; this means that it has coordinates for each point on the path.

Now go to Extensions > Generate from Path > Paths to OpenSCAD. This opens up another window. In the output file box, enter the location to save the scad file, then click OK. Now you can open the file in OpenSCAD.

Inkscape screenshot

Step 3 (OpenSCAD) – Scale design

The generated OpenSCAD file starts like this.

OpenSCAD screenshot

It has a method called ‘poly_path854’ (a new number is generated for each file). This method uses the coordinates of the points on the path from Inkscape to make a polygon in OpenSCAD.

Pressing F5 to preview shows a replica of the image, rendered as a 3D model.

Preview of design in OpenSCAD

At the very end of the file is a line that calls the ‘poly_path854’ method, passing in a number. The number is the height of the object when printed – you can change this to suit your needs.

The part that I found difficult was to work out the size the model would be when it was printed. The axes on the OpenSCAD preview window give some indication, but it’s not possible to read accurate values from it. I wanted my model sized appropriately to match a square cutter that I already owned. In the end, I printed out a 1 mm high model so that I could measure the original size without wasting too much plastic, then I scaled the entire model to match the square cutter. The final line of the file became

scale([6/(4.2*sqrt(2)),6/(4.2*sqrt(2)),1]){
     poly_path854(5);
 }

Step 4 – Print

I sent the model to the printer, and a few hours later I had my cutter!

3D-printed cutter

Step 5 – Imprint on cake

Once I had baked the cake and covered it in fondant, I used the cutter to make an imprint of the design on the icing.

Imprint of cutter in icing on cake

Now it only remained to cut the squares around the edges and give it some colour. I used a small amount of vodka to thin out paste food colouring so that I could paint on the fondant icing. (Honestly, it was a tiny amount of vodka – less than 5 ml over the entire cake.)

That’s it! Geogebra to cake in five steps. Here’s the finished cake, alongside the original design in Geogebra.

Reflections in Circle cake
Reflections in Circle original design in Geogebra

(will not be published)

$\LaTeX$: You can use LaTeX in your comments. e.g. $ e^{\pi i} $ for inline maths; \[ e^{\pi i} \] for display-mode (on its own line) maths.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>