Skip to content
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

Hollowing #54

Merged
merged 3 commits into from
Oct 27, 2022
Merged

Hollowing #54

merged 3 commits into from
Oct 27, 2022

Conversation

Megidd
Copy link
Contributor

@Megidd Megidd commented Oct 27, 2022

Playing around with the hollowing example.

@deadsy deadsy merged commit f14b8dc into deadsy:master Oct 27, 2022
@deadsy
Copy link
Owner

deadsy commented Oct 27, 2022

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.
Screenshot_20221027_055837

I switched to uniform marching cubes for a better render.

@Megidd
Copy link
Contributor Author

Megidd commented Oct 27, 2022

@deadsy That's right. The weird artifacts are observed by me too.

@Megidd
Copy link
Contributor Author

Megidd commented Oct 27, 2022

Observation with Octree MarchingCubes

My original input STL is this:

Screenshot_20221027_155942

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))

Screenshot_20221027_160651

Problem

The problem is that the rendered mesh has some artifacts. Like missing polygons.

Screenshot_20221027_161018

@deadsy
Copy link
Owner

deadsy commented Oct 27, 2022

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.

@Megidd
Copy link
Contributor Author

Megidd commented Oct 27, 2022

Observation with Uniform MarchingCubes

@deadsy Right 👍 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 🙂

Screenshot_20221027_165004

@Megidd Megidd deleted the hollowing branch October 27, 2022 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants