-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STL is not manifold #18
Comments
FYI, the red surfaces in Cura are just overhangs - any surfaces within some angle of facing downward. |
In Cura red surfaces can also mean missing or improperly normaled surfaces as well. There is an autodesk tool that can help you repair models like this but I can’t remember its name. |
Meshmixer? |
Thanks for the helpful suggestions! It does indeed look like red is just an overhang as when I rotate the part the bottom is red and the red ridges in my screenshot are all solid yellow. While I appreciate that there may be tools that fix the model I would prefer to understand how it got to be non-manifold in the first place and how to prevent that. |
You're quite right - I took a look at the model (per the repo) in meshlab - it reported "15 non manifold edges" and "45 faces over non-manifold eges" Bugger. I'll have to go back into the model and work out what's going on. Having said that... the red area you indicated is overhang. It's designed to be printable with the outer case face on the bed, ie - the XZ plane. You'll probably have to rotate it before printing, or just do a final transform in the code. If you can force your slicer to ignore the non-manifold edges it will print ok- I've printed quite a few. But yes - it should be manifold STL. As for large STLs: See: #6 |
I've had a quick look and am suspicious of |
Try this:
This gives a manifold object for my test case. RenderSTL does an octree decomposition of space. I didn't think the objects in the box model had that problem - but I suppose they do. In any case the mcToTriangles is common to both- so that appears to be ok. |
Sure enough, that does seem to create a manifold object. It does, however, use different points and more cubes than were specified.
So it could be that the triangle in question just never appears in the It also seems that in my screen recording we see many more non-manifold parts of the object than Meshlab finds. Its definition is "edges with more than two incident faces", whereas we can see lots of edges with a single incident face also leading to a non-manifold object. Perhaps in a the more general case it can be valid to have a single face jutting into space but for marching cubes that is certainly never correct, so we might consider checking edges to have have always exactly 2 incident faces... |
Some progress in diagnosing, but also some bad news: The issue also appears with
|
I've made some partial headway. What remains after PR #19 is to figure out why there are what appear to be degenerate triangles in the mesh. In the debug subgraph produced by the script above (filtering for an example with 4 incident edges) I'm spotting faces that have only two unique vertices. How exactly those faces become part of an edge with multiple incident faces is as yet unclear... |
Thank you for merging my edits and subsequently improving them. The algorithm still produces non-manifold meshes in certain corner cases:
It's not obvious to me what the best solution would be here, as we're explicitly asking for a non-manifold shape. Perhaps this is therefore as designed? |
As a practical matter, the correction for that case is pretty simple. ie- reduce the size of the inner marginally to clean up those knife edge issues. Or - increase it slightly if 4 wedges was really what you wanted. More generally marching cubes is a sampling process of finite precision and it runs into issues with features that require better spatial resolution to be turned into a good mesh. In this case dropping the resolution (E.g. 100) will get rid of the non-manifold edges, albeit with introduced gaps at the joins. |
That makes sense. I'll close the issue as mesh generation seems to be manifold now when one doesn't create a situation built specifically to tease out these special cases. |
First, thank you for building this amazing project!
I was trying to programmatically generate 3d-printable enclosures and came across sdfx and it seems like a very good fit.
I ran
examples/box/main.go
but when loading the resultingtop.stl
file in Cura I get a message saying that my model is not manifold, which I take to mean that it doesn't have closed surfaces all around.I can't really see any marked areas so perhaps those are internal? Potentially related, I also notice that the resulting STL file is very large for the given geometry, which I take is because of the marching cubes algorithm used in sdfx?
The bottom is marked red but I believe that's different from Cura's way of marking non-manifold areas (red + green).
Any suggestions for how to address this?
The text was updated successfully, but these errors were encountered: