Introducing: CSG2

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 you are trying to upload is not authorized (authorized extensions: jpg, jpeg, png, gif, zip, mp4).”)

Here’s a static png:

After some optimizations, and instantiating BABYLON.VideoRecorder directly, so I can save an mp4:

Edit: Finally created a playground.

4 Likes

Nice!!!

1 Like

Luv the mp4 :smiling_face_with_three_hearts:

1 Like

Seems like a subtract function shouldnt result in a “mixed” mesh insofar as Materials are concerned. I was surprised to see a new Material in the sandbox inspector for each hole cut out.

At scale this could be a rich optimization opportunity.

I actually very much like the flexibility that it is given here. But then, I could agree that eventually (if no material is assigned to the substracted mesh) the material from the ‘master’ mesh would apply in the backgrond or automagically :magic_wand: :grin: as per BJS standards :yum:(eventually through something like clone and auto-assign)? so you would still be able to tweak the cloned material to your liking……may be :face_with_hand_over_mouth: :thinking:

I added the option to provide your material so the system does not create a new one each time :slight_smile:

2 Likes

manifold had a new release full of breaking changes recently:

Have you tried to use it? You can specify the lib url in Babylon to see if it works

Running the test as we speak

2 Likes

manifold 3.0.1 released, any plans for an update

1 Like

doing it today!

5 Likes

done and deployed by @Deltakosh

4 Likes