Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A while back I gave <a href="https://stackoverflow.com/questions/3591394/whats-the-opposite-of-polygon-triangulation/3596782#35967821.2.3.4.">this answer</a> to a somewhat different question.</p> <p>That answer gives a way of establishing an outline of a shape, given a triangular decomposition of that shape.</p> <p>The basic idea is to consider the edges of all the triangles as directed vectors, and then cancel out equal but opposite edges.</p> <p>In your case, you would have a bunch of triangles representing the original shape. You would slice the individual triangles with the line. You would then regather the triangles into shapes using the method outlined above, with the proviso that sliced edges would not cancel.</p> <p>There are details and pictures in the answer referred to above. But to summarize the steps would be</p> <ol> <li><p>Perform the triangle splits</p></li> <li><p>For each resulting triangle, add the three directed edges to a set. To determine clockwise order, check out <a href="https://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-points-are-in-clockwise-order">the the answers to this question</a>.</p></li> <li><p>Go through the edge set removing pairs of edges that are are equal but opposite (unless they are slice edges)</p></li> <li><p>Pick an edge in the set, then find the edge whose tail matches the head of the first edge. Then repeat for that edge, until you get to the beginning edge. Remove each edge from the edge set as you get to it. Whenever you get to the beginning edge you have a closed loop representing one of the result polygons.</p></li> <li><p>Perform Step 4 until there are no edges left.</p></li> </ol> <p>All of this accommodates your wish to start from a triangulation of your polygon. But as one of the commenters to your original question has pointed out, you may want to consider the alternatives given at <a href="https://stackoverflow.com/questions/1775457/generate-new-polygons-from-a-cut-polygon-2d">Generate new polygons from a cut polygon (2D)</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload