You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a polygon has an internal segment that is infinitely thin, polygon-clipping can crash. For example, performing a union on the following shapes results in a SweepEvent comparison failed at [-1, 0]... equal but not identical?
mfogel
changed the title
Error thrown for infinitely thin input polygons
SweepEvent comparison error thrown for infinitely thin input polygons
Nov 14, 2018
Other sets of coordinates that have appeared in the wild that appear to trigger this bug (pulled over from #41):
varcoords=[[[-118.46571,34.025348],[-118.465871,34.025308],[-118.465936,34.025348],[-118.467899,34.025348],[-118.468194,34.025197],[-118.468983,34.025174],[-118.469245,34.025348],[-118.46571,34.025348]]];polygonClipping.union(JSON.parse(JSON.stringify(coords)),JSON.parse(JSON.stringify(coords)));// or `polygonClipping.union(coords, coords)`
If a polygon has an internal segment that is infinitely thin, polygon-clipping can crash. For example, performing a union on the following shapes results in a
SweepEvent comparison failed at [-1, 0]... equal but not identical?
The polygon above polygon causing the problem looks like this:
What's going on here is that the algorithm doesn't know how to sort the two segments from the same ring that both go from
[-1, 0]
to[1, 0]
.The text was updated successfully, but these errors were encountered: