Subdividing a list of segments #
A polygonal edge is its pair of endpoints: a straight segment is determined by its ends,
so naming one by anything else names a distinction that does not exist. Piece := Plane × Plane, and the blueprint's "represent every duplicate geometric subsegment only once"
becomes deduplication of a list of names, with no geometry in it.
The subdivision recurses on the POINT list, not on the segment. subdivide pieces points
cuts every current piece at the head point and recurses with the rest. Read literally the
blueprint wants the cut points as data, which would need a choice operator (the meets are
existential) and then a sort (to order them along each segment). Neither is required: order
does not matter, because cutting at a point that has already become an endpoint is a no-op.
Three facts about one cut, each lifted across the piece list and then across the point list:
subdivide_cover— cutting loses nothing, so a subdivision occupies what it came from;subdivide_ne— no piece degenerates, so the drawing condition's invariant survives;subdivide_interior_subset— every piece's interior lies inside the interior of a piece it came from. This is what makes a cut permanent: nothing later can put a removed point back into an interior.
Blueprint #
A polygonal edge is its pair of endpoints.
Equations
Instances For
One cut #
Cut one piece at one point: two pieces if the point is interior to it, and the piece unchanged otherwise. Cutting at a point that is already an endpoint is a no-op.
Instances For
After cutting at p, no piece has p in its interior.
Nondegeneracy is needed: a degenerate piece (p, p) has p in its interior and cutting it
produces two more copies of itself.
One cut, across the whole list #
Cut every piece of the list at one point.
Equations
- Schoenflies.splitAllAt p pieces = List.flatMap (Schoenflies.splitAt p) pieces
Instances For
The subdivision #
Subdivide a list of pieces at a list of points, recursing on the POINT list: cut every current piece at the head, then carry on with the tail.
Equations
- Schoenflies.subdivide pieces [] = pieces
- Schoenflies.subdivide pieces (p :: ps) = Schoenflies.subdivide (Schoenflies.splitAllAt p pieces) ps