# the Platonic Solids

There are 5 and only 5 solids that are made with every side the same figure. The Greeks were fascinated by these solids. Plato tried to explain all of creation with them (fire is like the tetrahedron, etc).

first lets make a helper sub to initialize 3D points.

Sub initpt(ByRef ptn() As Double, val1, val2, val3)
ptn(0) = val1: ptn(1) = val2: ptn(2) = val3
End Sub

The tetrahedron has 4 points called vertices and 4 faces. An easy way to draw it is with one point in each of the 4 quadrants, points opposite each other across the origin are at the same Z coordinate.

Sub tetrahedron2()

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

Call initpt(pt1, 1, 1, 1)
Call initpt(pt2, -1, 1, -1)
Call initpt(pt3, -1, -1, 1)
Call initpt(pt4, 1, -1, -1)

'Call point(pt1, &quot;pt1&quot;)
'Call point(pt2, &quot;pt2&quot;)
'Call point(pt3, &quot;pt3&quot;)
'Call point(pt4, &quot;pt4&quot;)

'creates 3DFace
Dim objent As Acad3DFace
Set objent = acadDoc.ModelSpace.Add3DFace(pt1, pt3, pt2, pt2)
Set objent = acadDoc.ModelSpace.Add3DFace(pt1, pt3, pt4, pt4)
Set objent = acadDoc.ModelSpace.Add3DFace(pt2, pt4, pt1, pt1)
Set objent = acadDoc.ModelSpace.Add3DFace(pt2, pt4, pt3, pt3)

objent.Update
End Sub

switching the sign on the Z elevations will produce the rotated version, drawn here in a one unit square transparent box, which is also a Platonic solid. the 8 points for the box are organized by quadrants.

Sub box1()
Dim intviz As Integer
intviz = 67

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

Call initpt(pt1, 1, 1, 1)
Call initpt(pt2, -1, 1, 1)
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, -1, -1, -1)
Call initpt(pt8, 1, -1, -1)

'creates 3DFace
Dim objent As Acad3DFace
Set objent = acadDoc.ModelSpace.Add3DFace(pt1, pt4, pt8, pt5)
objent.EntityTransparency = intviz

Set objent = acadDoc.ModelSpace.Add3DFace(pt1, pt2, pt6, pt5)
objent.EntityTransparency = intviz

Set objent = acadDoc.ModelSpace.Add3DFace(pt2, pt3, pt7, pt6)
objent.EntityTransparency = intviz

Set objent = acadDoc.ModelSpace.Add3DFace(pt3, pt4, pt8, pt7)
objent.EntityTransparency = intviz

Set objent = acadDoc.ModelSpace.Add3DFace(pt1, pt2, pt3, pt4)
objent.EntityTransparency = intviz

Set objent = acadDoc.ModelSpace.Add3DFace(pt5, pt6, pt7, pt8)
objent.EntityTransparency = intviz

objent.Update
End Sub

the octahedron has 6 vertices and 8 faces.

Sub octahedron()
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

Call initpt(pt1, 1, 0, 0)
Call initpt(pt2, 0, 1, 0)
Call initpt(pt3, -1, 0, 0)
Call initpt(pt4, 0, -1, 0)
Call initpt(pt5, 0, 0, 1)
Call initpt(pt6, 0, 0, -1)

'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;)

'creates 3DFace
Dim objent As Acad3DFace
'top half
Set objent = acadDoc.ModelSpace.Add3DFace(pt1, pt2, pt5, pt5)
Set objent = acadDoc.ModelSpace.Add3DFace(pt2, pt3, pt5, pt5)
Set objent = acadDoc.ModelSpace.Add3DFace(pt3, pt4, pt5, pt5)
Set objent = acadDoc.ModelSpace.Add3DFace(pt4, pt1, pt5, pt5)

'bottom half
Set objent = acadDoc.ModelSpace.Add3DFace(pt1, pt2, pt6, pt6)
Set objent = acadDoc.ModelSpace.Add3DFace(pt2, pt3, pt6, pt6)
Set objent = acadDoc.ModelSpace.Add3DFace(pt3, pt4, pt6, pt6)
Set objent = acadDoc.ModelSpace.Add3DFace(pt4, pt1, pt6, pt6)

objent.Update
End Sub