CSG2 finite vertex error on ExtrudeShapeCustom mesh

Hello everyone!

After having moved to JSCad because CSG (1) wasn’t that great, I was delighted to learn about CSG2. It works perfectly and it’s soooo fast. However, I encountered an issue on one of the meshes from my project. I was quite surprised because it’s the simplest mesh I work with.

This is a mesh constructed using ExtrudeShapeCustom, with both ribbonCloseArray and ribbonClosePath set to true in the options. I assumed it would not cause any non-manifold geometry and be topologically correct, but apparently I still get the infamous Error: Error while creating the CSG: Non-finite vertex :

There is an unrelated (I assume) issue with the mesh normals that I fix manually after that, but the geometry looks correct when displaying the wireframe in the debug tools.

If any of you have an idea on how I can fix that or what could cause the issue it’d be wonderful.

Have a nice day,

Colin.

Searching google with manifold library "Non-finite vertex"

The “Non-finite vertex” message in the Manifold library is an error indicating that one or more vertices in the input geometry data have invalid coordinates.

Try retrieving all your mesh vertices and search for NaN, Infinity, or -Infinity. If none found, look at all other VertexData.

It would be great if there were convenience functions to pinpoint exactly what vertex indices are producing the error.

One thing I’ve found when using the library and intersect/sunbract were tiny sliver on coincident triangles. I had to modify one of the meshes (grow/shrink) to get the result I expected.

Thank you for your reply. After fiddling a bit with available options, it turns one putting any cap options works :

     let options = {
      path: path,
      shape: shape,
      closePath: true,
      closeShape: true,
      cap: BABYLON.Mesh.CAP_ALL,
    };

I still don’t quite understand how having a single cap hidden inside the “torus” makes it a better topology, but I guess the underlying BooleanJS magic doesn’t really “fuse” the endpoints of the shape even when closePath is true? Anyway I’m glad it’s working now!

1 Like