Polygon where the edges intersect

Hello,

I am currently working on developing a 3D area calculation widget. When a user clicks on points, a polygon is displayed.

However, I’ve encountered an issue. When the edges of the polygon intersect, the upper polygon is drawn correctly, but underneath the terrain, there is a strange polygon shown. How can I resolve this issue?

I will attach images and sandcastle link below.
Thank you.

To clarify, these polygons are not simple polygons?

This is not supported in CesiumJS yet, though has been requested in Fill Complex Polygons · Issue #1209 · CesiumGS/cesium · GitHub.

You can use tools such as TurfJS decompose a complex polygon in simple polygons before passing them into CesiumJS.

Thank you for your reply.
Your suggestions were a great help in completing my project!

1 Like