Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ps = {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0.5, 0.5}, {1.5, 0.5}, {1.5,
- 1.5}, {0.5, 1.5}};
- edges = {{1, 2}, {2, 3}, {3, 4}, {4, 1}, {5, 6}, {6, 7}, {7, 8}, {8,
- 5}, {1, 5}, {2, 6}, {3, 7}, {4, 8}};
- faces = {{1, 2, 3, 4}, {2, 6, 7, 3}, {3, 7, 8, 4}};
- \[Phi]s = {0, 1, 1, 0, 0, 1, 1, 0} Pi/4;
- r = 0.5;
- Manipulate[
- Graphics[
- {GraphicsComplex[
- Table[ps[[i]] +
- r {Sin[\[Phi]s[[i]] + t], Cos[\[Phi]s[[i]] + t]}, {i, 8}],
- {PointSize[Large], Point[Range[8]], Line[edges],
- FaceForm[Directive[Opacity[0.5], Red]], Polygon[faces[[1]]],
- FaceForm[Directive[Opacity[0.5], Blue]], Polygon[faces[[2]]],
- FaceForm[Directive[Opacity[0.5], Orange]], Polygon[faces[[3]]]}
- ],
- GraphicsComplex[ps,
- Table[{Circle[i, r]}, {i, Range[8]}]
- ]
- }
- , PlotRange -> {{-0.1 - r, 1.7 + r}, {-0.1 - r, 1.7 + r}}]
- , {t, 0, 2 Pi}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement