Draw the perpendicular bisectors of the line segments AB and BC, then the intersection of the perpendicular bisectors is equidistant from A, B and C and thus it is the centre of the circle with AB and BC as chords. All the perpendicular bisectors will meet in a single point O equidistant from the endpoints of the line segments. Therefore all the line segments are chords of a single circle with centre O.
chords The angle of turn between the equal chords AB and BC in the path is PBC=θ. Triangles AOB and BOC are isosceles and OAB=OBA=OBC=α. Then (using angles on a straight line and angles in a triangle) θ=180-2α=AOB.

Consider radii drawn from the centre to the ends of n consecutive chords in the path. The sum of angles between the radii is equal to the total angle turn nθ so the path is closed if and only if the total angle turn is an integer multiple of 360 degrees, that is if and only if nθ=360m or, equivalently θ is a rational multiple of 360 degrees.

We consider θ=360 p q where p and q are positive integers and p<q. If the angle of turn is more than 360 degrees, complete revolutions can be discounted, so effectively θ=360 p* q produces the same path as θ=360 p q where p*p mod q.

If p is a factor of q, (say q=kp) then the path is a regular k sided polygon because the total angle turned when k chords are drawn is k× 360 k =360 degrees.

If p and q are not coprime then sp=tq for some integers s and t so that the total angle turn with s chords is s×360 p q =360t which is an integer multiple of 360 degrees so the path is a star with s points. If p and q are coprime then the path is a q pointed star.