Closed Megidd closed 1 year ago
Weird artifacts at the top of the model. There are probably bugs in the SDF calculation for an STL mesh. Even so - I understood that the original model was clean (based on beziers) so I don't understand the assymmetric weirdness around the lid.
I switched to uniform marching cubes for a better render.
@deadsy That's right. The weird artifacts are observed by me too.
Octree
MarchingCubesMy original input STL is this:
The inside of the input model carved out by the following statement is:
inside := sdf.Offset3D(imported, -wallThickness) // Pass negative value for inside.
render.ToSTL(inside, "inside-carved-out.stl", render.NewMarchingCubesOctree(300))
The problem is that the rendered mesh has some artifacts. Like missing polygons.
Nominally the octree and uniform renderers should produce the same result. If you have code where the SDF is not computed exactly (E.g. screw threads) then the octree renderer shows errors (missing polygons) while the uniform renderer is typically ok because it gets in closer to the surface.
That's what is happening here - There are some concavities that the uniform renderer shows up while the octree renderer leaves gaps.
General thoughts:
1) I didn't write ImportSTL :-). I haven't done much with it. I suspect it has bugs for some cases.
2) Are the artefacts coming from the model? I'd probably rotate a few bezier curves, do the offset and see what it looks like.
Uniform
MarchingCubes@deadsy Right :+1: Now, the inside mesh is a bit messed up, but no polygon is missing. That's good enough for our use cases which is hollowing 3D models. Because, no body is actually able to see the inside of a 3D model. They just want to hollow it out :slightly_smiling_face:
Playing around with the hollowing example.