Cutting / Splitting objects into two

Is there a way to cut an object into two? For example when I press the mouse at an object and move it to the end, the objects should be cut into two objects (two halfs). If so, how?

Hi @issabln, welcome to the Babylon forum!

Mesh slicing sounds like a fun math problem to solve, you can definitely find solutions implemented in other engines floating around the internet, Like this solver implemented in Unity3D.

I’d assume your algorithm would be:

  1. Figure out your bisecting plane, and its positional and normal vectors (I suggest starting with either a perfectly horizontal or vertical plane).
  2. Find the edges that intersect the plane, and use the intersection point to create your new vertices for the sliced meshes.
  3. Recreate your “top” and “bottom” meshes using the vertices on either side of the slicing plane

2 and 3 are probably a lot easier said than done here, but I hope this gives you a head start.

Or, you can always fake it with pre-sliced geometry that you substitute in, if your usecase allows it :wink:

1 Like

Do you need it to be dynamic? If not there’s tons of tools that you can use to swap out the model for any modeling suite, example: YouTube

1 Like

I have been looking into how to slice meshes in Babylon as well. Any pointers would be great …,

Pinging @Deltakosh

you can even split a mesh in as many parts you want : Use the Solid Particle System - Babylon.js Documentation


thats exactly what I’m looking for, but I need it inside babylon.js

@issabln Looks like we’re in luck, Babylon does have constructive solid geometry support, here’s a simple mesh slicer I put together that uses CSG:


Wow, thanks a lot, that’s great!!! Do You know what’s causing the cut parts to jump so weird sometimes and to fall through the ground?

I could not get work … when I click on sphere or plane … I don’t the plane sliced into tiles or prices

It works better with a box

SPS is one of babylon’s best features.

1 Like

The jumping is due to me adding physics to the cut pieces, the physics impostor “meshes” are probably overlapping on creation (and don’t really match up with the mesh), causing them to explosively decompress as they get out from inside each other😂.

@sebavan, @trevordev, either of you have any advice to fix that? The only alternative I could think of is to instead use mesh impostors and have my ground be a giant sphere :thinking:

But then, we lose the ability to collide with the other cut meshes…

1 Like

Does @issabln need physics?