I am looking for a formula/algorithm that would allow me to split an arbitrary polygon into smaller polygons using line segments.
All the algorithms I can find split using lines (defined by segments), as opposed to actually splitting using the segments.
This is important, because I am making many such splits "all at once", and two segments that, individually, wouldn't be able to split the polygon, now can split it.
Example 2 (Segment that will cut the polygon without splitting):
Example 3 (Two segments that, together, can split the polygon in two, but separately wouldn't)
You can imagine that the polygon is an arbitrarily shaped flat piece of wood, and the segments are straight lines we cut into it with a saw, and I would like to know what the resulting pieces of wood look like (how many and their shape)
I want to extend this behaviour to any polygon shape, and any number of "cutting" segments.
I absolutely do not mind any leftover duplicate points in the results, I can easily "clean it up" afterwards to remove consecutive duplicate points.