Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find segment #N in SweepLine tree. Please submit a bug report. #148

Open
kharutyunyan-labelbox opened this issue Oct 28, 2022 · 1 comment

Comments

@kharutyunyan-labelbox
Copy link

kharutyunyan-labelbox commented Oct 28, 2022

Using a difference() with these arguments throws the following error:

const arg1 = [[[[1850,33],[1910,31],[1854,33],[1879,89],[1850,33]]]]
const arg2 = [[[[0,258],[42,147],[84,60],[121,0],[1798,0],[1839,53],[1849,70],[1883,146],[1914,232],[1920,264],[1920,378],[1892,366],[1851,351],[1826,342],[1821.667,339.833],[1816.429,338],[1812,338],[1809,336],[1807,335],[1804,335],[1804,334],[1800,333],[1798.623,332.082],[1738.5,314],[1735,314],[1733,313],[1731,313],[1728,312],[1727,312],[1726.142,310.283],[1725.2,310],[1725,310],[1724.698,309.849],[1718.55,308],[1718,308],[1717.17,307.585],[1708.575,305],[1707,305],[1705,304],[1702.692,303.231],[1701.925,303],[1700,303],[1699.172,302.172],[1691.95,300],[1689.4,300],[1689,299],[1689,298],[1680,296],[1679,295],[1672,293.385],[1672,293],[1663,291],[1663,291.308],[1627,283],[1620.333,281.667],[1619,281],[1611,279],[1610.077,279.923],[1594,277],[1594,275],[1593,274],[1593,273],[1588,273],[1588,275],[1580,274],[1572.286,273.143],[1566,272],[1562,272],[1559,271],[1554,271],[1553,270],[1542,268],[1519,264],[1500,262],[1479,258],[1453,255],[1447.667,255],[1448,256],[1447,253],[1447,252],[1446,251],[1445,249],[1445,248],[1444,246],[1444,245],[1443,244],[1443,243],[1442,244],[1436,244],[1434,242],[1432,241],[1430,243],[1428,244],[1426,246],[1425,244],[1423,242],[1421,239],[1420,239],[1418,237],[1418,236],[1414,236],[1414,235],[1413,235],[1411,236],[1409,238],[1409,239],[1408,241],[1407,241],[1406,239],[1406,238],[1404,237],[1398,237],[1398,236],[1397,235],[1397,233],[1396,233],[1395,231],[1392,231],[1391,233],[1392,238],[1392,239],[1385,239],[1383,237],[1383,233],[1382,233],[1382,231],[1381,231],[1380,230],[1380,226],[1378,225],[1376,228],[1373,229],[1373,227],[1372,226],[1371,226],[1370,225],[1369,225],[1367,226],[1367,230],[1366,231],[1364,232],[1364,233],[1362,234],[1361,237],[1359,237],[1356,234],[1355,234],[1355,233],[1354,232],[1354,231],[1352,230],[1352,229],[1351,229],[1350,228],[1349,228],[1348,227],[1348,226],[1346,226],[1346,224],[1345,224],[1344,223],[1344,222],[1342,221],[1341,221],[1341,220],[1337,220],[1335,222],[1333,226],[1331,229],[1328,229],[1327,227],[1327,226],[1325,225],[1325,224],[1322,224],[1322,223],[1320,223],[1318,224],[1318,225],[1317,224],[1311,224],[1310,223],[1306,223],[1306,222],[1302,222],[1302,223],[1300,224],[1299,225],[1299,226],[1297,228],[1296,228],[1295,229],[1294,228],[1294,222],[1293,222],[1293,221],[1292,221],[1292,220],[1290,220],[1290,219],[1289,219],[1289,218],[1287,218],[1286,217],[1284,217],[1283,216.667],[1283,215],[1284,215],[1285,214],[1285,212],[1284,211],[1282,211],[1281,212],[1280.857,216.143],[1280,217],[1279,217],[1278,216],[1278,215],[1277,215],[1275,217],[1275,220],[1274,221],[1273,223],[1273,226],[1272,227],[1268,227],[1268,226],[1267,226],[1264,225],[1259,225],[1258,224],[1259,223],[1258,222],[1258,221],[1257,220],[1257,219],[1256,219],[1254,217],[1254,216],[1252,216],[1251,217],[1250,217],[1249,218],[1248,218],[1247,219],[1247,224.5],[1246,224],[1242,224],[1237,223],[1236,222],[1232,222],[1232,221],[1225,221],[1224,222],[1224,223],[1220,223],[1219,222],[1212,222],[1211,221],[1200,221],[1200,219],[1199,218],[1199,214],[1198,214],[1198,213],[1197,212],[1197,211],[1194,211],[1193,212],[1192,212],[1192,213],[1191,214],[1191,215],[1190,215],[1188,214],[1187,214],[1187,213],[1183,213],[1181,214],[1180,215],[1180,216],[1176,216],[1172,212],[1170,212],[1170,211],[1167,211],[1165,212],[1164,212],[1162,213],[1161,213],[1159,215],[1158,217],[1159,217],[1160,218],[1152,218],[1149,217],[1131,217],[1129,216],[1125,216],[1123,214],[1121,213],[1119,211],[1117,210],[1113,210],[1112,209],[1109,209],[1107,210],[1106,210],[1105,211],[1104,211],[1102,209],[1101,207],[1098,207],[1096,211],[1090,214],[1089.53,214.94],[944,213],[926.85,213.858],[925.904,231.827],[925.297,243.366],[925.84,233.043],[925,249],[928,192],[930,191],[931,189],[932,176],[933,174],[935,173],[935,167],[932,160],[932,132],[933,128],[934,126],[931,105],[931,99],[930,99],[925,96],[924,96],[920,93],[918,90],[910,88],[903,88],[900,94],[848,108],[848,106],[846,105],[845,105],[835,107],[834,107],[832,110],[782,123],[781,124],[774,123],[773,124],[771,124],[769,126],[750,127],[746,128],[743,130],[742,130],[728,140],[716,146],[713,147],[708,140],[707,139],[707,138],[704,138],[709,148],[706,149],[698,159],[686,161],[685,161],[673,170],[673,171],[672,180],[671,181],[671,182],[670,184],[670,185],[668,186],[667,187],[667,194],[663,199],[661,202],[659,203],[658,203],[651,205],[646,205],[643,207],[643,208],[640,210],[640,211],[638,217],[638,219],[630,213],[629,212],[629,211],[628,209],[627,209],[611,210],[594,216],[592,218],[592,221],[599,225],[601,225],[602,224],[603,224],[603,222],[601,221],[601,220],[605,218],[610,218],[614,219],[615,228],[601,230],[598,230],[591,224],[591,223],[586,223],[586,222],[575,223],[574,226],[576,242],[575,244],[574,247],[574.419,245.742],[561,248.524],[561,248],[560,248],[560,247],[558,247],[557,248],[557,249],[555.792,249.604],[497,261.793],[497,261],[495,259],[493,255],[490,255],[489,256],[488,265],[487,265],[449.696,273.609],[449,275],[450,273],[450,266],[448,264],[447,264],[447,263],[445,262],[442,262],[440,265],[440,272],[437,273],[432,273],[429.429,274.714],[430,275],[428,274],[427,274],[427,273],[424,273],[424,272],[423,272],[420,273],[419,274],[418,274],[417,276],[417,277],[416,278],[409,278],[409,279],[408,279],[406.5,279.75],[407,279],[407,276],[406,273],[405,271],[405,270],[404,269],[400,267],[400,268],[398,269],[397,271],[397,272],[396,279],[394,281],[393.433,283.837],[380.636,287],[380,287],[380,286],[379,284],[375,282],[373,277],[373,276],[372,274],[372,273],[369,273],[369,274],[367,275],[366,277],[366,285],[363,287],[363,290],[359,291],[358,292],[352,292],[352,285],[349,279],[347,279],[346.063,280.874],[345,266],[355,250],[355,223],[353,221],[329,224],[329,221],[328,220],[319,220],[317,222],[317,227],[292,236],[292,265],[294,265],[305,273],[307,275],[307.611,286],[306,286],[304,287],[304,289],[303,290],[303,292],[302,294],[302,304.231],[291,306.769],[291,301],[290,300],[289,300],[289,299],[286,299],[284,301],[283,301],[283,302],[282,303],[282,304],[283,306],[283,308.333],[281,309],[280,309],[280,305],[279,305],[279,304],[278,303],[277,303],[276,302],[274,304],[272,304],[272,291],[271.2,290.6],[271,290],[269,290],[269.395,299.077],[269.133,303],[268,303],[268,302],[267,301],[264,301],[263,302],[262,302],[262,304],[261,305],[260,304],[260,302],[259,301],[258,299],[256,299],[256,298],[255,298],[254,299],[252,300],[252,301],[250,305],[250,312],[248,311],[247,308],[246,307],[244,307],[243,308],[242,310],[242,312],[241,313],[239,313],[237,315],[237,318],[236.826,318.522],[236,321],[233,321.923],[233,321],[212,326],[222.277,323.553],[222,323],[222,319],[221,319],[221,318],[220,318],[220,316],[219,316],[217,318],[217,320],[215,320],[213,318],[211,318],[211,322],[210,324],[209,324],[208,323],[208,319],[206,318],[203,319],[203,324],[202,309],[200,308],[200,328],[189.6,331.2],[189,330],[186,330],[185.592,332.444],[185.026,332.623],[185.593,332.444],[185.177,334.941],[190,333.333],[203,329],[190.712,333.096],[181.962,336.013],[179.908,334.239],[179.902,334.241],[179.9,334.242],[179.669,334.315],[179.674,334.313],[179.663,334.317],[179.65,334.321],[179.587,334.341],[179.645,334.322],[179.474,334.377],[179.585,334.341],[179.554,334.351],[179.544,334.354],[179.451,334.384],[179.285,334.436],[179.273,334.44],[179.278,334.438],[179.238,334.451],[179.212,334.459],[178.911,334.554],[178.95,334.542],[178.892,334.56],[170,337.368],[170,336],[169,334],[167,334],[165,335],[165,339],[164,340],[161,341],[159.5,341],[159,340],[156,340],[156,342.5],[155,343],[154,343],[152,344],[151,344],[149,342],[147,342],[146,344],[146,346],[146.143,346.571],[144,348],[143,348],[140,333],[138,332],[139.9,351],[138,351],[137.775,351.675],[138,352],[137.615,352.156],[137,354],[136,354],[135,355],[134,355],[132,356],[128.133,356],[127.429,356.286],[126,357],[124.125,357.625],[122.143,358.429],[121,359],[120.733,359],[114.455,361.545],[114,362],[113.333,362],[110,363.351],[110,364],[109,364],[106,365],[106,366],[99,368],[98.533,368],[96,369.027],[96,370],[95,370],[93,371],[91.133,371],[90.429,371.286],[89,372],[88.667,372],[85,373.486],[85,374],[84,374],[83,375],[82,375],[80,376],[78.8,376],[77,376.73],[77,377],[75,378],[74,378],[69,380],[67,381],[66.467,381],[66,381.189],[66,382],[62,384],[61,384],[60,385],[59,385],[56,386],[55,387],[53.333,387],[52.706,387.294],[52,388],[50,389],[49.067,389],[48,389.5],[47,390],[46.933,390],[45,390.906],[45,391],[44.8,391],[28.632,398.579],[28,399],[27.733,399],[24,400.75],[24,401],[23.467,401],[0,412],[0,258]],[[488,265],[488.114,263.971],[488,264],[488,265]]],[[[156,344.667],[160,343.333],[160.333,343.222],[161.635,342.788],[161.644,342.785],[161.707,342.764],[161.869,342.71],[162.273,342.575],[162.276,342.574],[162.324,342.558],[162.336,342.554],[162.356,342.548],[162.365,342.544],[162.382,342.539],[162.42,342.526],[162.409,342.53],[162.4,342.533],[162.328,342.557],[162.32,342.56],[162.413,342.529],[162.406,342.532],[162.305,342.565],[162.303,342.566],[162.302,342.566],[162.192,342.603],[162.185,342.605],[162.039,342.654],[161.829,342.724],[161.754,342.749],[161.745,342.752],[161.733,342.756],[161.747,342.751],[161.628,342.791],[161.616,342.795],[160.995,343.002],[156,344.667]],[[162.32,342.56],[162.298,342.567],[162.308,342.564],[162.32,342.56]]],[[[162.369,342.544],[162.406,342.532],[162.439,342.52],[162.439,342.52],[162.413,342.529],[162.43,342.523],[162.423,342.525],[162.413,342.529],[162.412,342.529],[162.409,342.53],[162.412,342.529],[162.43,342.523],[162.454,342.515],[162.457,342.514],[162.455,342.515],[162.467,342.511],[162.455,342.515],[162.449,342.517],[162.447,342.518],[162.44,342.52],[162.369,342.544]],[[162.43,342.523],[162.437,342.521],[162.434,342.522],[162.43,342.523]],[[162.455,342.515],[162.454,342.515],[162.438,342.52],[162.449,342.517],[162.455,342.515]]]]

Error:

Uncaught Error: Unable to find segment #12576 [162.4389999999974, 342.5200000000009] -> [162.439, 342.52] in SweepLine tree. Please submit a bug report.

image

The issue was fixed in 73ca4da, but starting from the 0.14.0 it was broken again

@viridia
Copy link

viridia commented Apr 25, 2023

I ran into this just now.

const arg1 = [[[[0,43.5],[1.7000000000000002,43.5],[1.7000000000000002,44],[0,44],[0,43.5]]]]
const arg2 = [[[2.3000000000000003,43],[0.7000000000000001,43],[0.6999999999999998,44],[2.3,44], 2.3000000000000003,43]]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants