Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- penPts = {Cos[#], Sin[#]} & /@ Range[0, 2 Pi, 2 Pi/5][[1 ;; -2]];
- tau = (2 Sqrt[5])/(5 + Sqrt[5]);
- Graphics[{Blue, Polygon[penPts], Red, PointSize [0.03],
- Point[penPts[[2]]*tau + penPts[[5]]*(1 - tau)], Green,
- Line[penPts[[{1, 3}]]], Line[penPts[[{2, 5}]]]}]
- pentagram[pts_] :=
- Riffle[pts, #] &@(pts[[# + 1]]*tau + (1 - tau)*
- pts[[1 + Mod[# + 2, 5]]] & /@ Range[0, 4, 1]);
- Graphics[{Red, PointSize [0.03], Point[pentagram[penPts]], Green,
- Opacity[0.5], Polygon[pentagram[penPts]]}]
- ind = PolyhedronData["Dodecahedron", "FaceIndices"];
- vert = PolyhedronData["Dodecahedron", "VertexCoordinates"];
- Graphics3D[ Polygon /@ pentagram /@ (vert[[#]] & /@ ind)]
- Graphics3D[Polygon /@ Reverse@*pentagram /@ (vert[[#]] & /@ ind)]
- MeshCells[
- DiscretizeGraphics@ Graphics3D@ Polygon@ pentagram@ vert[[First[ind]]], 2]
- (*
- {Polygon[{1, 9, 10}], Polygon[{3, 1, 2}], Polygon[{4, 1, 3}], Polygon[{5, 1, 4}],
- Polygon[{6, 1, 5}], Polygon[{7, 1, 6}], Polygon[{8, 1, 7}], Polygon[{9, 1, 8}]}
- *)
- Graphics3D[{Polygon[#],
- MapIndexed[Text[Style[#2, "Label", Bold, 16], #1] &, #]} &@
- RotateLeft@pentagram@vert[[First[ind]]]
- ]
- DiscretizeGraphics@ Graphics3D@ Polygon@ pentagram@ vert[[First[ind]]]
- DiscretizeGraphics@ Graphics3D@ Polygon@ Reverse@ pentagram@ vert[[First[ind]]]
- Graphics3D[{Polygon[#],
- MapIndexed[Text[Style[#2, "Label", Bold, 16], #1] &, #]} &@
- RotateLeft@ pentagram@ vert[[First[ind]]]
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement