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

PolygonGeometry with holes have broken surfaces #12294

Open
ArgentumHHH opened this issue Nov 8, 2024 · 7 comments · May be fixed by #12412
Open

PolygonGeometry with holes have broken surfaces #12294

ArgentumHHH opened this issue Nov 8, 2024 · 7 comments · May be fixed by #12412

Comments

@ArgentumHHH
Copy link

What happened?

Now I have encountered a problem when changing from version 1.119 to versions after 1.120.
I created a PolygonGeometry that provides polygon boundary coordinate data and polygon hole coordinate data to create a polygon with holes. Generally, there is no problem with the coordinate data of holes, but many boundary coordinates in urban areas may have holes and broken surfaces.
The city boundary coordinate data is arranged in order and is valid latitude and longitude data in terms of format. It can be successfully rendered as PolylineGeometry or PolygonGeometry, but using the city coordinate data as polygon hole coordinate data may result in broken surfaces.

PolygonGeometry with holes created in version 1.119:
1 119

PolygonGeometry with holes created in version 1.120 has a broken surface in the lower left corner, and most of the city boundary coordinates have a broken surface in the lower left corner:
1 120

Reproduction steps

No response

Sandcastle example

No response

Environment

Browser:
CesiumJS Version:
Operating System:

@ggetz
Copy link
Contributor

ggetz commented Nov 13, 2024

Thanks for raising this issue @ArgentumHHH!

Looking through the 1.120 changelog, I don't see anything obvious that may have broken polygon hole rendering. It would be helpful to do a git bisect to determine the commit which caused the regression.

@ArgentumHHH Is this something you would be able to try?

@ggetz ggetz added the needs feedback On hold until additional info is supplied label Nov 13, 2024
@ArgentumHHH
Copy link
Author

When I encountered this issue, it was during version 1.123 update. In order to determine which version was causing the problem, I rolled back one version at a time and only found out that the issue did not occur at 1.119. Subsequent versions had this issue

@ggetz ggetz removed the needs feedback On hold until additional info is supplied label Dec 10, 2024
@ggetz
Copy link
Contributor

ggetz commented Dec 10, 2024

@ArgentumHHH Would you be able to perform a git-bisect in order to determine the problematic commit?

@ArgentumHHH
Copy link
Author

@ArgentumHHH Would you be able to perform a git-bisect in order to determine the problematic commit?

I compared every change between version 1.119 and version 1.120 and determined that the reason for this situation is the version issue of the dependency library earcut in packages.engine. By reducing the version of earcut from 3.0.0 to the original 2.2.4, this situation no longer exists.

This was referenced Jan 3, 2025
@ggetz
Copy link
Contributor

ggetz commented Jan 6, 2025

@ArgentumHHH It looks like we have a potential fix in #12412.

Would you please include the Sandcastle example that replicates the issue shown above? That would let us verify the fix. Thanks!

@pvocat
Copy link

pvocat commented Jan 16, 2025

I have a similar problem and I'm not sure if earcut 3.0 is the cause. I'm using an older version of cesium (I'm on 1.108.0 with earcut 2.2.4).
I've been trying to figure this out for days. All the polygons are cut on the geographical south corner. Could this be related?

There are also weird interactions when polygons are drawn side by side, but I can't reproduce it every time. For example, if I draw 4 square polygons to create a larger square, some corners will fill in with the color of their neighbor, depending on the viewing angle.

Example of 2 polygons affected by the problem:
image

Example of the viewing angle problem (visible on the green polygon, filling the missing part of the red one) :
https://www.youtube.com/watch?v=WQyBPmldGGo

EDIT : Here's a sandcastle replicating the problem : https://sandcastle.cesium.com/#c=rVNda9swFP0rIk8OGMXWhy15SdgIhQ4GK6xsD8sYqqPEYopkJCXBG/3vkxOnCW0ZFOYH+Ur33uOjc49ra3wAeyUP0oEZMPIAFtKr3RZ+PZ4ly1F93C+sCUIZ6Zaj8bulqY99tZMiyDuru401Nyao0EWQxIitTEGjpBOubroxmM3Bn6UB8Tl9Ccq+VkkPxWqVDCkA+r7quKbno/aEXYGnInABri5heklvIyWnhK7ON1lYbR38dvvx/gYeVGg+6LYRSQYRHV+12V3Q8X4VWAvt5VWile7O+kjXmlupNk14XvI4RI+9MPEVVy1DpK5M8FGP71eqLoQLMRIGJwQzzgmGGeUsywuKUkApyRGHBHNKeIFKmgJCS8YxggVBjBU4w9ecB9n+AZ9DUpIMIUzyAT6DBWYI86Lg+RmewpyWJSsKRN4GTyHLCKWsKK/gI3lKWPZEPoM8LwjLccbfhl5CzlFkh/OLNhkjBaEYYTbAoxKykjPKGB3/6J350pPRxL2PfvpGtHI5SofR9OMa/FhHzzkB17q7t2c/rqQPyoh+7hX47yOMZhmlo6kPnZbzsyjv1ba1LoCd0wmEkyC3rY6X8ZOHXf1LBlh7f/IYANPJdet0pfZArWav/K2g1sL7mFnvtP6ifkcB5tNJrH/Rqq1YKbP5vJdOi64va/L5p9MhhHA6idvXO4O1+kG4Z8h/AQ

EDIT 2 : It only affects polygons when they are clamped to ground. If we set a height or an extrudedHeight, the polygon will always be complete.

EDIT 3 : From what I found, it could be related to #12246 , #12136 , #11883 and #11291 , I'm not yet sure if the problem is the same for this issue.

@ggetz
Copy link
Contributor

ggetz commented Jan 27, 2025

@pvocat I don't think this is related to earcut. At least, your example does not appear to be affected by #12412.

#11291 appears to be the most relevant report. I'll add your report to that thread.

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

Successfully merging a pull request may close this issue.

3 participants