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

remesh_botsch does not work for non-closed meshes #30

Closed
EmJay276 opened this issue Sep 16, 2022 · 11 comments
Closed

remesh_botsch does not work for non-closed meshes #30

EmJay276 opened this issue Sep 16, 2022 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@EmJay276
Copy link
Contributor

I tried to remesh a non-closed/ watertight mesh with the remesh_botsch algorithm.
Compared to a closed mesh (with almost the same size) it takes a lot longer (>100 times) and returns an error by exiting my python console.

  • Is your implementation not useable for non-closed meshes? The original paper has options for the boundary.
@sgsellan
Copy link
Owner

Hi EmJay! If I recall correctly, you must fix the boundary vertices as feature vertices for the method to work. Actually remising the boundary is not supported. Could you please attach the mesh you used and the exact command you ran to encounter this problem?

@sgsellan sgsellan self-assigned this Sep 16, 2022
@EmJay276
Copy link
Contributor Author

I will try to build a minimal example, my code / mesh is currently rather complicated (result of an toplogy optimization, I want to remesh partially).

@EmJay276
Copy link
Contributor Author

EmJay276 commented Sep 21, 2022

Here is a minimal example

vertices_full, faces_full = gpytoolbox.read_mesh('mesh_full.obj')
U, G = gpytoolbox.remesh_botsch(vertices_full, faces_full)

Works fine

vertices_part, faces_part = gpytoolbox.read_mesh('mesh_part.obj')
U2, G2 = gpytoolbox.remesh_botsch(vertices_part, faces_part)

Process finished with exit code -1073741819 (0xC0000005)

meshes.zip

@sgsellan
Copy link
Owner

Hi EmJay!

The PR #32 should fix this issue. Running your command from above now works without issue (the boundary vertices are not remeshed). Once the PR is merged, you can either wait for the 0.0.3 release or build the library locally running pip install . Thanks for raising this issue and for using our library!

-Silvia

@EmJay276
Copy link
Contributor Author

Hi Silvia,
thank you very much for the very fast fix and also adding the feature vector, that's exactly what I needed!
Michael

@sgsellan sgsellan added the bug Something isn't working label Sep 21, 2022
@EmJay276
Copy link
Contributor Author

EmJay276 commented Nov 8, 2022

@sgsellan
Hi Silvia,
is it somehow possible to keep track of the "feature" vector or at least of the points which are removed?

Before remeshing I know which point is is on which face of my model (I need this info for edge detection / projection on the original surface - like a sphere / cylinder). But even the feature "points" change their index during remeshing.

Simplified example:

  • Input:
    • Points - P0 = [A, B, C, D, E]
    • Feature points - F0 = [A, B, E] (indices 0, 1, 4 in P0)
  • Remeshing removes point D
  • Output points - P1 = [A, B, C*, E]
  • Feature points now have the indices 0, 1, 3

I could try to find the index of each point of P1 in P0, but this seems very tedious and not very practical for large models.

-Michael

@sgsellan sgsellan reopened this Dec 29, 2022
@sgsellan sgsellan added enhancement New feature or request and removed bug Something isn't working labels Dec 29, 2022
@EmJay276
Copy link
Contributor Author

@sgsellan
My current workaround for this is too reorder the input, so all fixed nodes are at the beginning of the array.

A solution would be to also return the indices of the fixed nodes after the remesh.

@sgsellan
Copy link
Owner

sgsellan commented Dec 29, 2022

Interesting workaround! I'll set a low priority to this but it's a nice / feasible thing to add to the remesher (would also be happy to merge a PR that did it 😉 !)

@EmJay276
Copy link
Contributor Author

I can try to create a PR, but I'm not very familiar with C code. Don't count on me 😅

@sgsellan
Copy link
Owner

sgsellan commented Jan 2, 2023

Oh, maybe even just a PR that only touches the python code in src/gpytoolbox/remesh_botsch.py to reorder the mesh such that feature vertices are first and calls the C++ remesher like in your hotfix? We could just add in the documentation that the n fixed vertices are returned first. After all, the output ordering right now is arbitrary.

@EmJay276
Copy link
Contributor Author

EmJay276 commented Jan 2, 2023

👍 I try to send the PR by end of the week

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