Open kirevdokimov opened 1 month ago
polygonindexKey is equal to "clear" or "remove" while we iterate over startingpolygonindexes
, what causes vertices2d
to be undefined.
If we check for Nan with if (isNaN(polygonindexKey)) continue
line, other issue occurs:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '1')
at interpolateBetween2DPointsForY (interpolateBetween2DPointsForY.js:11:16)
at reTesselateCoplanarPolygons (reTesselateCoplanarPolygons.js:226:15)
at retessellate.js:25:44
at Array.forEach (<anonymous>)
at retessellate (retessellate.js:23:14)
at union8 (unionGeom3.js:21:17)
at union8 (union.js:42:35)
This is because activepolygonKey is equal to "clear" or "remove" sometimes as well.
Checking for NaN here with if (isNaN(activepolygonKey)) continue
line solves the issue
@kirevdokimov thanks for the excellent example, and the in-depth analysis.
there are lots of tests but not for this specific example. Given the similarity of the two cylinders, there's obviously something about the retellsation. Have you taken a look at the results of the Union before the retessellation? (Sorry for the spelling)
I'll look over the fix.
Responded in a related merge request: #1361
I was not able to reproduce this issue with the example you gave. Maybe I'm missing something?
I use .union() to merge geometries, but when I do so, it causes errors.
Expected Behavior
Geometries are merged with no issues
Actual Behavior
.union() throws an exception
Steps to Reproduce the Problem
I assume this basic example works for everyone
Specifications
Environment: Node v16.15.1, esbuild, Brave Browser Version 1.69.153 Chromium: 128.0.6613.85 (Official Build) (64-bit)
Same issue for Google Chrome Version 127.0.6533.122 (Official Build) (64-bit)