I've been playing around with various sweepline algorithms for finding 2d polygon intersections, and everyone I've tried has missed an intersection or two/three/four.... but there doesn't seem to be any
rhyme or reason (not that i've found to date) as to why e.g. .....
is it an elegant but ultimately failed solution ? otherwise it's the n squared brute force solution
Replies
fixed it
works out @ a max of 98 500 ish comparisons with the sweepline (plus a bit for some pre sort initiialization) vs 9604 with brute force
it's witch craft !!!
a self intersecting abomination
though self intersection ( oooh er missus! ) is still a bugbear
the bottom version result was seperated by hand to show the result most of my tools
don't mind touching polylines just overlapping and self intersecting
the horror show top left can be made to work in a "sensible" way. there was some soul searching on whether a spline intersecting 2 other splines though wholly contained within them is considered a hole of the 2 combined..... i thought yes.... but resolving that was a mind ****! It's always nice to know you've not been on a fools errand