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

@@ -253,9 +253,16 @@ t(x) = clamp(t_min, t_max, t₀ · (1 + γ · η(x)))
Where t₀ is the nominal rib thickness and γ controls how much density affects thickness.
### 3.2 Geometry Generation: Constrained Delaunay Pipeline
### 3.2 Geometry Generation: Gmsh Frontal-Delaunay Pipeline
The geometry generation pipeline converts the density field into a manufacturable 2D rib profile. The recommended approach uses Jonathan Shewchuk's Triangle library (Python binding: `triangle`) for constrained Delaunay triangulation with area constraints.
The geometry generation pipeline converts the density field into a manufacturable 2D rib profile. **Production implementation uses Gmsh's Frontal-Delaunay algorithm** (Python binding: `gmsh`) for superior adaptive meshing with background size fields.
**Why Gmsh over Triangle library:**
- **Frontal-Delaunay** advances from boundaries inward → better boundary conformance, more regular triangles
- **Background size fields** handle density variation in ONE pass (no iterative refinement)
- **Boolean geometry operations** → cleaner hole handling than PSLG workarounds
- **Better triangle quality** → min angles 30-35° vs 25-30°, tighter distribution around equilateral (60°)
- **Manufacturable patterns** → more uniform rib widths, smoother pocket shapes
**Step 1 — Define the Planar Straight Line Graph (PSLG):**