Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I can think of two approaches.</p> <p>A more general approach is treating your input as just a set of lines and splitting the problem in two:</p> <ol> <li>Polygon Detection. Take the set of lines your initial triangles make and get a set of non-overlapping polygons. <a href="https://docs.google.com/viewer?a=v&amp;q=cache%3aKXjmUkopCAoJ%3awww.researchgate.net/publication/2933997_Polygon_Detection_from_a_Set_of_Lines/file/79e41507ddec7cc0ae.pdf+&amp;hl=en&amp;gl=us&amp;pid=bl&amp;srcid=ADGEESgY81w6Gsi8X6NnMT2PH0IubL8fyY4rn5w5sPd5efuwqsfkdXxFhpKuese17ojwK9Kx9QLF5xkQCjJF_Zh5v89chm-Efw9bpe7fl1RwDwQ-efndPk4BEMK3Cj8vxWS0catetglM&amp;sig=AHIEtbRYDap4Ud9a7OPfjbJ6F0Az8cpWnw" rel="nofollow">This paper</a> offers an O((N + M)^4) approach, were N is the number of line segments and M the number of intersections, which does seem a bit slow unfortunately... </li> <li><a href="http://en.wikipedia.org/wiki/Polygon_triangulation" rel="nofollow">Polygon Triangulation</a>. Take each polygon from step 1 and triangulate it. This takes O(n log* n) which is practically O(n). </li> </ol> <p>Another approach is to do do a custom algorithm. Solve the problem for intersecting two triangles, apply it to the first two input triangles, then for each new triangle, apply the algorithm to all the current triangles with the new one. It seems even for two triangles this isn't that straightforward, though, as there are several cases (might not be exhaustive):</p> <ol> <li>No points of the triangle are in any other trianle. <ol> <li>No intersection</li> <li>Jewish star</li> <li>Two perpendicular spikes</li> </ol></li> <li>One point of one triangle is contained in the other</li> <li>Each triangle contains one point of the other</li> <li>Two points of one triangle are in the other</li> <li>Three points of one are in the other - one is fully contained</li> </ol> <p>etc... no, it doesn't seem like that is the right approach. Leaving it here anyway for posterity.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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