# Dodecahedron

The Dodecahedron has 20 vertices and 12 faces. The face is a pentagon with 5 vertices. There are 5 Platonic solids. The face of the cube has 4 vertices, a square, the remaining solids, the tetrahedron, the octahedron and the icosahedron, each have a face with 3 vertices. For those first 4 solids i used the Autocad 3DFace object. It takes an argument list of 4 points. It can draw either a 4 sided figure, or a 3 sided figure by duplicating the last two points, and that is all. The “Autocad 2011 Quick Reference” by Ralph Grabowski says the 3DFace object was added to the program all the way back in V2.6. That was 1986! Autodesk programmers have moved on. They have over time added Solids, Surfaces and Meshes, but I do not see an object like 3DFace that can draw a polygon in 3D space. Add3DMesh is intended to be rectangular. AddPolyFaceMesh can do it, but it has the same 4 point limit. two co-planar faces have to be created, one of them quadrilateral the other triangular. It could be made to work, but its not elegant and there are potentially many many-sided figures we may want to draw. A Region could be drawn then extruded to a very thin solid, such as .001, but that’s not elegant either. The old 3DFace object is designed like an Euclidean plane, with defined edges and no thickness.

The Region object by itself is what we want, paired with a 3D Polyline to define it. I made a subroutine dedicated to drawing pentagons in 3D space given the 5 vertices.

First we compute the vertices xyz coordinates and put them into a spreadsheet. next the data is manually sorted by descending Z value and by quadrant, just to give it a little geometric order on the screen. we get the formula from wikipedia.

```Sub dodecahedron()
'12 faces and 20 vertices

'create phi
Dim p As Double
p = 1.6180339887

Dim pt1(0 To 2) As Double
Dim pt2(0 To 2) As Double
Dim pt3(0 To 2) As Double
Dim pt4(0 To 2) As Double
Dim pt5(0 To 2) As Double
Dim pt6(0 To 2) As Double
Dim pt7(0 To 2) As Double
Dim pt8(0 To 2) As Double
Dim pt9(0 To 2) As Double
Dim pt10(0 To 2) As Double
Dim pt11(0 To 2) As Double
Dim pt12(0 To 2) As Double
Dim pt13(0 To 2) As Double
Dim pt14(0 To 2) As Double
Dim pt15(0 To 2) As Double
Dim pt16(0 To 2) As Double
Dim pt17(0 To 2) As Double
Dim pt18(0 To 2) As Double
Dim pt19(0 To 2) As Double
Dim pt20(0 To 2) As Double

Call initpt(pt1, 0, 1 / p, p)
Call initpt(pt2, 0, -1 / p, p)
Call initpt(pt3, 1, 1, 1)
Call initpt(pt4, -1, 1, 1)
Call initpt(pt5, -1, -1, 1)
Call initpt(pt6, 1, -1, 1)
Call initpt(pt7, p, 0, 1 / p)
Call initpt(pt8, -p, 0, 1 / p)
Call initpt(pt9, 1 / p, p, 0)
Call initpt(pt10, -1 / p, p, 0)
Call initpt(pt11, -1 / p, -p, 0)
Call initpt(pt12, 1 / p, -p, 0)
Call initpt(pt13, p, 0, -1 / p)
Call initpt(pt14, -p, 0, -1 / p)
Call initpt(pt15, 1, 1, -1)
Call initpt(pt16, -1, 1, -1)
Call initpt(pt17, -1, -1, -1)
Call initpt(pt18, 1, -1, -1)
Call initpt(pt19, 0, 1 / p, -p)
Call initpt(pt20, 0, -1 / p, -p)

'drawing and labeling points is not required in the finish program
'but is almost essential for deciding
'which points are the vertices for which faces
Call point(pt1, &quot;pt1&quot;)
Call point(pt2, &quot;pt2&quot;)
Call point(pt3, &quot;pt3&quot;)
Call point(pt4, &quot;pt4&quot;)
Call point(pt5, &quot;pt5&quot;)
Call point(pt6, &quot;pt6&quot;)
Call point(pt7, &quot;pt7&quot;)
Call point(pt8, &quot;pt8&quot;)
Call point(pt9, &quot;pt9&quot;)
Call point(pt10, &quot;pt10&quot;)
Call point(pt11, &quot;pt11&quot;)
Call point(pt12, &quot;pt12&quot;)
Call point(pt13, &quot;pt13&quot;)
Call point(pt14, &quot;pt14&quot;)
Call point(pt15, &quot;pt15&quot;)
Call point(pt16, &quot;pt16&quot;)
Call point(pt17, &quot;pt17&quot;)
Call point(pt18, &quot;pt18&quot;)
Call point(pt19, &quot;pt19&quot;)
Call point(pt20, &quot;pt20&quot;)

Call draw_pentagon(pt1, pt2, pt6, pt7, pt3)
Call draw_pentagon(pt1, pt2, pt5, pt8, pt4)
Call draw_pentagon(pt1, pt3, pt9, pt10, pt4)
Call draw_pentagon(pt2, pt6, pt12, pt11, pt5)
Call draw_pentagon(pt6, pt7, pt13, pt18, pt12)
Call draw_pentagon(pt3, pt9, pt15, pt13, pt7)
Call draw_pentagon(pt5, pt11, pt17, pt14, pt8)
Call draw_pentagon(pt11, pt12, pt18, pt20, pt17)
Call draw_pentagon(pt4, pt8, pt14, pt16, pt10)
Call draw_pentagon(pt9, pt10, pt16, pt19, pt15)
Call draw_pentagon(pt13, pt15, pt19, pt20, pt18)
Call draw_pentagon(pt16, pt14, pt17, pt20, pt19)

End Sub

Sub draw_pentagon(pt1() As Double, pt2() As Double, pt3() As Double, pt4() As Double, pt5() As Double)
Dim regionObj As Variant
Dim vtx(0 To 14) As Double

vtx(0) = pt1(0): vtx(1) = pt1(1): vtx(2) = pt1(2)
vtx(3) = pt2(0): vtx(4) = pt2(1): vtx(5) = pt2(2)
vtx(6) = pt3(0): vtx(7) = pt3(1): vtx(8) = pt3(2)
vtx(9) = pt4(0): vtx(10) = pt4(1): vtx(11) = pt4(2)
vtx(12) = pt5(0): vtx(13) = pt5(1): vtx(14) = pt5(2)

'3D polyline takes an array of doubles
polyobj.Closed = True

'in this case an array of one entity
Set entarray(0) = polyobj