Skip to content

mcdisplay: filled surfaces at --trace=2 for McXtrace mirrors and capillary - #2955

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

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

Conversation

@willend

@willend willend commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

McXtrace counterpart of #2952 / #2953: components that only drew lines now emit polygon() facets (cylinder() for Capillary), so mcdisplay --trace=2 shows surfaces. At --trace=1 polygons fall back to closed multilines.

optics: Capillary, Mirror (flat, non-OFF case), Mirror_curved, Mirror_elliptic, Mirror_parabolic, Mirror_toroid, Multilayer_elliptic
contrib: Mirror_toroid_pothole

Same surface formulas as the old line drawings. Integer loops replace float accumulation, which fixes two old display glitches: Multilayer_elliptic drew one step past length, and the toroid mirrors dropped the last θ step (asymmetric in x).

Display only: no change to TRACE / simulation results.

Tested (macOS arm64, clang): mxrun --trace=2 and --trace=1 -n 0 on Test_Mirrors, Test_capillary, MAXIV_Bloch; per-component bounding boxes compared against the original components (match apart from the two fixes above); matplotlib frontend rendered. Not tested: Linux, Windows, GPU, webgl/pyqtgraph.

🤖 Generated with Claude Code

…llary

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

optics: Capillary, Mirror (flat case), Mirror_curved, Mirror_elliptic,
Mirror_parabolic, Mirror_toroid, Multilayer_elliptic.
contrib: Mirror_toroid_pothole.

Integer loops replace float accumulation: Multilayer_elliptic no longer
draws one step past length, toroid mirrors no longer drop the last step.

Display only, no change to simulation results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@willend
willend merged commit 56d4fb6 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