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

All vertices are detected as boundary vertices #68

Closed
EmJay276 opened this issue Feb 27, 2023 · 5 comments
Closed

All vertices are detected as boundary vertices #68

EmJay276 opened this issue Feb 27, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@EmJay276
Copy link
Contributor

I tried to remesh some models from the Engineering Shape Benchmark (ESB)

For example backdoor.stl from the Flat-Thin Wallcomponents.tar.gz

The result using remesh_botsch is exactly the same as the input.

import gpytoolbox as gpy
v, f = gpy.read_mesh(r"C:\Users\Michael\Desktop\Flat-Thin-Wallcomponents\Flat-Thin Wallcomponents\Back Doors\backdoor.stl")
u, g = gpy.remesh_botsch(v, f, h=None)

I discovered all vertices of the model are detected as boundary vertices by boundary_vertices(f)

But the model has clearly some "inner" vertices (at least on the rounded part in the middle.
grafik

@EmJay276
Copy link
Contributor Author

I've added a PR #69 with a warning in the case of all vertices are boundary vertices.

But I think there is an issue with the boundary_vertices method in this case.

@EmJay276
Copy link
Contributor Author

I noticed a really weird behaviour, the stl seems to have unique vertices per face (=> the faces are unconnected)
I don't know if this is due to the file or due to the new STL import.

@sgsellan
Copy link
Owner

Hi @EmJay276 ! Thanks for submitting this issue.

In fact, this is the intended behaviour: an STL file contains no connectivity information, as it just stores a set of individual triangles without any relations between them. So, reading an STL file will return a lot of individual triangles and, since there's no connection between them, boundary_faces will correctly identify all of them as boundaries.

Still, I can see why this is confusing. The easiest thing to do is add a well-documented flag to the stl reader that optionally merges all duplicate vertices (with remove_duplicate_vertices). I believe the boundary will be properly identified in that case.

@sgsellan sgsellan added the enhancement New feature or request label Feb 27, 2023
@sgsellan
Copy link
Owner

I just pushed an enhancement of our STL read_mesh function to automatically merge STL vertices by default (pushed to. main instead of a PR branch because I haven't had enough caffeine today, it seems haha). Can you confirm this issue is solved and if so, close it?

Thanks for reporting!

@EmJay276
Copy link
Contributor Author

Thanks for the fast fix! You should get some coffee ☕ 😄
Yes, I think the default behaviour should be to merge duplicate vertices when importing an STL.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants