What is the simplest method for coloring each polygon face of a polyhedron with a specified color? For instance suppose I have a list of $12$ colors ({ Red, Green, ... }) I would like to apply to the different faces of a PolyhedronData["Dodecahedron"] in some assigned order and keep the entity as a Dodecahedron.


3 Answers 3

faces = First@Normal@PolyhedronData["Dodecahedron", "Faces"];
colors = Table[ColorData[97, i], {i, 12}];
Graphics3D@Riffle[colors, faces]

Mathematica graphics

  • $\begingroup$ Yep... short and sweet. Thanks. ($\checkmark$) $\endgroup$ Aug 19, 2019 at 21:45

You can get the polygons directly using the property "Polygons":

polygons = PolyhedronData["Dodecahedron", "Polygons"];
colors = ColorData[97]/@Range[12];

Graphics3D[Transpose[{colors, polygons}]]

enter image description here


This works, but could be improved:

myVertices = N@PolyhedronData["Dodecahedron", "Vertices"];
myFaceIndices = PolyhedronData["Dodecahedron", "Faces"];
mycolors = {Red, Orange, Yellow, Green, Blue, Orange, Black, White, 
   Purple, Green, Red, Yellow};
 Transpose[{mycolors, (Polygon[myVertices[[#]]] & /@ myFaceIndices)}]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.