-2
$\begingroup$

PolyhedronData[] gives a nice collection of polyhedra. And calling PolyhedronData["DodecahedronIcosahedronCompound", "Image"] will give you a nice image of a polyhedron entity. But how does one go about finding the actual Wolfram Language code that will draw this image? The reason I need this is that I'd like to tweak that with additional options such as colors, textures, lighting etc and produce something I want.

$\endgroup$
2
  • 4
    $\begingroup$ PolyhedronData["DodecahedronIcosahedronCompound"]//FullForm, you probably need PolyhedronData["DodecahedronIcosahedronCompound", "Faces"] though. $\endgroup$
    – BlacKow
    Commented Mar 17, 2016 at 20:32
  • $\begingroup$ And I just realized that you asked somewhat similar question that has several answers. $\endgroup$
    – BlacKow
    Commented Mar 17, 2016 at 20:43

1 Answer 1

4
$\begingroup$

So just for illustration purpose, let's color all Dodecahedron parts orange and Icosahedron part blue.

{vert, faceInd} = 
  PolyhedronData[
     "DodecahedronIcosahedronCompound", #] & /@ {"VertexCoordinates", 
    "FaceIndices"};
orange = Polygon /@ (vert[[#]] & /@ # & /@ 
     Select[faceInd, Length[#] == 5 &]);
blue = Polygon /@ (vert[[#]] & /@ # & /@ 
     Select[faceInd, Length[#] == 3 &]);
Graphics3D[{Orange, orange, Blue, blue}, Boxed -> False]

enter image description here

And for extra fun we can make the Icosahedron spin around.

b[t_] := Rotate[blue, t Degree, {0, 0, 1}];
Animate[
 Graphics3D[{Orange, orange, Blue, b[t]}, Boxed -> False], {t, 0, 360,
   10}]

enter image description here

$\endgroup$

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.