Skip to content

mcdisplay-webgl(-classic): --campath file for the tour - #3154

Merged
willend merged 2 commits into
mainfrom
mcdisplay-campath
Nov 21, 2026
Merged

willend merged 2 commits into
mainfrom
mcdisplay-campath

Conversation

@willend

@willend willend commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Free-form text area

Please describe what your PR is adding in terms of features or bugfixes:

Adds --campath FILE to mcdisplay-webgl and mcdisplay-webgl-classic (McStas and McXtrace), so the tour can follow a given camera path instead of the component centres:

  • File rows are x y z (m), or x y z dx dy dz with the viewing direction. Spaces, tabs or commas; # starts a comment. Without a direction the camera looks towards the next point.
  • A bad file (wrong column count, non-number, < 2 points, zero direction, missing) gives a clear message and exit(-1) before the simulation runs.
  • When given, a "campath file" toggle (ticked by default) appears in the tour menu; unticking goes back to the components. The offset/view settings still apply, and the tour (and recording) stops at the last point.
  • Adds SOLEIL_ring_campath.txt next to the McXtrace SOLEIL example: one loop 1 m above the storage ring, against the electron direction so the beamline labels read correctly.
    Example, from a copy of the SOLEIL example folder:
    mxdisplay-webgl SOLEIL.instr --default --campath SOLEIL_ring_campath.txt
    
    then open the Tour menu and tick Tour (use mxdisplay-webgl-classic for the classic viewer).
  • The webgl dist/ bundle is rebuilt.

Declaration of use of AI-tools

  • Please add a checkmark here if you used AI-tools during the work for this contribution
  • Further, please describe how / where and for what the tools were used: Claude Code (Claude Opus 5.5) wrote the code and the SOLEIL campath file, and ran the tests below, under my direction and review.
  • AI-assisted commits must carry a Co-Authored-By line naming the tool, see CONTRIBUTING.md

Development OS / boundary conditions

Please describe what OS you developed and tested your additions on, and if any special dependencies are required:

macOS (arm64), mccode-dev conda env. No new dependencies. Tested:

  • File parsing: 3- and 6-column files accepted; bad files rejected with exit code 255 through the real CLI.
  • McStas PSI_DMC with both viewers: 3- and 6-column paths, toggle, stop at the end, untick back to components, no toggle without --campath.
  • McXtrace SOLEIL (classic) with the included ring path, and the ESS facility model (webgl) with a 6-column path.

Not tested on Linux or Windows.


PR Checklist for contributing to McStas/McXtrace

  • My contribution contains something else

    • Explanation is added in free form text above or below the checklist

🤖 Generated with Claude Code

willend and others added 2 commits November 21, 2026 09:26
One loop 1 m above the storage ring, against the electron direction
so the beamline labels read correctly. Use with --campath.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows of x y z, optionally with the viewing direction dx dy dz. When given,
a ticked "campath file" toggle tours its points instead of the components,
with the offset/view settings applied, and stops at the last point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@willend

willend commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

@willend

willend commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Default display of ILL_H5 with a y=1 m position above beam / component path
https://github.com/user-attachments/assets/3df8ac52-4f70-4d35-98dd-846614aa0dc1

@willend
willend merged commit a9103d0 into main Nov 21, 2026
28 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