Captain Marvel's Star

Saw this nice design on a t-shirt and I wondered how to generalize it. Of course, there's a big difference between the even and odd cases, but I like both. Still thinking about the colored hatching. Turns out in GeoGebra you can intersect a polyline with itself to find crossings!
Image