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

How to make fTetWild respect the input triangles? #48

Open
Mathias-Fuchs opened this issue Aug 24, 2022 · 6 comments
Open

How to make fTetWild respect the input triangles? #48

Mathias-Fuchs opened this issue Aug 24, 2022 · 6 comments

Comments

@Mathias-Fuchs
Copy link

Hello,
this is probably just a question, not an issue, but it bugs me. I hope it can be resolved relatively easily: fTetWild generates a nice tetrahedral mesh of the volume enclosed by the watertight input surface mesh. However, the input vertices do in general not appear among the output vertices - and therefore the input triangles do not even have a chance to appear as faces of output tetrahedra. However, this effect would be very desirable.
How can one force the output tets to conform to the input points and triangles?
Thanks for help.

@Yixin-Hu
Copy link
Collaborator

Hi,

Unfortunately, fTetWild does not support input faces/vertices conforming. fTetWild is originally designed for bad input meshes whose connectivity is imperfect and thus is not worth being preserved exactly.

@Mathias-Fuchs
Copy link
Author

Mathias-Fuchs commented Aug 25, 2022 via email

@Yixin-Hu
Copy link
Collaborator

The vertices could move even without the optimization step for fTetWild.

If you use TetWIld (https://github.com/Yixin-Hu/TetWild), then the input vertices and faces (geometry not topology) would be preserved exactly in a tetmesh with rational coordinates before the optimization step. But once the rational mesh is converted into floats, the mesh could have inverted tets. Note that the mesh without optimization is just an intermediate result which unfortunately is useless in many cases.

@Yixin-Hu Yixin-Hu pinned this issue Aug 25, 2022
@Yixin-Hu Yixin-Hu unpinned this issue Aug 25, 2022
@Mathias-Fuchs
Copy link
Author

I see. Ok, so let's assume the user:

  • is fine with numerical issues around rational -> float conversion
  • is able to spin a Kd-tree for identifying points that were moved slightly away
  • has a high quality input mesh (as close to Delaunay as possible) so that triangles are likely to be recovered if only the points are used,

and just needs to find a mapping from input vertices to output vertices, then what exactly should they use according to your recommendation? tetwild or ftetwild without optimization, or a function within tetwild?
Best regards, Mathias

@Yixin-Hu
Copy link
Collaborator

I would recommend to use TetWild: You can use the mesh generated before this line (https://github.com/Yixin-Hu/TetWild/blob/master/src/tetwild/MeshRefinement.cpp#L237). The input N vertices are the first N vertices in the mesh (It should be, but please double-check it. We remove duplicated vertices if two vertices are too close to each other. ).

Note that this mesh is embedded in a box. The embedded surface can be tracked via this variable is_surface_fs (https://github.com/Yixin-Hu/TetWild/blob/master/src/tetwild/TetmeshElements.h#L118): for example, if is_surface_fs[i] is true then the i-th face ((i+1)%4, (i+2)%4, (i+3)%4) is on the input surface.

@lNatxii
Copy link

lNatxii commented May 1, 2024

Hi! I don't understand... :)

I know that fTetWild is not able to keep the external triangle distribution, but with TetWild I have also achieved it, and I need it to be able to assign again to the .vtk model (that I generate with the .msh) the texture coordinates (UV) that the original .obj had, and I can only do that if the surface vertices are the same.

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

No branches or pull requests

3 participants