Bug when cutting GLTF object with CSG2

“Update” ??? :grin:

I’m sorry but do they give you some more informations ? My meshes are made in Sketchup and converted to glb. The problem is that I have dozens of profiles like that.

If I know exactly what to do, why not “updating” them once and know in the future how to create others in a different way for them to be cut perfectly.

But if I don’t know in which direction to work, “Houston, we have a problem…” :joy:

Again I thank you for all what you’re doing for the community and I perfectly know that you’re absolutely not responsible for that

I think the main issue is whether the mesh is a manifold, which has strict construction guidelines. The link to the bug report shows the path forward. Use sketchup to create a manifold mesh meeting the requirements in the linked bug report. That’s my take on it. Hopefully that helps.

Would it make sense to include EXT_mesh_manifold in Babylon’s glTF 2.0? I’m not sure how it would/should be integrated into the loader.

Another possible improvement would be an error message on CSG2 that would say specifically “not manifold” possibly only when debug info is printed. That is, interpreting Genus, volume, and surface_area of the before shape, the cutting shape, and the after shape. That way, users debugging an issue can search for answers using the error message. The response in the bug report includes “detection [of non-manifold] is easy.” Is there an implementation that can detect non-manifold (or other reason for the error) and print a searchable/meaningful error message on debug output?

Based on that I will NOT remove csg1 :slight_smile: I will keep it flagged as deprecated but until we can find a solutio that works with all meshes, CSG1 will remain

The main problem with that extension is that we have no DCC tools supporting it so how do you populate the data for your files?

Regarding the error, we are already raising an exception if the mesh is not manifold. To detect it you simply try/catch the creation of a CSG2 from your mesh

1 Like

@Deltakosh I completely agree. For a “basic” user like me, what is cut with CSG has to be cut with CSG2. If there are special issues with GLTF / GLB meshes, may be we should have a function like .toManifold(myGLTFMesh). So keeping CSG until we find the solution is wise.

Did they give you some more informations to find how we must make our gltf meshes for them to be cut with CSG2 ?

no they only told me that the mesh has to be watertight

Is there such an option in Sketchup ? to make sure the mesh is a closed volume?

Here’s a mesh that is working :

Here’s a mesh that is not working :

All the volumes are closed, otherwise Sketchup is not able to extrude them like below. And in BABYLON, i’m doing exactly the same thing with the gltf mesh when changing the x scaling before cutting the mesh

2024-10-28_17h28_50

But maybe is there an issue with this part of the mesh which would not be considered as a volume:

If this is the problem, I unfortunately can’t do anything to change that.

I understand totally. This is why for now we will not remove CSG1 so you can continue using it!

1 Like

Thank you and I will try to investigate a little bit more.

There is a strict definition about what is manifold and what is not. In your case you can use software like meshlab to highlight the non-manifold edges:

There is an edge with 3 faces, so this is not a manifold.

2 Likes

Thanks for your answer. And is it possible to correct the mesh ?

There may be some interactive tools to fix it. I tried meshlab but I cannot select only that face for removal…

OK I found it, you need to use the filter in meshlab, which supports fixing non-manifold edges and vertices.
Obj file: cv5.obj - Pastebin.com

2 Likes

Thank you, I will try Meshlab because I have many meshes to correct.