Skip to content

Commit acb9885

Browse files
committed
Migrate NCrystal_sample to mcdis_cylinder and mcdis_sphere visualisation
1 parent 165a5bd commit acb9885

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

mcstas-comps/samples/NCrystal_sample.comp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -368,24 +368,18 @@ FINALLY
368368

369369
MCDISPLAY
370370
%{
371-
//NB: Future McStas (2.5?) is slated to introduce mcdis_cylinder and
372-
//mcdis_sphere functions, which we at that point should likely use.
373371
switch (geoparams.shape) {
374372
case NC_CYLINDER:
375-
mcdis_circle("xz", 0, geoparams.dy/2.0, 0, geoparams.rradius);
376-
mcdis_circle("xz", 0, -geoparams.dy/2.0, 0, geoparams.rradius);
377-
mcdis_line(-geoparams.rradius, -geoparams.dy/2.0, 0, -geoparams.rradius, +geoparams.dy/2.0, 0);
378-
mcdis_line(+geoparams.rradius, -geoparams.dy/2.0, 0, +geoparams.rradius, +geoparams.dy/2.0, 0);
379-
mcdis_line(0, -geoparams.dy/2.0, -geoparams.rradius, 0, +geoparams.dy/2.0, -geoparams.rradius);
380-
mcdis_line(0, -geoparams.dy/2.0, +geoparams.rradius, 0, +geoparams.dy/2.0, +geoparams.rradius);
373+
mcdis_cylinder( 0., 0., 0.,
374+
geoparams.rradius,
375+
geoparams.dy,
376+
0 , 0.0 , 1.0 , 0.0);
381377
break;
382378
case NC_BOX:
383379
mcdis_box(0., 0., 0., geoparams.dx, geoparams.dy, geoparams.dz,0, 0, 1, 0);
384380
break;
385381
case NC_SPHERE:
386-
mcdis_circle("xy", 0., 0., 0., geoparams.rradius);
387-
mcdis_circle("xz", 0., 0., 0., geoparams.rradius);
388-
mcdis_circle("yz", 0., 0., 0., geoparams.rradius);
382+
mcdis_sphere(0.0,0.0,0.0,geoparams.rradius);
389383
break;
390384
};
391385
%}

0 commit comments

Comments
 (0)