# Dynamic CSG2 cutting and creation of sub meshes

**URL:** <https://forum.babylonjs.com/t/dynamic-csg2-cutting-and-creation-of-sub-meshes/60185>\
**Category:** Questions\
**Created:** [August 21, 2025, 7:22pm UTC](https://forum.babylonjs.com/t/dynamic-csg2-cutting-and-creation-of-sub-meshes/60185 "2025-08-21T19:22:02Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [August 21, 2025, 11:05pm UTC](https://forum.babylonjs.com/t/dynamic-csg2-cutting-and-creation-of-sub-meshes/60185/3 "2025-08-21T23:05:35Z")

</div>

Maybe one way to do this is:

- take the main mesh, grow by small amount
- subtract main mesh, retain “surface” csg2
- intersect all slicer meshes with surface
- this hopefully highlights slicer entry points into main mesh

It will take some effort to make this fast enough for UI, but CSG2 is fast enough to enable it if you save the correct intermediate CSG2 objects.

See my CSG2 sphere posts that show how quick CSG2 can be.

Edit: here

> [@Introducing: CSG2](https://forum.babylonjs.com/t/introducing-csg2/54274/42):
>
> Cutting a sphere with an ExtrudeShape. The white outline is the polygon used for the extruded shape. When the extruded shape has an angle \< PI, I use intersect. When it is \> PI, I use subtract. The min/max angles are moving every frame and all meshes and CSG objects are created and disposed every frame as well. There’s lot’s of opportunity for optimizing, but at first cut (pun intended), it’s working fast! Forums don’t allow uploading the .webm video captured by the inspector (“Sorry, the file …

And here

> [@Spherical (double) Wedge with CSG2. Reusable class, fast update](https://forum.babylonjs.com/t/spherical-double-wedge-with-csg2-reusable-class-fast-update/55648/5):
>
> Maybe this is final, unless someone sees a need to make this more formal (or in TypeScript). One bug found/fiixed. Also made the sliders work for all three axes. For each axis, the centerline of the wedge is on that axis with wedge angles specified as Left Hand Rule (aka counter-clockwise/leftward when looking outward from 0,0,0) around that axis. An angle of zero is facing the “previous” axis. Note that the axes display disappears if the final result is an empty mesh. It will reappear when th…

---

_[View the full topic](https://forum.babylonjs.com/t/dynamic-csg2-cutting-and-creation-of-sub-meshes/60185)._
