Commit Graph

380 Commits

Author SHA1 Message Date
4341215af2 chore(hq): daily sync 2026-03-28 2026-03-28 09:00:40 +00:00
540d97a7e1 chore(hq): daily sync 2026-03-27 2026-03-27 09:00:44 +00:00
fcc716db95 chore(hq): daily sync 2026-03-26 2026-03-26 09:00:36 +00:00
4d09ce2a2e chore(hq): daily sync 2026-03-20 2026-03-20 09:00:26 +00:00
f14cbfd6aa chore(hq): daily sync 2026-03-12 2026-03-12 09:00:33 +00:00
cc683de192 chore(hq): daily sync 2026-03-11 2026-03-11 09:00:32 +00:00
d17611eec0 chore(hq): daily sync 2026-03-10 2026-03-10 09:00:27 +00:00
075ad36221 feat(V&V): Phase 2 — prysm cross-validation + report figure generator
- cross_validate_prysm.py: 4 tests against prysm v0.21.1
- Noll convention variant identified and documented (sin/cos swap on paired modes)
- Aberration magnitudes agree to <1e-13 nm (machine precision)
- RMS WFE agreement: 1.4e-14 nm difference
- generate_validation_report.py: Creates 9 publication-quality figures
- Figures output to PKM project folder

Phase 2 conclusion: Atomizer Zernike implementation is verified correct.
2026-03-09 16:03:42 +00:00
4146e9d8f1 feat(V&V): Updated to FEA CSV format + real M2 mesh injection
- Output now matches WFE_from_CSV_OPD format: ,X,Y,Z,DX,DY,DZ (meters)
- Suite regenerated using real M2 mesh (357 nodes, 308mm diameter)
- All 14 clean test cases: PASS (0.000 nm error)
- 3 noisy cases: expected FAIL due to low node count amplifying noise
- Added --inject mode to use real FEA mesh geometry
- Added lateral displacement test case
2026-03-09 15:56:23 +00:00
f9373bee99 feat(V&V): Zernike pipeline validation - synthetic WFE generator + round-trip validator
- generate_synthetic_wfe.py: Creates synthetic OPD surfaces from known Zernike coefficients
- validate_zernike_roundtrip.py: Round-trip validation (generate → fit → compare)
- validation_suite/: 18 test cases (single mode, multi-mode, noisy, edge cases)
- All 18 test cases pass with 0.000 nm error (clean) and <0.3 nm (10nm noise)
- M1 params: 1200mm dia, 135.75mm inner radius, 50 Noll modes

Project: P-Zernike-Validation (GigaBIT M1)
Requested by: Adyn Miles (StarSpec) for risk reduction before M2/M3 ordering
2026-03-09 15:49:06 +00:00
9b0769f3f4 chore(hq): daily sync 2026-03-09 2026-03-09 09:00:23 +00:00
11d212a476 chore(hq): daily sync 2026-03-08 2026-03-08 09:00:23 +00:00
b3162aa78d Tier 2 dev workflow: Windows test runner + result sync
- run_tests.bat: double-click test runner with JSON result capture
- run_script.bat: run any script with output capture
- test_results/ folder for Syncthing-based result sharing
- Auto-mark NX-dependent tests for --quick mode
- pytest-json-report for structured results
2026-03-07 14:07:32 +00:00
a069a9f21f chore(hq): daily sync 2026-03-07 2026-03-07 10:00:24 +00:00
ae120c653e chore(hq): daily sync 2026-03-06 2026-03-06 10:00:27 +00:00
1b83159050 Fix NX path to DesigncenterNX2512 2026-03-05 15:34:55 +00:00
c930728b1c Add GigaBIT M1 frame stiffness characterization project
- 3 studies: sensitivity (Method D), stiffness sweep (Method B), robustness
- Atomizer specs with run matrices, Zernike annular OPD extractor
- War-room validated hybrid B+D method
2026-03-05 15:34:41 +00:00
d299e168a3 chore(hq): daily sync 2026-03-05 2026-03-05 10:00:22 +00:00
a6765d8a1f chore(hq): daily sync 2026-03-04 2026-03-04 10:00:20 +00:00
119011b420 chore(hq): daily sync 2026-03-02 2026-03-02 10:05:24 +00:00
cf29e0aba5 chore(hq): daily sync 2026-03-01 2026-03-01 10:00:23 +00:00
1873e1865c chore(hq): daily sync 2026-02-28 2026-02-28 10:00:23 +00:00
25c415b52f chore(hq): daily sync 2026-02-27 2026-02-27 10:00:23 +00:00
6b17d73ef7 chore(hq): daily sync 2026-02-26 2026-02-26 10:00:21 +00:00
074632d0a9 chore(hq): daily sync 2026-02-25 2026-02-25 10:00:23 +00:00
b448ca6268 auto: daily sync 2026-02-25 08:00:14 +00:00
2026572d91 chore(hq): daily sync 2026-02-24 2026-02-24 10:00:18 +00:00
c7ef38282f auto: daily sync 2026-02-24 08:00:09 +00:00
1f58bb8016 chore(hq): daily sync 2026-02-23 v1-final 2026-02-23 10:00:17 +00:00
31d21ec551 chore(hq): daily sync 2026-02-22 2026-02-22 10:00:18 +00:00
2b976cf872 chore(hq): daily sync 2026-02-21 2026-02-21 10:00:16 +00:00
39212aaf81 auto: daily sync 2026-02-21 08:00:14 +00:00
7acda7f55f chore(hq): daily sync 2026-02-20 2026-02-20 10:00:13 +00:00
c59072eff2 auto: daily sync 2026-02-20 08:00:17 +00:00
176b75328f chore(hq): daily sync 2026-02-19 2026-02-19 10:00:18 +00:00
7eb3d11f02 auto: daily sync 2026-02-19 08:00:36 +00:00
6658de02f4 feat(isogrid): FEA stress field → 2D heatmap → adaptive density feedback
Closes the optimization loop: OP2 results → density field refinement.

