{"action":"created","issue":{"url":"https://api.github.com/repos/mfogel/polygon-clipping/issues/41","repository_url":"https://api.github.com/repos/mfogel/polygon-clipping","labels_url":"https://api.github.com/repos/mfogel/polygon-clipping/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/mfogel/polygon-clipping/issues/41/comments","events_url":"https://api.github.com/repos/mfogel/polygon-clipping/issues/41/events","html_url":"https://github.com/mfogel/polygon-clipping/issues/41","id":370366784,"node_id":"MDU6SXNzdWUzNzAzNjY3ODQ=","number":41,"title":"Bugs caused by similar or identical input geometries","user":{"login":"rf-","id":345106,"node_id":"MDQ6VXNlcjM0NTEwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/345106?v=4","gravatar_id":"","url":"https://api.github.com/users/rf-","html_url":"https://github.com/rf-","followers_url":"https://api.github.com/users/rf-/followers","following_url":"https://api.github.com/users/rf-/following{/other_user}","gists_url":"https://api.github.com/users/rf-/gists{/gist_id}","starred_url":"https://api.github.com/users/rf-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rf-/subscriptions","organizations_url":"https://api.github.com/users/rf-/orgs","repos_url":"https://api.github.com/users/rf-/repos","events_url":"https://api.github.com/users/rf-/events{/privacy}","received_events_url":"https://api.github.com/users/rf-/received_events","type":"User","site_admin":false},"labels":[{"id":817686128,"node_id":"MDU6TGFiZWw4MTc2ODYxMjg=","url":"https://api.github.com/repos/mfogel/polygon-clipping/labels/bug","name":"bug","color":"d73a4a","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-15T22:22:01Z","updated_at":"2018-11-14T17:18:39Z","closed_at":null,"author_association":"NONE","body":"I've been seeing some crashing bugs caused by specific inputs to `union` with version 0.8.0.\r\n\r\nFor example:\r\n```\r\nvar coords1 = [\r\n  [\r\n    [\r\n      [-118.49128246307373, 34.019483292435396],\r\n      [-118.49096059799194, 34.019203176094535],\r\n      [-118.49094450473785, 34.01912758898703],\r\n      [-118.48823547363281, 34.016802140968366],\r\n      [-118.487548828125, 34.017371278141994],\r\n      [-118.487548828125, 34.01735794217727],\r\n      [-118.48639011383057, 34.01833169712249],\r\n      [-118.48449110984802, 34.019892349558305],\r\n      [-118.487548828125, 34.022524496063156],\r\n      [-118.487548828125, 34.02252330890177],\r\n      [-118.48758637905121, 34.02255561892879],\r\n      [-118.48968923091888, 34.02087941406322],\r\n      [-118.490429520607, 34.020261388532035],\r\n      [-118.49038660526276, 34.02022581858034],\r\n      [-118.49128246307373, 34.019483292435396]\r\n    ]\r\n  ]\r\n];\r\n\r\nvar coords2 = [\r\n  [\r\n    [-118.48639011383057, 34.01833169712249],\r\n    [-118.48823547363281, 34.016802140968366],\r\n    [-118.49094450473785, 34.01912758898703],\r\n    [-118.49096059799194, 34.019203176094535],\r\n    [-118.49128246307373, 34.019483292435396],\r\n    [-118.49038660526276, 34.02022581858034],\r\n    [-118.490429520607, 34.020261388532035],\r\n    [-118.48968923091888, 34.02087941406322],\r\n    [-118.48758637905121, 34.02255561892879],\r\n    [-118.48449110984802, 34.019892349558305],\r\n    [-118.48639011383057, 34.01833169712249]\r\n  ]\r\n];\r\n\r\nvar results = polygonClipping.union(coords1, coords2);\r\n```\r\n\r\nThis seems to cause an infinite loop.\r\n\r\nI thought the issue could be related to overly-precise coordinates, but I also see issues sometimes with rounded coordinates. For example, this input causes a `SweepEvent comparison failed` error:\r\n\r\n```\r\nvar coords = [\r\n  [\r\n    [-118.46571, 34.025348],\r\n    [-118.465871, 34.025308],\r\n    [-118.465936, 34.025348],\r\n    [-118.467899, 34.025348],\r\n    [-118.468194, 34.025197],\r\n    [-118.468983, 34.025174],\r\n    [-118.469245, 34.025348],\r\n    [-118.46571, 34.025348]\r\n  ]\r\n];\r\n\r\npolygonClipping.union(\r\n  JSON.parse(JSON.stringify(coords)),\r\n  JSON.parse(JSON.stringify(coords))\r\n); // or `polygonClipping.union(coords, coords)`\r\n```"},"comment":{"url":"https://api.github.com/repos/mfogel/polygon-clipping/issues/comments/438744068","html_url":"https://github.com/mfogel/polygon-clipping/issues/41#issuecomment-438744068","issue_url":"https://api.github.com/repos/mfogel/polygon-clipping/issues/41","id":438744068,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODc0NDA2OA==","user":{"login":"mfogel","id":69902,"node_id":"MDQ6VXNlcjY5OTAy","avatar_url":"https://avatars0.githubusercontent.com/u/69902?v=4","gravatar_id":"","url":"https://api.github.com/users/mfogel","html_url":"https://github.com/mfogel","followers_url":"https://api.github.com/users/mfogel/followers","following_url":"https://api.github.com/users/mfogel/following{/other_user}","gists_url":"https://api.github.com/users/mfogel/gists{/gist_id}","starred_url":"https://api.github.com/users/mfogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfogel/subscriptions","organizations_url":"https://api.github.com/users/mfogel/orgs","repos_url":"https://api.github.com/users/mfogel/repos","events_url":"https://api.github.com/users/mfogel/events{/privacy}","received_events_url":"https://api.github.com/users/mfogel/received_events","type":"User","site_admin":false},"created_at":"2018-11-14T17:18:39Z","updated_at":"2018-11-14T17:18:39Z","author_association":"OWNER","body":"The two sets of coordinates above for which polygon-clipping is throwing a `SweepEvent comparison failed` error I think are a subcase of #48 (which I just opened). I'll move those coordinates over to that issue and follow up with them there.\r\n\r\nThe first set of coordinates above (the one that results in the infinite loop) I think is a different error, this issue will track the problem with that first set of coordinates."}}
{"actor":{"display_login":"mfogel"}}