Advertisement
Matthen

rolling dodecahedron

Mar 26th, 2016
1,314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. vs = N[PolyhedronData["Dodecahedron", "VertexCoordinates"]];
  2. faces = (List @@ PolyhedronData["Dodecahedron", "Faces"][[2]])[[1]];
  3. d = Norm[vs[[1]]];
  4. Manipulate[
  5. Module[{vsP, facesP},
  6. vsP = (vs.RotationMatrix[2 Pi t, {0, 0, 1}]).RotationMatrix[
  7. 4 Pi t, {0, 1, 0}];
  8. facesP =
  9. Map[#[[;; 2]] &,
  10. SortBy[Table[vsP[[face]], {face, faces}], -Max[Last /@ #] &], {2}];
  11. Graphics[{
  12. {EdgeForm[Black], FaceForm[Directive[Opacity[0.9], White]],
  13. Table[Polygon[face], {face, facesP}]},
  14. Circle[{0, 0}, d]
  15. }
  16. ]
  17. ]
  18. , {t, 0, 1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement