meshwriter icon indicating copy to clipboard operation
meshwriter copied to clipboard

Attempting CSG with a MeshWriter mesh causes WebGL errors during display

Open johnw3d opened this issue 2 years ago • 1 comments
trafficstars

Hi. I am looking to use MeshWriter letterforms to etch a message in a block mesh using Babylon's built-in CSG.

I am able to get CSG subtraction to function well with complex extrusions made with MeshBuilder.ExtrudeShape, but all attempts to do the same with MeshWriter extruded letters causes various WebGL errors, such as "GL_INVALID_OPERATION: Vertex buffer is not big enough for the draw call" on Chrome and "WebGL warning: drawElementsInstanced: Indexed vertex fetch requires 8756 vertices, but attribs only supply 2718." Outside of this CSG use, the MeshWriter letters display fine.

Should I expect this to work, or are there special aspects of MeshWriter meshes that prevent this use? I am about to write a bunch of code to hand-check the letter meshes for non-manifold elements and to do other well-formedness checks, but thought I would post here briefly in case I can get some pointers.

I can provide example code, if you'd like...

Thanks very much, John .

johnw3d avatar Mar 26 '23 02:03 johnw3d

I exported a single letter "o" as an STL file and both MeshLab and Blender find non-manifold edges & vertices, which may be the cause of the CSG issues, it probably needs manifold "solids". See below Blender displaying the non-manifold edges it has found. I will work on getting more details... image

johnw3d avatar Mar 26 '23 03:03 johnw3d