How to clipping multiple Polygon on the Cesium3DTileset?

1. A concise explanation of the problem you’re experiencing.

I want to clipping multiple Polygon on Cesium3DTileset, but now I can only clipping one.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
    url: tiles.url,
    clippingPlanes: [
        new Cesium.ClippingPlaneCollection({    // clipping one Polygon
            planes: [
                new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 1.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, -1.0, 0.0), -1.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0.0), 1.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0.0), -1.0)
            ],
            unionClippingRegions: false,
        }),
        new Cesium.ClippingPlaneCollection({     // clipping two Polygon
            planes: [
                new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 2.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, -1.0, 0.0), -2.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0.0), 2.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0.0), -2.0)
            ],
            unionClippingRegions: false,
        })
    ]
}));

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I want to clip multiple polygons in Cesium3DTileset,Used to display the pipeline model below.

4. The Cesium version you’re using, your operating system and browser.

1.66

3 Likes

Can you tell me a bit more about your use case? or share an image/video of what you’re trying to accomplish?

1 Like

It isn’t currently possible to add multiple clipping planes to one tileset, but we’ve got a feature request for this here: https://github.com/CesiumGS/cesium/issues/8751.

1 Like