**extract_stress_field_2d.py (new)**
- Reads OP2 (3D solid or 2D shell elements) + BDF via pyNastran
- Projects element centroids to 2D sandbox coords using geometry transform
- Averages stress through thickness (for solid 3D meshes)
- Normalises by sigma_yield to [0..1]
- save/load helpers (NPZ) for trial persistence

**stress_feedback.py (new)**
- StressFeedbackField: converts 2D stress scatter → smooth density modifier
- Gaussian blur (configurable radius, default 40mm) prevents oscillations
- RBF interpolator (thin-plate spline) for fast pointwise evaluation
- evaluate(x, y) returns S_stress ∈ [0..1]
- from_field() and from_npz() constructors

**density_field.py (modified)**
- evaluate_density() now accepts optional stress_field= argument
- Adaptive formula: η = η₀ + α·I + β·E + γ·S_stress
- gamma_stress param controls feedback gain (0.0 = pure parametric)
- Fully backward compatible (no stress_field = original behaviour)

Usage:
    field = extract_stress_field_2d(op2, bdf, geometry["transform"], sigma_yield=276.0)
    feedback = StressFeedbackField.from_field(field, blur_radius_mm=40.0)
    eta = evaluate_density(x, y, geometry, params, stress_field=feedback)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 11:13:28 -05:00
a9c40368d3 feat(isogrid): Add DRAW_HOLES flag to skip bolt holes in NX import
Default: DRAW_HOLES = False (holes already exist in the solid body).

Config block in import_profile.py is now:
  DRAW_OUTER_BOUNDARY = False  (sandbox perimeter — not needed for subtract)
  DRAW_HOLES          = False  (bolt holes — already in existing body)

Sketch now imports ONLY the rib pocket profiles, ready for Subtract extrude.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 09:49:08 -05:00
98774453b3 feat(isogrid): Skip outer boundary in NX sketch import (subtract workflow)
Add DRAW_OUTER_BOUNDARY flag (default: False) to import_profile.py.

When False (default): only pocket profiles + holes are imported into the
sketch. This is the correct mode when subtracting rib pockets from an
existing solid body — the sandbox perimeter is not needed and would create
unwanted edges in the part.

When True: full profile including sandbox perimeter (original behavior,
for standalone plate creation only).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 09:46:07 -05:00
d8570eaa2d chore(hq): daily sync 2026-02-18 2026-02-18 10:00:34 +00:00
68a6b4763b auto: daily sync 2026-02-18 08:00:16 +00:00
8efa8ba0d1 feat(isogrid): Add update-in-place NX import + 3 density field variations
Major improvements to NX import workflow and rib pattern generation:

**NX Import (import_profile.py)**
- Smart sketch management: detects existing sketches and updates in-place
- Preserves extrude references (no manual re-reference needed!)
- First run: creates new sketch + auto-extrude
- Subsequent runs: clears geometry, redraws, extrude regenerates automatically
- Added _find_sketch_by_name() and _clear_sketch_geometry() functions

**Rib Pattern Variations**
Generated 3 different density field strategies for testing NX updates:
- Balanced (α=1.0, β=0.3): Original moderate density - 86 pockets, 2,499g
- Edge-focused (α=0.3, β=1.5): Dense ribs near boundaries - 167 pockets, 2,328g
- Hole-focused (α=1.8, β=0.15): Dense around holes - 62 pockets, 3,025g

**New Files**
- import_profile_update_test.py: Standalone update-only test script
- params_large_triangles.json: s_min=30mm, s_max=100mm (larger triangles)
- params_edge_focused.json: β=1.5 (boundary reinforcement)
- params_hole_focused.json: α=1.8 (hole reinforcement)
- sandbox_results/{edge_focused,hole_focused}/: Complete rib profile sets

