Issues with ClippingPolygons (low performance, how to handle holes)
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
### What happened?
Our users can upload their own feature-datasets (Shape, GeoJSON etc) to use as clipping polygons. We currently create our own pre-clipped 3D Tiles but we want to move the clipping into Cesium instead. To test this we set up a sandcastle-demo with a complicated GeoJSON with many points, but we noticed we get very low FPS.
We saw this related PR: #12650, will this improve the performance?
Also, is it possible to add polygons with holes in them for clipping? The GeoJSON used in the sandcastle below contains holes so some data should be visible, but from what I can see it's only possible to add outer rings, not inner rings.
Here's what the GeoJSON looks like:
### Reproduction steps
1. Create one or more ClippingPolygons with many points, use for example this GeoJSON: https://ocpreleaseeudata001.blob.core.windows.net/support/sweden_4326.geojson
2. Add it to the default globe
3. Viewer becomes almost unusable, holes are not handled
### Sandcastle example
https://dev-sandcastle.cesium.com/#c=fVRbb9MwFP4rVp9aVBwncW5bNyGGAKEhJhXtKRJyk9PW4NqR7bQq0/47J2kz2m3wFPtcvu9cvjgISA1L0SpPVsosgOykX5NKyaYxal/qUstNY6wnb4hw5AacbDdkac2GlKOqv5Wjyy6sMtp5spWwA0uuiIbdMZre97bxEH9jtBdSgy1HU/JQakIWwsGt2IO9k9UvsBdkKZSDaedyFWj4amp46RJYmfDS6FOjlxtQCH5qW5sNvG+9P4/UYitXff5nUM1L/wpMhbwDZakfJyd9ovenMxobFTsh/dDqJzBf0PxBeDE3ra2AKiNqbH3tfeMugsBUjQUF2DC0NUYxFtIFzp1WxgLdSV2bnaMafODappt74HZQg/7B4yilR9ZydFpKt6cVnrCWo5+C9tJLcHQrVIufpVQeN9Cb9+TqeigXN4+zqo8OekSaTEpNN6IZL43xjZXadylPlyGMriVYYav1Huvy9x3TeIJOJ7uhugHkydCBnKjippOY1Ku7A9r4gfyNfJycNlidR7pzdT3DuTFKQdXBjHttDdN52t9BobQXFu0lT18heG46Ta3EBhunS7X/bg4kNTgvdS8mcnFWnLAeT0LH4zjPeJFENOZ5FDPGYj4lYchyzhmNUp5EBUvCbEqyLA2jiNEiDeMwCdN80svRWIlbGih6VuSV9tDrP1nfMsp5FPEsypI4L3LOEuRFaxilCUuKImQsS7MijXprnmcFOtI4YhlPi/DATUjb/I8hT+I0T+Mwy3mWpknWQ0Wch0URMcSK04LzeEqwFmTMkyjOkDbNY55MOvzHnqVu7fF3Zq8vq4ZFu5qvze6jxQ24O7BzQIXUuC5vW7gcTUcz5/cKrju4d8d3q7VqTGngYdMogUUHixZfEk8r5zqOWTCkzGq5JbK+euWdQjkI59CzbJWay99Qjq5nAcafpXW/Okrm2xasEvsuZB1e3x6MlNJZgNeXWd4YtRD2BPEP
### Environment
Browser: Chrome 140.0.7339.207
CesiumJS Version: 1.133.0
Operating System: Fedora Linux 42
Contributor guide
Research direction
Start with the linked Sandcastle reproduction and the ClippingPolygons implementation, then read PR #12650 to determine whether it addresses the reported FPS problem. Reproduce both the many-point polygon case and the GeoJSON holes case in CesiumJS 1.133.0. Done means the performance impact and hole-handling behavior are verified and covered by an appropriate regression test or documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100