Skip to content

feat: 3D horn rendering and Akabak-style directivity plots#69

Merged
timini merged 1 commit intomainfrom
feat/professional-plot-styling
Mar 1, 2026
Merged

feat: 3D horn rendering and Akabak-style directivity plots#69
timini merged 1 commit intomainfrom
feat/professional-plot-styling

Conversation

@timini
Copy link
Owner

@timini timini commented Mar 1, 2026

Summary

  • 3D horn geometry rendering — matplotlib surface-of-revolution visualization with 2D cross-section panel, embedded in HTML reports via base64, integrated into both single and auto Nextflow workflows (runs in parallel with simulation)
  • Akabak-style directivity plots — opt-in BEM far-field analysis producing four diagnostic plots: polar directivity, frequency-angle contour sonogram, beamwidth vs frequency, and directivity index. Gated behind --directivity flag (single mode only, requires BEM)
  • Solver enhancementscoupled_solve() optionally returns trace data for far-field computation; solver.py gains --compute-directivity and --directivity-file CLI flags
  • 15 new tests covering rendering, radius profiles, directivity loading, computation, and plotting (all 32 tests pass)

New files

  • packages/horn-analysis/src/horn_analysis/horn_render.py — 3D rendering module
  • packages/horn-analysis/src/horn_analysis/directivity_plot.py — directivity visualization

Test plan

  • All 32 tests pass (pytest packages/horn-analysis/tests/ -v)
  • horn-render --throat-radius 0.05 --mouth-radius 0.2 --length 0.5 --profile exponential test.png — visual inspection
  • Synthetic directivity CSV through horn-directivity-plot — inspect all 4 plot types
  • nextflow run main.nf --mode single --directivity — verify directivity gating
  • nextflow run main.nf --mode single (without flag) — verify no directivity processes

🤖 Generated with Claude Code

Add two new visualization features:

1. 3D horn geometry rendering (horn_render.py) — matplotlib surface-of-
   revolution with 2D cross-section panel, embedded in HTML reports, and
   integrated into both single and auto Nextflow workflows.

2. Directivity/radiation pattern analysis (directivity_plot.py) — opt-in
   BEM far-field computation producing four Akabak-style plots: polar
   directivity, frequency-angle contour sonogram, beamwidth vs frequency,
   and directivity index. Gated behind --directivity flag (single mode only).

Supporting changes:
- coupled_solve() now optionally returns trace data for far-field computation
- solver.py gains --compute-directivity and --directivity-file CLI flags
- HTML report includes horn geometry section when dimensions are provided
- 15 new tests (all 32 pass)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@timini timini merged commit 7ff7075 into main Mar 1, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

1 participant