Polygon Clipping does cut geometry?

Hey guys,
has been a while since we are deep in development :smiley:

As I thought this is just a material trick with the opacity mask of PolygonRasterOverlays. The collision actually does get cut. But how does the collision cutting actually work?
I’m highly interested since we probably enhance this for our own needs. I will for sure share the outcome if its worth.

Thanks

Hi @Riwa_Unreal, welcome back to the forum!

What you’re seeing is the result of a setting on CesiumPolygonRasterOverlay called Exclude Selected Tiles. Whenever a tile falls completely inside the polygon, it is excluded from loading, hence why the mesh and its collisions are missing.

However, when a tile falls partially inside the polygon, the plugin still has to load the entire tile, and thus creates a full mesh for it. We can achieve a clean polygon cut using the opacity mask, as you noted, but that’s only a visual effect. To remove collisions from the tile, we’d have to do an extra step of cutting the geometry from the tile itself, and that has yet to be added to the plugin.

I hope that explanation makes sense – let us know if you have any follow-up questions!

Hey Janine,
thank you. I’m working with these polyogons for a good while already.
That’s exactly the point I don’t get - How can the Polygon actually cut collision (even though the Tileset is not fully inside and it’s just the opacity mask
(I did study all the Cesium materials etc…))

We do already work for years with this ā€œcollision cutting featureā€ → We place glb/glTF on Cesium3DTiles and cut the geometry to be able to go in the basement e.f.

Hi @Riwa_Unreal,

My apologies for the delayed response! I was out for a few weeks.

I’m not sure I completely understand what you mean by the ā€œcollision cutting featureā€. We can prevent most tiles inside a polygon from loading. The problem happens for tiles that are partially inside / outside the polygon. In your first post, you can see the corners of some tiles intruding into the polygon. Proper geometry clipping would cut the tile meshes to remove those corners.

Geometry clipping would require looking into some techniques to retriangulate the geometry to produce a clean cut. It’s not enough that points on one side of the line are discarded – for any triangles that are split by the line, you’d have to add additional points or triangles in order to preserve that clean line. It would take a bit more complexity, and performance implications certainly come to mind, too.

But regardless, this would be a very useful addition to the plugin, so we have a Github issue open for it here: