What a delightful challenge!
A pentakis dodecahedron (PD) is a Catalan solid, dual to the truncated icosahedron. It's composed of 60 isosceles triangular faces, 90 edges, and 32 vertices. Here's a pseudocode to generate its 3D coordinates:
PentakisDodecahedron Generation Pseudocode
Constants
phi = Golden Ratio ≈ 1.61803398875
R = Circumradius (scale factor, adjust to desired size)
epsilon = Small value for floating-point precision (e.g., 1e-6)
Step 1: Calculate Dodecahedron Vertices
Generate the 20 vertices of a regular dodecahedron (RD) inscribed in a sphere with radius R.
FOR i FROM 0 TO 19 DO
theta = 2 * PI * i / 20 // azimuthal angle
IF i MOD 2 == 0 THEN
phi_rad = ACOS(1 / sqrt(5)) // elevation angle for even indices
ELSE
phi_rad = PI - ACOS(1 / sqrt(5)) // elevation angle for odd indices
END IF
x = R * COS(theta) * SIN(phi_rad)
y = R * SIN(theta) * SIN(phi_rad)
z = R * COS(phi_rad)
RD_vertex[i] = (x, y, z)
END FOR
Step 2: Calculate Truncated Icosahedron (TI) Face Centers
The PD vertices are the face centers of the TI. We'll use these to construct the PD.
TI_face_centers = [] // empty list
FOR each face of the Truncated Icosahedron DO
// TI has 12 pentagonal and 20 hexagonal faces
// We'll use the RD vertices to compute face centers
IF face is pentagonal THEN
// average 5 RD vertices ( indices: i, i+1, i+2, i+3, i+4, modulo 20 )
center = (RD_vertex[i] + RD_vertex[(i+1) MOD 20] + RD_vertex[(i+2) MOD 20] +
RD_vertex[(i+3) MOD 20] + RD_vertex[(i+4) MOD 20]) / 5
ELSE // hexagonal face
// average 6 RD vertices ( indices: i, i+1, i+2, i+3, i+4, i+5, modulo 20 )
center = (RD_vertex[i] + RD_vertex[(i+1) MOD 20] + RD_vertex[(i+2) MOD 20] +
RD_vertex[(i+3) MOD 20] + RD_vertex[(i+4) MOD 20] + RD_vertex[(i+5) MOD 20]) / 6
END IF
APPEND center TO TI_face_centers
END FOR
Step 3: Compute PD Vertices (from TI face centers)
Scale the TI face centers radially to create the 32 PD vertices.
PD_vertices = [] // empty list
FOR each center IN TI_face_centers DO
// Normalize center vector and scale by R * (3 * phi + 1) / 11
length = SQRT(center.x^2 + center.y^2 + center.z^2)
scaled_center = (center.x / length * R * (3 * phi + 1) / 11,
center.y / length * R * (3 * phi + 1) / 11,
center.z / length * R * (3 * phi + 1) / 11)
APPEND scaled_center TO PD_vertices
END FOR
Step 4: Compute PD Faces (60 isosceles triangles)
Each PD vertex is connected to its 5 or 6 nearest neighbors (depending on whether it's a "peak" or "valley" vertex). Use a nearest-neighbor search (e.g., k-d tree or brute-force) to find the 5 or 6 closest PD vertices for each vertex.
PD_faces = [] // empty list
FOR each vertex v IN PD_vertices DO
neighbors = NEAREST_NEIGHBORS(v, PD_vertices, 6) // find 6 closest vertices
FOR each neighbor n IN neighbors DO
IF v IS_NOT_EQUAL n AND (v, n) IS_NOT_IN PD_faces THEN
// Create 2 triangles (v, n, common_neighbor) for each valid neighbor pair
common_neighbors = INTERSECTION(neighbors_of(v), neighbors_of(n))
FOR each common_neighbor c IN common_neighbors DO
APPEND (v, n, c) TO PD_faces // isosceles triangle
END FOR
END IF
END FOR
END FOR
// Clean up duplicates and non-triangular faces (shouldn't happen, but just in case)
REMOVE_DUPLICATES(PD_faces)
REMOVE_NON_TRIANGLES(PD_faces)
Output
You now have:
PD_vertices: 32 3D coordinates representing the vertices of the pentakis dodecahedron.
PD_faces: 60 triangular faces, each defined by 3 vertex indices into PD_vertices.
Rendering
Pass PD_vertices and PD_faces to your favorite 3D rendering engine or library (e.g., Three.js, Matplotlib, or Blender Python API). Adjust R to scale the model as desired.
Notes
- This pseudocode uses 0-based indexing.
- To ensure correctness, verify the Euler's formula for polyhedra:
V - E + F = 2 (32 - 90 + 60 = 2).
- The
(3 * phi + 1) / 11 scaling factor in Step 3 is derived from the geometry of the PD and TI.
- If you're implementing this in a programming language, use a robust nearest-neighbor search library to avoid numerical issues.
Happy coding, and enjoy your beautiful pentakis dodecahedron!