# Material clipPlane not moving with mesh (see PG link)

**URL:** <https://forum.babylonjs.com/t/material-clipplane-not-moving-with-mesh-see-pg-link/39652>\
**Category:** Questions\
**Tags:** material\
**Created:** [April 6, 2023, 2:48am UTC](https://forum.babylonjs.com/t/material-clipplane-not-moving-with-mesh-see-pg-link/39652 "2023-04-06T02:48:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lou\_Prado](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lou_prado/32/31206_2.png) [@Lou\_Prado](https://forum.babylonjs.com/u/Lou_Prado)\
**Post date:** [April 6, 2023, 2:48am UTC](https://forum.babylonjs.com/t/material-clipplane-not-moving-with-mesh-see-pg-link/39652/1 "2023-04-06T02:48:54Z")

</div>

Hi! I am attempting to create a mesh by applying clipping planes to a box. I must use planes to clip the box since I was given plane parameters in my source data. Here’s the code I use:

```auto
    var box = BABYLON.MeshBuilder.CreateBox("box", scene);
    const mat = new BABYLON.StandardMaterial("mat", scene);
    mat.clipPlane = new BABYLON.Plane(-0.4472, 0.8944, 0.0000, -0.2236);
    box.material = mat;

```

But there are two problems. The clipping plane removes the top of the mesh from rendering (I naively assumed that the box would be a solid), and if I move the mesh the clipping plane doesn’t move.

Is there a better way to produce my desired mesh using the plane provided above ?

> **[Babylon.js Playground](https://playground.babylonjs.com/#EHLHNX%23110)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [April 6, 2023, 10:05am UTC](https://forum.babylonjs.com/t/material-clipplane-not-moving-with-mesh-see-pg-link/39652/2 "2023-04-06T10:05:35Z")

</div>

Welcome aboard!

I think what you want to do is using CSG to generate a capped box?

> **[Merging Meshes | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/mesh/mergeMeshes#merging-meshes-with-constructive-solid-geometry)**
>
> Learn how to merge meshes in Babylon.js.
