JuliaGeometry/TetGen.jl

Triangle mesh support?

chakravala opened this issue · 5 comments

Is there a way to generate 2D triangle meshes with TetGen also?

I'll refer this question to @Kevin-Mattheus-Moerman, who knows TetGen very well ;)

I don't think it can. It can remesh your input surface while doing a tet mesh but it is quite bad at surface remeshing. There are much better libraries for that. I only use TetGen for interior tetrahedron generation (and make sure I pass it a high quality surface mesh) and make sure to use the -Y switch so it doesn't remesh the surface.

What's an example of where the resulting surface mesh is inadequate? Just trying to understand the potential issues.

@chakravala perhaps explain what you'd like to do. For surface meshing I'd use a dedicated surface meshing tool not tetGen (tetgen tends to just "slash" existing triangles to add nodes, this does not create a high quality surface mesh but creates sharp triangles, may be fine for some applications but for finite element analysis these would result in bad elements). If it is a 2D polygon then a constrained Delaunay would do (perhaps look here: https://github.com/JuliaGeometry/VoronoiDelaunay.jlf). If it is a general 3D surface with triangles on it then other methods are more suitable (check out https://homepages.loria.fr/BLevy/GEOGRAM/geobox.html and use remesh smooth option on an input surface).

j-fu commented

See e.g. Triangulate.jl for this functionality.