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

Create manifold STL meshes #19

Merged
merged 2 commits into from
Oct 4, 2020
Merged

Create manifold STL meshes #19

merged 2 commits into from
Oct 4, 2020

Conversation

danieltwagner
Copy link
Contributor

I made some headway on #18 - when interpolating points along the cube edges we bailed early if v1 or v2 was close to zero. However, if both v1 and v2 are close to zero then picking one or the other point means we might get unstable results depending on the order in which edges are evaluated.

This PR proposes to pick the midpoint between the two edges if there's no meaningful difference between the SDF values at the respective endpoints. Together with the script posted in #18 this helps with single-incident edges:

bottom-octtree.stl before:

Number of edges with 1 incident faces: 896
Number of edges with 2 incident faces: 963776
Number of edges with 3 incident faces: 5
Number of edges with 4 incident faces: 300
Number of edges with 5 incident faces: 3
Number of edges with 6 incident faces: 1565

bottom-octtree.stl after:

Number of edges with 2 incident faces: 964678
Number of edges with 4 incident faces: 82
Number of edges with 6 incident faces: 1564

@danieltwagner danieltwagner mentioned this pull request Oct 3, 2020
@danieltwagner danieltwagner changed the title Partial fix for non-manifold meshes Create manifold STL meshes Oct 3, 2020
@danieltwagner
Copy link
Contributor Author

I added a second patch to omit faces with zero area (more specifically, triangles where at least one vertex is duplicated). With both patches applied we produce manifold STL meshes.

I would appreciate feedback on the approach and side-effects of the first patch (does it degrade any other functionality?) and perhaps you have thoughts around how to accomplish what the second patch does in a cleaner way. My understanding is this only happens if we pick the same extreme (=edge endpoint) for two edges of a face in mcInterpolate.

@deadsy
Copy link
Owner

deadsy commented Oct 4, 2020

Looks good - and apparently fixes the source of trouble for this particular model.

@deadsy deadsy merged commit 1f4a668 into deadsy:master Oct 4, 2020
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.

2 participants