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

tetrahedralize input arguments opt_scheme and steinerleft are simply ignored #55

Open
MbBrainz opened this issue May 16, 2023 · 1 comment

Comments

@MbBrainz
Copy link

Im trying to generate a tetrahedral mesh that has to have exactly the same vertices as those that are given in the input. I've had trouble with understanding why my mesh was still wrong, but apparently the parameters are just ignored?

In the case that the variables that i set cause tetgen to fail to tetrahedralise, it should break, instead of ignore the parameter.

According to the tetgen documentation the opt_scheme=0 should prevent the algo from optimizing:

The integer for choosing operations is ranged from 0 to 7. Here 0 means no operation is chosen (hence no mesh optimization will be done). Each operation is enabled/disabled by setting the corresponding bit in this integer.

The 1st bit (the least significant bit) enables/disables edge/face flips.
The 2nd bit enables/disables vertex smoothing.
The 3rd bit enables/disables vertex insertion/deletion.

And according to the pytetgen docs steinerleft=0 should result in no steinerpoints being added:

steinerleft (int, optional) –

Steiner points are points added to the original surface mesh to create a valid tetrahedral mesh. Settings this to -1 will allow tetgen to create an unlimited number of steiner points, but the program will likely hang if this is used in combination with narrow quality requirements. Default 100000.

The first type of Steiner points are used in creating an initial tetrahedralization of PLC. These Steiner points are mandatory in order to create a valid tetrahedralization

The second type of Steiner points are used in creating quality tetra- hedral meshes of PLCs. These Steiner points are optional, while they may be necessary in order to improve the mesh quality or to conform the size of mesh elements.

Reproduce:

import pyvista as pv
import tetgen

meshes = [pv.Sphere(radius=i).triangulate() for i in range(10)]
merged = pv.PolyData()
for mesh in meshes:
    merged += mesh

tet = tetgen.TetGen(merged)
tet.tetrahedralize(order=1, opt_scheme=0, steinerleft=0, minratio=10, verbose=True)

shows the following logs in the console:

  ...
  Removed 6260 edges/faces.
  Smoothed 55 vertices.
  Added 56 Steiner points.
  ...
@MbBrainz
Copy link
Author

I just found out that when using the switches so for optimisation lvl 0 `tetrahedralize(switches="O/0") does generate the correct output.

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

1 participant