McStasMcXtrace / McCode

The home of the McStas (neutrons) and McXtrace (x-rays) Monte-Carlo ray-tracing instrument simulation codes.
https://github.com/McStasMcXtrace/McCode/wiki
GNU General Public License v3.0
77 stars 54 forks source link

mcdisplay: add pure Matlab 3d geometry plotter (without Perl layer) #1186

Closed farhi closed 1 year ago

farhi commented 2 years ago

It would be nice to create a pure Matlab '3D display' viewer, without need for the Perl layer. It could even be better if it runs with Octave compatibility.

As a starting point, we may use the iFit/mccode.plot method https://gitlab.com/soleil-data-treatment/soleil-software-projects/ifit/-/blob/master/Objects/iFunc_subclasses/@iFunc_McCode/plot.m.

It only displays a static geometry, not ray trajectories, but it has the advantage to be much faster than the current mcdisplay.pl/matlab plotter. A further evolution could be to plot a limited set of rays, as static lines.

willend commented 2 years ago

Hi @farhi,

I have another proposal which I can make happen on a very short notice:

On the neutron-side I these days distribute a stripped-down version of mcdisplay.pl which has no graphics-dependencies and only produces the "Mantid" XML output. (mcdisplay-mantid.pl) It is part of mcstas-tools-perl-cmdline.

I propose we do a similar snippet which is only made for calling Matlab.

farhi commented 2 years ago

Hi @willend ;-)

Any solution which is faster and more robust than today is good.

It's even better if:

willend commented 2 years ago

Hi again @farhi ,

It turns out I already did the work - more or less. The above-mentioned mcdisplay-mantid.pl "of course" already allows using the Matlab backend.

I therefore propose that I 1) Change name to mcdisplay-matlab (for both McStas and McXtrace) 2) Implement a symlink / copy called -mantid (only McStas)

farhi commented 1 year ago

Done with commit https://github.com/McStasMcXtrace/McCode/commit/1de13d945e5a8d637b7e6c7dc048b36569365f58