**Test Results (Sandbox 1)**
- 833 triangles with large triangle params (vs 1,501 with previous params)
- Edge-focused: 1,155 triangles, 167 pockets (2x denser)
- Hole-focused: 523 triangles, 62 pockets (sparse pattern)

This enables rapid rib pattern iteration in NX without losing extrude references!

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 22:02:41 -05:00
6ed074dbbf feat(isogrid): Finalize Gmsh Frontal-Delaunay as production mesher
Archive Triangle library implementation and establish Gmsh as the official
production default for adaptive isogrid generation.

## Changes

**Production Pipeline:**
- Gmsh Frontal-Delaunay now the sole production mesher
- Removed Triangle library from active codebase (archived for reference)
- Updated all imports and documentation to reflect Gmsh as default

**Archived:**
- Moved `src/brain/triangulation.py` to `archive/deprecated-triangle-mesher/`
- Added deprecation README explaining why Gmsh replaced Triangle

**Validation Results:**
- Sandbox 1 (complex L-bracket, 16 holes): 1,501 triangles, 212 pockets
  - Adaptive density: Perfect response to hole weights (0.28-0.84)
  - Min angle: 1.4° (complex corners), Mean: 60.0° (equilateral)
  - Boundary conformance: Excellent (notches, L-junctions)

- Sandbox 2 (H-bracket, no holes): 342 triangles, 47 pockets
  - Min angle: 1.0°, Mean: 60.0°
  - Clean rounded corner handling

**Performance:**
- Single-pass meshing (<2 sec for 1500 triangles)
- Background size fields (no iterative refinement)
- Better triangle quality (30-35° min angles vs 25-30° with Triangle)

**Why Gmsh Won:**
1. Natural boundary conformance (Frontal-Delaunay advances from edges)
2. Single-pass adaptive sizing (vs 3+ iterations with Triangle)
3. Boolean hole operations (vs PSLG workarounds)
4. More manufacturable patterns (equilateral bias, uniform ribs)
5. Cleaner code (no aggressive post-filtering needed)

**Documentation:**
- Updated README.md: Gmsh as production default
- Updated technical-spec.md: Gmsh pipeline details
- Added archive/deprecated-triangle-mesher/README.md

**Testing:**
- Added visualize_sandboxes.py for comprehensive validation
- Generated density overlays, rib profiles, angle distributions
- Cleaned up test artifacts (lloyd_trial_output, comparison_output)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 20:40:10 -05:00
5c63d877f0 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>
2026-02-17 17:05:19 -05:00
906037f974 feat(adaptive-isogrid): add Gmsh Frontal-Delaunay triangulation
- Replaces scipy/Triangle iterative refinement with single-pass Gmsh
- Separate distance fields for holes (I(x)) and edges (E(x))
- Frontal-Delaunay produces boundary-conforming, quasi-structured mesh
- Better triangle quality for manufacturing (more equilateral)
- Drop-in replacement: same signature as generate_triangulation()
2026-02-17 21:48:55 +00:00
78f56a68b0 fix: boundary conformance — use Shapely buffer + vertex-preserving PSLG sampling
Root cause: typed segment offsetting created self-intersecting geometry at
concave corners (notches). Triangle's PSLG boundary didn't match the plotted
inset contour, allowing vertices 7+ mm outside.

Changes:
- _build_inner_plate: always use Shapely buffer(-w_frame) (robust at concavities)
- _sample_ring: use simplified polygon vertices + interpolated points on long edges
  (preserves tight features without vertex clustering)
- Plot uses same inner_plate from triangulation (no mismatch)
- Post-process: snap any residual outside vertices to boundary
- Result: 0 vertices outside inner plate (was 10, up to 7.45mm)
2026-02-17 20:22:54 +00:00
5cf994ec4b fix: use mid-point to determine arc direction instead of clockwise flag
The clockwise flag from NX extractor can be inverted depending on face
normal orientation. The sampled mid-point is always reliable. Now
_arc_angles checks which direction (CW vs CCW) passes through the
mid-point and uses that.
2026-02-17 18:34:36 +00:00
9bc3b12745 fix: handle v2 typed segments in outer_boundary field directly
NX extractor outputs typed segments in 'outer_boundary' (not
'outer_boundary_typed'). Normalize now detects dict segments and
promotes them correctly.
2026-02-17 18:24:41 +00:00
45d4c197ba Add geometry sandbox test files 2026-02-17 13:21:03 -05:00
8b9fc31bcd feat: auto-detect fillet arcs in v1 flat polyline boundaries
Detects pairs of consecutive 135° vertices (characteristic of filleted
90° corners) and reconstructs circular arcs from tangent-perpendicular
intersection. Verified on sandbox 2: 2 arcs detected at R=7.5mm with
correct centers. Chain continuity validated.

When arcs are detected, v1 boundaries get promoted to v2 typed segments
and the polyline is re-densified with proper arc interpolation.
2026-02-17 18:05:14 +00:00