A question about Using Clipping Planes

this is the playground

I want to get the intersection of the clip plane with the model to create the profile grid.

Is there any good way?

Clipping plane is a render process which clips the whole scene.
If you want to create the intersection mesh, did you try to use CSG2 instead ?

Screencast from 21-02-2025 13:45:31

3 Likes

yeah,thank you for your help!

Do I need to import any js? I ran it: BABYLON.InitializeCSG2Async is not a function

My environment is babylonjs+typescript

and using the playground,there is something wrong:

the intersection mesh is not in the correct location

On my side a classic import <script src="https://cdn.babylonjs.com/babylon.js"></script> seems to be ok, but maybe you are using ES6 imports ?

This is due to the toMesh function, default is centered. set centerMesh to false :

newMesh = skullCSG.intersect(planeCSG).toMesh("cut", scene, {centerMesh:false});
1 Like

it worked.I find this is a problem with my babylonjs version.

Thank you for your help. I appreciate it!!

1 Like