Clip an entity

How to clip an entity using clipping planes.I saw an example in sandcastle for clipping planes but unable to find any example to clip an entity.How to achieve it.

This example shows clipping an entity (the Cesium Man) model:

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html?src=Terrain%20Clipping%20Planes.html

Is this what you’re looking for?

Thanks for the reply omar. Please check this sandcastle link.I want to clip a green polygon added as an entity but im able to clip only tileset .How can i clip the polygon added as an entity.

In order to clip an object you need to attach a clipping plane to it. It looks like ModelGraphics has an option to attach clipping planes (see the doc at https://cesiumjs.org/Cesium/Build/Documentation/ModelGraphics.html?classFilter=ModelGr) and the code example here (https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=development%2FMany%20Clipping%20Planes.html&label=Development) but PolygonGraphics does not have this option.

You could get around this for now by loading your polygon as a glTF model, and then you could clip it.

Can you tell me a bit about your use case here? if it’s a common enough thing, we could argue for extending clipping planes support to more entity types like polygons.

We would need to clip at least Polylines as well.