Problems with CSG2 and useRightHandedSystem

Hi folks,

so we are investigating in using Babylons right handed coordinate system mode, as the base of our configurators is glTF, which is also right handed.

It’s kinda hard to get CSG2 running with it, here are 2 examples.

Simple Cube

Very basic example, where i want to cut a box into another one.
It works when both boxes are drawn with the mesh builder (right side), but when the base mesh is coming from a glb model the result is incorrect.

Adjusting side orientation or flipping faces of the result mesh helps in this scenario, but that should work out of the box IMO.
Also it works just fine in left handed mode, you can adjust the flag at the beginning of the code.

Wall Module

Slightly more complex model, result also looks incorrect.


Differences to the previous example:

  • left-handed mode also doesn’t work out-of-the-box
  • adjusting side orientation in result mesh doesn’t fix it

Flipping faces of original mesh seems to do the trick (in right-handed mode), which is even less convenient, as the mesh geometry should definitely be correct already.

Would be amazing if you can have a look into these 2 examples and give some indications!

BG Markus

I would say that we do not support right handed mode with csg2 but let me have a look to see if I can find an easy fix :slight_smile:
Else you would have to stay in LH :slight_smile:

Ok it was easy: Fix CSG2 boolean operations for right-handed (glTF) meshes by deltakosh · Pull Request #18556 · BabylonJS/Babylon.js

Thx a lot for that quick fix, can’t wait to try that :slight_smile: