I created a star pattern that I was trying to apply to a circle of pentagons, but the Translate
had a slight offset, and I don't understand why. When I drew the lines, they were relative to the origin, but when I used the same CirclePoints
I used for the pentagons, the star pattern didn't follow. So I tried a pentagon wrapper, and it also had a different offset. Finally, the circle wrapper solved it. What am I missing here?
If you have another solution for the star, I would like to see that, but I would like the inner lines to trisect each other. Also, I would like to get this working in Graphics3D
, but that's for a different post.
.
p = Table[{Cos[θ], Sin[θ]} // N, {θ, π/2 + 2 π/5, -3 π/2 + 2 π/5, -2 π/5}];
mid[p1_, p2_] := p1 + (p2 - p1) .42;
m = mid[p[[#[[1]]]], p[[#[[2]]]]] & /@ {
{1, 2}, {2, 1}, {2, 3}, {3, 2}, {3, 4}, {4, 3}, {4, 5}, {5, 4}, {5,1}, {1, 5}};
(* star only *)
star = {Line[m[[#]]] & /@ {{2, 5}, {4, 7}, {8, 1}, {6, 9}, {10, 3}}}
(* star + Polygon[5] *)
star = {Line[m[[#]]] & /@ {{2, 5}, {4, 7}, {8, 1}, {6, 9}, {10, 3}},
EdgeForm[{Thin,Black}],FaceForm[],RegularPolygon[5]}
(* star + Circle[] *)
star = {Line[m[[#]]] & /@ {{2, 5}, {4, 7}, {8, 1}, {6, 9}, {10, 3}}, Thin, Circle[]}
color = {"Purple", "Green", "Magenta", "Cyan", "Red"}
cp = CirclePoints[{2 Cos[π/5], 3 π/10}, 5];
Graphics[{
EdgeForm[{Black, Thick}], Yellow, RegularPolygon[5],
CapForm["Round"], Thick, Black, star, {
Lighter[RGBColor[color[[#]]]],
RegularPolygon[cp[[#]], {1, 3 π/10}, 5],
Black, Rotate[Translate[star, cp[[#]]], 6 π/10]
} & /@ Range[5]
}]
star = {Line[m[[#]]] & /@ {{2, 5}, {4, 7}, {8, 1}, {6, 9}, {10, 3}}}
star + Pentagonstar = {Line[m[[#]]] & /@ {{2, 5}, {4, 7}, {8, 1}, {6, 9}, {10, 3}}, EdgeForm[{Thin,Black}],FaceForm[],RegularPolygon[5]}
$\endgroup$