Closed iceye closed 4 years ago
@iceye this error is happening not because these two points are close, but because they are exactly the same. You can confirm this in your example by printing out the nextTop
and topPosition
points here right before the crash:
I'm not sure there's anything that can be fixed for this on the library side.
@OmarShehata this is still something CesiumJS should handle by filtering out duplicate points.
I understand it's an edge case, but when data are collected from an "insecure" system it may happen points are almost the same (0.2-0.3mm difference in my use case). In my test app I added a pre-filter method. It could be interesting to add a global "precision" for Cesium instance (https://en.wikipedia.org/wiki/Decimal_degrees) and automatically optimize filtering and calculation based on that. Anyway, thx a lot for your support, I understand the "enhancement" request. I added this issue just because to me it seems strange the crash behavior.
Prob this issue should be also something like: Prevent error when there are duplicate points for Wall Geometry
@iceye I opened a PR to fix this here: https://github.com/CesiumGS/cesium/pull/8952
Reproduced on local env and Sandcastle STEP TO REPRODUCE:
WHEN I create a wall entity with this code:
CURRENT BEHAVIOR: THEN I see normalize error:
EXPECTED BEHAVIOR: I see my wall ;)
Current workaround: AVOID points too close for walls. No problems with the polygons, I didn't test with other geometries.
With the workaround for positions it's working fine:
Sandcastle example: I just tested on https://sandcastle.cesium.com/?src=Wall.html&label=Geometries with my wall
Browser: Chrome Version 81.0.4044.122
Operating System: OSX
Additional notes: The positions array is created with Cesium.Cartesian3.fromDegreesArrayHeights, the 2 points are created from these coordinates: lat: "45.6333333333333", lng: "13.5", "height": 4000 lat: "45.63333333", lng: "13.5", "height": 4000
I hope this will help