Hi everyone,
this is probably a noob question but please bear with me…
I’m trying to create some simple models in BabylonJS to be 3D printed after being exported to OBJ or STL.
Problem is, it seems that you cannot simply create a bunch of “touching” boxes to create a 3D printable model, because the model should be “manifold”.
For example take this simple Playground :
As you can see, the figure is composed by 5 boxes (it’s a sort of table); when exported and opened in a 3d slicer software, they are treated like 5 separated boxes as well, and it says that there are several open edges:
Here’s the question: how should I construct a figure similar to that one, and make sure that is “manifold” ? Is there any helper function in BabylonJS for this ?
Thanks in advance for any help and for this fabulous library
I’m not aware of a helper function for this with Babylon.js. Integrating something like this (compiled to WebAssembly) is one way to go if the input geometry is generic.
@HiGreg
I have already tried this, but unfortunately it does not work.
Edges of different boxes remain sort of “independent” and the global model is not manifold.
But what do you mean by “if input geometry is generic” ?
I mean, I know what I want to accomplish, it’s just a bunch of boxes that can change position dynamically but more or less I know what is happening, as I would do in a CAD software.
Is there maybe another way to create custom meshes which creates manifold models ?
If you know exactly what shapes you have and the shapes are simple, I can imagine the algorithm for getting a manifold be simplified, but I’m no expert in this area.
Thanks for the callout, @bghgary! Indeed, making manifold meshes is a lot harder than it sounds, but this is exactly why I built the Manifold library. I would encourage you to try out our web playground for building and exporting Manifold meshes: https://manifoldcad.org/. If you like it, then @HiGreg is right that it shouldn’t take much to convert our three.js example to a babylon example if you want to.
The PG converts a grayscale image to a 3d printable “voxelized” model (the image is indicated as data uri at the beginning of the script).
The figure is printable even if is not absolutely manifold (see later for details); basically I created a custom mesh facet by facet, using tree traversal (BFS) to detect group of adjacent facets and avoid printing internal edges.
As I said, is printable since the slicer (prusa slicer) does not detect any open edges; but Blender 3D print plugin still report some non manifold edges.
These are easy to see in Blender (highlighted in orange) if we switch to a much smaller greyscale image instead of yoda (uncommenting the data-uri at the top):
They are basically “corner” edges that are shared among two voxels, so this is not manifold because AFAIK one edge cannot be shared by more than 2 facets.
However this seems to be printable anyway, thanks for the help