Skip to content

Commit 2a56716

Browse files
committed
use TetGen's minangle default; add radius_edge_ratio flag
1 parent 0ec0c1e commit 2a56716

2 files changed

Lines changed: 29 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
## v2.6.0 June 24, 2025
44

55
- Fixed `minangle` parameter forwarding to TetGen
6-
- New default value `minangle = 10` for `TetGen`, leave default value `20` for `Triangle`
6+
- New default value `minangle = 0` for `TetGen`, leave default value `20` for `Triangle`
7+
- New flag `radius_edge_ratio` for `TetGen`
78

89
## v2.5.0 June 24, 2025
910
- Allow for Triangulate v3

src/options.jl

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@ Create dictionary of mesh generation options with default values. These at once
44
keyword arguments available to the methods of the package and are listed in the following table:
55
66
7-
| keyword | default | 2D | 3D | Explanation |
8-
|:---------------|:-------:|:---:|:---:|:-----------------------------------------------------------|
9-
| PLC | true | -p | -p | Triangulate/tetraheralize PLSG/PLC |
10-
| refine | false | -r | -r | Refines a previously generated mesh. |
11-
| quality | true | -q | -q | Quality mesh generation |
12-
| minangle | 2D: 20 | | | Minimum angle for quality |
13-
| | 3D: 10 | | | |
14-
| volumecontrol | true | -a | -a | Maximum area constraint |
15-
| maxvolume | Inf | | | Value of area/volume constraint if less than Inf |
16-
| attributes | true | -A | -A | Regional attribute to each simplex. |
17-
| confdelaunay | true | -D | | Ensure that all circumcenter lie within the domain. |
18-
| nosteiner | false | -Y | -Y | Prohibits insertion of Steiner points on the mesh boundary |
19-
| quiet | true | -Q | -Q | Suppress all output unless an error occurs. |
20-
| verbose | false | -V | -V | Give detailed information. |
21-
| debugfacets | true | | -d | Detects self-intersections of facets of the PLC. |
22-
| check | false | -C | -C | Checks the consistency of the final mesh. |
23-
| optlevel | 1 | | -O | Specifies the level of mesh optimization. |
24-
| unsuitable | nothing | | | Unsuitable function |
25-
| addflags | "" | | | Additional flags |
26-
| flags | nothing | | | Set flags, overwrite all other options |
7+
| keyword | default | 2D | 3D | Explanation |
8+
|:------------------|:-------:|:---:|:---:|:-----------------------------------------------------------|
9+
| PLC | true | -p | -p | Triangulate/tetraheralize PLSG/PLC |
10+
| refine | false | -r | -r | Refines a previously generated mesh. |
11+
| quality | true | -q | -q | Quality mesh generation |
12+
| minangle | 2D: 20 | | | Minimum angle for quality |
13+
| | 3D: 0 | | | |
14+
| radius_edge_ratio | 2.0 | | | (3D only) Minimum radius/edge ratio for quality |
15+
| volumecontrol | true | -a | -a | Maximum area constraint |
16+
| maxvolume | Inf | | | Value of area/volume constraint if less than Inf |
17+
| attributes | true | -A | -A | Regional attribute to each simplex. |
18+
| confdelaunay | true | -D | | Ensure that all circumcenter lie within the domain. |
19+
| nosteiner | false | -Y | -Y | Prohibits insertion of Steiner points on the mesh boundary |
20+
| quiet | true | -Q | -Q | Suppress all output unless an error occurs. |
21+
| verbose | false | -V | -V | Give detailed information. |
22+
| debugfacets | true | | -d | Detects self-intersections of facets of the PLC. |
23+
| check | false | -C | -C | Checks the consistency of the final mesh. |
24+
| optlevel | 1 | | -O | Specifies the level of mesh optimization. |
25+
| unsuitable | nothing | | | Unsuitable function |
26+
| addflags | "" | | | Additional flags |
27+
| flags | nothing | | | Set flags, overwrite all other options |
2728
2829
2930
For mesh generation, these are turned into mesh generator control flags. This process can be completely
@@ -44,7 +45,8 @@ default_options(mesher) = Dict{Symbol, Any}(
4445
:PLC => true,
4546
:refine => false,
4647
:quality => true,
47-
:minangle => mesher == :triangle ? 20 : 10,
48+
:minangle => mesher == :triangle ? 20 : 0,
49+
:radius_edge_ratio => 2.0,
4850
:volumecontrol => true,
4951
:maxvolume => Inf,
5052
:attributes => true,
@@ -83,12 +85,15 @@ function makeflags(options, mesher)
8385
options[:PLC] ? flags *= "p" : nothing
8486
options[:refine] ? flags *= "r" : nothing
8587
if options[:quality]
88+
radius_edge_ratio = Float64(options[:radius_edge_ratio])
8689
minangle = Float64(options[:minangle])
8790
if mesher == :tetgen
88-
flags *= @sprintf("q/%.2f", minangle)
91+
flags *= @sprintf("q%.2f", radius_edge_ratio)
92+
flags *= @sprintf("/%.2f", minangle)
8993
else
9094
flags *= @sprintf("q%.2f", minangle)
9195
end
96+
9297
end
9398
if options[:volumecontrol]
9499
flags *= "a"

0 commit comments

Comments
 (0)