post by Deltakosh on Oct 22, 2024

The old CSG class was made of pure JS (it was a port from GitHub - evanw/csg.js: Constructive solid geometry on meshes using BSP trees in JavaScript) and while it served us, it was not maintained and not usable anymore. We are now encouraging everyone to switch the new CSG2 class.

CSG2 is built on top of Manifold and can produce very neat booleans.
How to port:
https://doc.babylonjs.com/breaking-changes#porting-from-csg-to-csg2

Documentation:
Merging Meshes | Babylon.js Documentation

Interestingly it is also supported in NGE :slight_smile:

Examples:


Babylon.js Playground


glTF Loader Demo | Babylon.js Playground

read 5 min

post by nasimiasl on Oct 22, 2024

post by Deltakosh on Oct 22, 2024

post by nasimiasl on Oct 22, 2024

THAT IS WOW AS FIRST RESULT :smile: I am trying more

@Deltakosh i be far from forum for a while i wish can back to community again
that can be good stuff for that

post by Joe_Kerr on Oct 22, 2024

post by nasimiasl on Oct 22, 2024

post by Deltakosh on Oct 22, 2024

post by Deltakosh on Oct 22, 2024

post by nasimiasl on Oct 22, 2024

post by Deltakosh on Oct 22, 2024

post by nasimiasl on Oct 22, 2024

post by nasimiasl on Oct 22, 2024

post by Dad72 on Oct 22, 2024

It’s great. I’m going to use it to make a hole in the ground with a desired shape.
Great new features.

post by Deltakosh on Oct 22, 2024

post by nasimiasl on Oct 22, 2024

the normal look like used from substracted face that must be calculate again

post by Deltakosh on Oct 22, 2024

The toMesh function allows you to ask the system to recompute the normals:

{ /** * Rebuild normals (false by default) */ rebuildNormals: boolean; /** * True to center the mesh on 0,0,0. True by default */ centerMesh?: boolean; }

(But you can also ask for it with mesh.createNormals())

post by brianzinn on Oct 22, 2024

very cool. i saw you starred the manifold repository a few days ago. i went there then and went down a massive rabbit hole for hours and hours. really great addition that solves a lot of non-trivial problems!

post by roland on Oct 22, 2024

Master, your connection to the Force is truly remarkable. I am honored to learn from you and witness such mastery. You remind me of the limitless potential the Force grants us when we seek harmony within it.

In my words: this f**king rocks!!!

those cubes!! O - M - G !

Thank you!!

post by Deltakosh on Oct 22, 2024

post by onekit on Oct 22, 2024

That’s amazing! It means that it will be possible to make any meshes destructible without having to pre-create the pieces they will break into. For example, if I want a watermelon to shatter into pieces when it hits the floor, it can break into a random number of pieces and crack in random places each time. I think I already know how I will use this in my demo game.

post by kzhsw on Oct 22, 2024

post by Deltakosh on Oct 22, 2024

post by kzhsw on Oct 22, 2024

post by mawa on Oct 22, 2024

post by Deltakosh on Oct 22, 2024

post by Tricotou on Oct 22, 2024

post by Deltakosh on Oct 22, 2024

post by roland on Oct 23, 2024

post by Deltakosh on Oct 23, 2024

post by Joe_Kerr on Oct 23, 2024

post by roland on Oct 23, 2024

post by cx20 on Oct 23, 2024

post by kzhsw on Oct 23, 2024

post by Tricotou on Oct 23, 2024

post by roland on Oct 23, 2024

post by cx20 on Oct 24, 2024

post by Deltakosh on Oct 24, 2024

post by kzhsw on Oct 24, 2024

post by Deltakosh on Oct 24, 2024

post by hrgdavor on Oct 27, 2024

Load more posts below