Skip to content

mcdisplay: filled surfaces at --trace=2 for McStas contrib mirrors - #2956

Merged
willend merged 1 commit into
mccode-dev:mainfrom
willend:2026-10-contrib-mirror-surfaces
Oct 31, 2026
Merged

willend merged 1 commit into
mccode-dev:mainfrom
willend:2026-10-contrib-mirror-surfaces

Conversation

@willend

@willend willend commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Follows #2952, #2953 and #2955: McStas contrib mirrors that only drew lines now emit polygon() facets, so mcdisplay --trace=2 shows surfaces. At --trace=1 polygons fall back to closed multilines.

  • Mirror_Elliptic, Mirror_Parabolic: one quad per step along the curve
  • Mirror_Elliptic_Bispectral, Mirror_Curved_Bispectral: 50 quads along the mirror
  • Mirror_conic: same flat outline as before, now filled
  • SupermirrorFlat: 3- and 4-vertex faces as polygons; other faces keep lines
  • FlatEllipse_finite_mirror: both ±w(z) sheets of the conic.h FlatSurf (x² = k1+k2z+k3z², y in [ll, rl]) as quad strips

Display only: no change to TRACE / simulation results.

Tested (macOS arm64, clang): mcrun --trace=2 and --trace=1 -n 0 on Test_FocalisationMirrors, Test_Mirror_conic, Supermirror_thin_substrate, Test_FlatEllipse_finite_mirror plus an ad-hoc instrument for the two Bispectral mirrors; per-component bounding boxes identical to the original line drawings. Not tested: Linux, Windows, GPU, webgl/pyqtgraph.

🤖 Generated with Claude Code

Replace line-only MCDISPLAY with polygon() facets, so --trace=2 shows
surfaces; --trace=1 keeps outlines.

Mirror_Elliptic, Mirror_Parabolic, Mirror_Elliptic_Bispectral,
Mirror_Curved_Bispectral, Mirror_conic, SupermirrorFlat (triangle/quad
faces; other faces keep lines), FlatEllipse_finite_mirror (both +-w(z)
sheets of the conic.h FlatSurf, y in [ll,rl]).

Display only, no change to simulation results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@willend
willend merged commit 637bc15 into mccode-dev:main Oct 31, 2026
22 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