feat: Switch isogrid to Gmsh Frontal-Delaunay meshing (production default)

Replaces Triangle library with Gmsh as the default triangulation engine for
adaptive isogrid generation. Gmsh's Frontal-Delaunay algorithm provides:

- Better adaptive density response (concentric rings around holes)
- Superior triangle quality (min angles 30-35° vs 25-30°)
- Single-pass meshing with background size fields (vs iterative refinement)
- More equilateral triangles → uniform rib widths, better manufacturability
- Natural boundary conformance → cleaner frame edges

Comparison results (mixed hole weights plate):
- Min angle improvement: +5.1° (25.7° → 30.8°)
- Density field accuracy: Excellent vs Poor
- Visual quality: Concentric hole refinement vs random patterns

Changes:
- Updated src/brain/__main__.py to import triangulation_gmsh
- Added gmsh>=4.11 to requirements.txt (Triangle kept as fallback)
- Updated README and technical-spec.md
- Added comparison script and test results

Triangle library remains available as fallback option.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 17:05:19 -05:00
parent 906037f974
commit 5c63d877f0
11 changed files with 1523 additions and 6 deletions

View File

@@ -0,0 +1,706 @@
{
"valid": true,
"outer_boundary": [
[
0,
0
],
[
200,
0
],
[
200,
150
],
[
0,
150
]
],
"pockets": [
{
"lines": [
[
[
105.49324706604203,
111.99399406602726
],
[
104.69325284471185,
99.18460661832634
]
],
[
[
94.15543892662492,
95.64679512131026
],
[
85.29291408692532,
105.95402850887238
]
],
[
[
88.33828036887326,
115.67424480668245
],
[
98.00079942990303,
118.17639886682124
]
]
],
"arcs": [
{
"tangent_start": [
98.00079942990303,
118.17639886682124
],
"tangent_end": [
105.49324706604203,
111.99399406602726
],
"center": [
99.50491435708516,
112.3679878719081
],
"radius": 6.0,
"start_angle": 1.8241849598647701,
"end_angle": -0.06237273515998526
},
{
"tangent_start": [
104.69325284471185,
99.18460661832634
],
"tangent_end": [
94.15543892662492,
95.64679512131026
],
"center": [
98.70492013575497,
99.55860042420719
],
"radius": 6.0,
"start_angle": -0.06237273515998526,
"end_angle": -2.431416234376267
},
{
"tangent_start": [
85.29291408692532,
105.95402850887238
],
"tangent_end": [
88.33828036887326,
115.67424480668245
],
"center": [
89.84239529605539,
109.8658338117693
],
"radius": 6.0,
"start_angle": -2.431416234376268,
"end_angle": 1.8241849598647701
}
]
}
],
"holes": [
{
"center": [
30,
30
],
"radius": 5.0,
"is_circular": true
},
{
"center": [
170,
30
],
"radius": 5.0,
"is_circular": true
},
{
"center": [
170,
120
],
"radius": 5.0,
"is_circular": true
},
{
"center": [
30,
120
],
"radius": 5.0,
"is_circular": true
}
],
"rib_web": [
{
"exterior": [
[
0.0,
150.0
],
[
200.0,
150.0
],
[
200.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
150.0
]
],
"interiors": [
[
[
84.11682477736936,
111.65966831794691
],
[
83.84592751703507,
109.65998392672893
],
[
84.25331787621653,
107.683584147994
],
[
85.29291408692532,
105.95402850887238
],
[
94.15543892662492,
95.64679512131026
],
[
96.01020468293075,
94.19776945985937
],
[
98.279644584269,
93.57369100924456
],
[
100.61452767573361,
93.87059558566699
],
[
102.65555232913637,
95.04279426443698
],
[
104.0886370883989,
96.90990418382506
],
[
104.69325284471185,
99.18460661832634
],
[
105.49324706604203,
111.99399406602726
],
[
105.31532829715924,
113.86434673427792
],
[
104.56768646684223,
115.58797833224581
],
[
103.32362939735935,
116.99588322953922
],
[
101.70513944823516,
117.95001344944481
],
[
99.87091289450713,
118.35681455754569
],
[
98.00079942990303,
118.17639886682124
],
[
88.33828036887326,
115.67424480668245
],
[
86.49765441293553,
114.84706944409857
],
[
85.03536724161461,
113.45644396657856
],
[
84.11682477736936,
111.65966831794691
]
],
[
[
32.5,
34.33
],
[
31.294,
34.83
],
[
30.0,
35.0
],
[
28.706,
34.83
],
[
27.5,
34.33
],
[
26.464,
33.536
],
[
25.67,
32.5
],
[
25.17,
31.294
],
[
25.0,
30.0
],
[
25.17,
28.706
],
[
25.67,
27.5
],
[
26.464,
26.464
],
[
27.5,
25.67
],
[
28.706,
25.17
],
[
30.0,
25.0
],
[
31.294,
25.17
],
[
32.5,
25.67
],
[
33.536,
26.464
],
[
34.33,
27.5
],
[
34.83,
28.706
],
[
35.0,
30.0
],
[
34.83,
31.294
],
[
34.33,
32.5
],
[
33.536,
33.536
],
[
32.5,
34.33
]
],
[
[
173.536,
33.536
],
[
172.5,
34.33
],
[
171.294,
34.83
],
[
170.0,
35.0
],
[
168.706,
34.83
],
[
167.5,
34.33
],
[
166.464,
33.536
],
[
165.67,
32.5
],
[
165.17,
31.294
],
[
165.0,
30.0
],
[
165.17,
28.706
],
[
165.67,
27.5
],
[
166.464,
26.464
],
[
167.5,
25.67
],
[
168.706,
25.17
],
[
170.0,
25.0
],
[
171.294,
25.17
],
[
172.5,
25.67
],
[
173.536,
26.464
],
[
174.33,
27.5
],
[
174.83,
28.706
],
[
175.0,
30.0
],
[
174.83,
31.294
],
[
174.33,
32.5
],
[
173.536,
33.536
]
],
[
[
174.33,
122.5
],
[
173.536,
123.536
],
[
172.5,
124.33
],
[
171.294,
124.83
],
[
170.0,
125.0
],
[
168.706,
124.83
],
[
167.5,
124.33
],
[
166.464,
123.536
],
[
165.67,
122.5
],
[
165.17,
121.294
],
[
165.0,
120.0
],
[
165.17,
118.706
],
[
165.67,
117.5
],
[
166.464,
116.464
],
[
167.5,
115.67
],
[
168.706,
115.17
],
[
170.0,
115.0
],
[
171.294,
115.17
],
[
172.5,
115.67
],
[
173.536,
116.464
],
[
174.33,
117.5
],
[
174.83,
118.706
],
[
175.0,
120.0
],
[
174.83,
121.294
],
[
174.33,
122.5
]
],
[
[
34.83,
121.294
],
[
34.33,
122.5
],
[
33.536,
123.536
],
[
32.5,
124.33
],
[
31.294,
124.83
],
[
30.0,
125.0
],
[
28.706,
124.83
],
[
27.5,
124.33
],
[
26.464,
123.536
],
[
25.67,
122.5
],
[
25.17,
121.294
],
[
25.0,
120.0
],
[
25.17,
118.706
],
[
25.67,
117.5
],
[
26.464,
116.464
],
[
27.5,
115.67
],
[
28.706,
115.17
],
[
30.0,
115.0
],
[
31.294,
115.17
],
[
32.5,
115.67
],
[
33.536,
116.464
],
[
34.33,
117.5
],
[
34.83,
118.706
],
[
35.0,
120.0
],
[
34.83,
121.294
]
]
]
}
],
"parameters_used": {
"eta_0": 0.1,
"alpha": 1.0,
"R_0": 30.0,
"kappa": 1.0,
"p": 2.0,
"beta": 0.3,
"R_edge": 15.0,
"s_min": 20.0,
"s_max": 80.0,
"t_min": 2.5,
"t_0": 3.0,
"gamma": 1.0,
"w_frame": 8.0,
"r_f": 6.0,
"d_keep": 1.5,
"min_pocket_radius": 6.0,
"min_triangle_area": 20.0,
"thickness": 8.0
},
"checks": {
"is_valid_geometry": true,
"min_web_width": true,
"no_islands": true,
"no_self_intersections": true,
"mass_estimate_g": 632.8649797312323,
"area_mm2": 29299.30461718668,
"num_interiors": 5
},
"pipeline": {
"geometry_file": "tests\\test_geometries\\small_plate_200x150.json",
"num_vertices": 144,
"num_triangles": 204,
"num_pockets": 1,
"validation_ok": true
}
}