Monday, 2 June 2025

3D Printing : Platonic Solids

 Intro

I have previously been successful in defining a tetrahedron, the simplest 3D object, in STL.
Along the way I found that OpenSCAD is my preferred tool for creating STL files.  In OpenSCAD you can define a polyhedron in terms of its vertices and faces.  It is then a simple matter for SCAD to turn this into STL.  In fact I don't think I need to look at raw ASCII STL further because the SCAD "program" defines the object at a low level.

Following completion of a tetrahedron it makes sense to define the four other platonic solids in SCAD.
Wikipedia gives us a good start by defining vertex co-ordinates for the solids.

Octahedron

An octahedron has 6 vertices and 8 faces.  Armed with a suitable picture it is quite easy to label the vertices v0-v7.  I could then define three vertices for each visible face (in clockwise order, looking into the tetrahedron).  It was slightly harder to determine vertices for the hidden faces.  I wrote down the answer "looking through" the solid and reversed their order so they were clockwise.

I could then draw the octahedron in SCAD.  Although vertices are in the simplest form they do not provide a "flat-bottomed" object to print.  I struggled a bit then realised that I need two rotations for a flat-bottom.  Firstly 45 degrees around Z then, after a bit of trignonometry revision, 54.7 degrees around Y.

The result looks good and printed perfectly.




Icosahedron



I found good pictures for an icosahedron at sacred-geometry 

As usual work is required to define the faces which are not visible from the front. I started by creating a polyhedron with 5 trianglular faces touching point Z.  It was then an easy matter to go round the 10 triangles in the middle layer and 5 more to the bottom vertex.

The model produces needed to be rotated around the X-axis. The calculation for this is tan α = (φ-1/ φ) which gives a rotation 20.9052°



Cube

The cube is extremely simple to crate in SCAD and it doesn't require any rotation.  AS STL requires triangular faces the final ASCII STL output has 12 triangular faces instead of six squares.




Dodecahedron

I found it difficult to determine the vertices making up the six invisible faces of a dodecahedron even using the helpful diagrams.

Each time I worked out a face I added to the SCAD model so I could check it was correct and I gradually built up the final shape.  I could then work out the rotation (31.7 degrees) to give it a flag bottom and print it.

Outro

SCAD provides a great platform to build 3D polyhedra.  The Platonic solids all have convenient co-ordinates so most of the work involved in making the model is to determine which vertices make up each face.
I have noticed that others define their solids in SCAD in a different way, so I may investigate further.



No comments:

Post a Comment