Polyhedra

MATH 261 Computational Geometry

Here is a function that draws a polyhedron:

draw3D[poly_]:=Graphics3D[{EdgeForm[Thick],FaceForm[Opacity[0.9]],PolyhedronData[poly,"GraphicsComplex"]},Boxed->False]

Try it out:

draw3D[{"Dipyramid",5}]

draw3D["TriaugmentedTriangularPrism"]

draw3D["SnubDisphenoid"]

draw3D["GyroelongatedSquareDipyramid"]

draw3D["StellatedTetrahedron"]

Graphics3D[AugmentedPolyhedron[Cube[],Sqrt[2]/2]]

The next function colors faces of polyhedra by their number of edges. (Code modified from https://reference.wolfram.com/language/ref/PolyhedronData.html .)

colorFaces3D[poly_]:=Module[
{color=Association[{3->Red,4->Orange,5->Yellow,6->Green,7->Cyan,8->Blue,9->Magenta,10->Purple}],
gc=PolyhedronData[poly,"GraphicsComplex"]},
Graphics3D[
GraphicsComplex[N[gc[[1]]],({Glow[color[Length[First[#]]]],Polygon[#]}&)/@SplitBy[Sort[gc[[2,1]]],Length]],
Sequence[Boxed->False,Lighting->None,Method->{"ShrinkWrap"->True}]
]
]

Try it out :

colorFaces3D["GreatRhombicosidodecahedron"]

colorFaces3D["GreatRhombicuboctahedron"]

colorFaces3D["Rhombicuboctahedron"]

colorFaces3D["Rhombicosidodecahedron"]

colorFaces3D["SnubCube"]

colorFaces3D["SnubDodecahedron"]

colorFaces3D/@PolyhedronData["Antiprism"]

Truncations

Manipulate[Graphics3D[{EdgeForm[Thick],FaceForm[Opacity[0.9]],TruncatedPolyhedron[Icosahedron[],length]},Boxed->False],{length,0,0.5}]