diff --git a/mcstas-comps/contrib/Monochromator_2foc.comp b/mcstas-comps/contrib/Monochromator_2foc.comp index 5fdcb60f7..9013ecf5c 100644 --- a/mcstas-comps/contrib/Monochromator_2foc.comp +++ b/mcstas-comps/contrib/Monochromator_2foc.comp @@ -321,8 +321,7 @@ MCDISPLAY yt = 0; yt1 = 0; } - multiline (5, xt + yt, (double)ymin, (double)zmin, xt + yt1, (double)ymax, (double)zmin, xt1 + yt1, (double)ymax, (double)zmax, xt1 + yt, (double)ymin, - (double)zmax, xt + yt, (double)ymin, (double)zmin); + polygon (4, xt + yt, (double)ymin, (double)zmin, xt + yt1, (double)ymax, (double)zmin, xt1 + yt1, (double)ymax, (double)zmax, xt1 + yt, (double)ymin, (double)zmax); } } %} diff --git a/mcstas-comps/contrib/Monochromator_bent.comp b/mcstas-comps/contrib/Monochromator_bent.comp index 9a1e12a30..72bf0bcbe 100755 --- a/mcstas-comps/contrib/Monochromator_bent.comp +++ b/mcstas-comps/contrib/Monochromator_bent.comp @@ -1640,19 +1640,16 @@ MCDISPLAY // These 8 coordinates define 8 points. Coordinate transform these // to the current crystal rotate_all_points (&x_inner[0], &x_outer[0], &x_inner[1], &x_outer[1], &y_top, &y_bottom, &z_inner[0], &z_outer[0], &z_inner[1], &z_outer[1], points, mono); - // Draw a box in th xy plane - multiline (5, points[0][0], points[0][1], points[0][2], points[2][0], points[2][1], points[2][2], points[3][0], points[3][1], points[3][2], points[1][0], - points[1][1], points[1][2], points[0][0], points[0][1], points[0][2]); - - // Draw curving parts of crystal in the zx plane - line (points[0][0], points[0][1], points[0][2], points[4][0], points[4][1], points[4][2]); - line (points[1][0], points[1][1], points[1][2], points[5][0], points[5][1], points[5][2]); - line (points[2][0], points[2][1], points[2][2], points[6][0], points[6][1], points[6][2]); - line (points[3][0], points[3][1], points[3][2], points[7][0], points[7][1], points[7][2]); + // Start cap, then inner, outer, top and bottom faces of this segment + if (i == 0) + polygon (4, points[0][0], points[0][1], points[0][2], points[2][0], points[2][1], points[2][2], points[3][0], points[3][1], points[3][2], points[1][0], points[1][1], points[1][2]); + polygon (4, points[0][0], points[0][1], points[0][2], points[1][0], points[1][1], points[1][2], points[5][0], points[5][1], points[5][2], points[4][0], points[4][1], points[4][2]); + polygon (4, points[2][0], points[2][1], points[2][2], points[3][0], points[3][1], points[3][2], points[7][0], points[7][1], points[7][2], points[6][0], points[6][1], points[6][2]); + polygon (4, points[0][0], points[0][1], points[0][2], points[2][0], points[2][1], points[2][2], points[6][0], points[6][1], points[6][2], points[4][0], points[4][1], points[4][2]); + polygon (4, points[1][0], points[1][1], points[1][2], points[3][0], points[3][1], points[3][2], points[7][0], points[7][1], points[7][2], points[5][0], points[5][1], points[5][2]); } - // Draw a final box in the xy plane - multiline (5, points[4][0], points[4][1], points[4][2], points[6][0], points[6][1], points[6][2], points[7][0], points[7][1], points[7][2], points[5][0], - points[5][1], points[5][2], points[4][0], points[4][1], points[4][2]); + // End cap + polygon (4, points[4][0], points[4][1], points[4][2], points[6][0], points[6][1], points[6][2], points[7][0], points[7][1], points[7][2], points[5][0], points[5][1], points[5][2]); } // line(0,0,0, diff --git a/mcstas-comps/contrib/Monochromator_bent_complex.comp b/mcstas-comps/contrib/Monochromator_bent_complex.comp index 4cee0f1fa..1d9af0ae6 100755 --- a/mcstas-comps/contrib/Monochromator_bent_complex.comp +++ b/mcstas-comps/contrib/Monochromator_bent_complex.comp @@ -341,19 +341,16 @@ MCDISPLAY // These 8 coordinates define 8 points. Coordinate transform these // to the current crystal rotate_all_points (&x_inner[0], &x_outer[0], &x_inner[1], &x_outer[1], &y_top, &y_bottom, &z_inner[0], &z_outer[0], &z_inner[1], &z_outer[1], points, mono); - // Draw a box in th xy plane - multiline (5, points[0][0], points[0][1], points[0][2], points[2][0], points[2][1], points[2][2], points[3][0], points[3][1], points[3][2], points[1][0], - points[1][1], points[1][2], points[0][0], points[0][1], points[0][2]); - - // Draw curving parts of crystal in the zx plane - line (points[0][0], points[0][1], points[0][2], points[4][0], points[4][1], points[4][2]); - line (points[1][0], points[1][1], points[1][2], points[5][0], points[5][1], points[5][2]); - line (points[2][0], points[2][1], points[2][2], points[6][0], points[6][1], points[6][2]); - line (points[3][0], points[3][1], points[3][2], points[7][0], points[7][1], points[7][2]); + // Start cap, then inner, outer, top and bottom faces of this segment + if (i == 0) + polygon (4, points[0][0], points[0][1], points[0][2], points[2][0], points[2][1], points[2][2], points[3][0], points[3][1], points[3][2], points[1][0], points[1][1], points[1][2]); + polygon (4, points[0][0], points[0][1], points[0][2], points[1][0], points[1][1], points[1][2], points[5][0], points[5][1], points[5][2], points[4][0], points[4][1], points[4][2]); + polygon (4, points[2][0], points[2][1], points[2][2], points[3][0], points[3][1], points[3][2], points[7][0], points[7][1], points[7][2], points[6][0], points[6][1], points[6][2]); + polygon (4, points[0][0], points[0][1], points[0][2], points[2][0], points[2][1], points[2][2], points[6][0], points[6][1], points[6][2], points[4][0], points[4][1], points[4][2]); + polygon (4, points[1][0], points[1][1], points[1][2], points[3][0], points[3][1], points[3][2], points[7][0], points[7][1], points[7][2], points[5][0], points[5][1], points[5][2]); } - // Draw a final box in the xy plane - multiline (5, points[4][0], points[4][1], points[4][2], points[6][0], points[6][1], points[6][2], points[7][0], points[7][1], points[7][2], points[5][0], - points[5][1], points[5][2], points[4][0], points[4][1], points[4][2]); + // End cap + polygon (4, points[4][0], points[4][1], points[4][2], points[6][0], points[6][1], points[6][2], points[7][0], points[7][1], points[7][2], points[5][0], points[5][1], points[5][2]); } // line(0,0,0, diff --git a/mcstas-comps/optics/Monochromator_curved.comp b/mcstas-comps/optics/Monochromator_curved.comp index ca915a02a..caa4d51ea 100644 --- a/mcstas-comps/optics/Monochromator_curved.comp +++ b/mcstas-comps/optics/Monochromator_curved.comp @@ -531,8 +531,7 @@ MCDISPLAY yt = -(ymax * ymax - ymin * ymin) / RV / 2; else yt = 0; - multiline (5, xt + yt, (double)ymin, (double)zmin, xt - yt, (double)ymax, (double)zmin, -xt - yt, (double)ymax, (double)zmax, -xt + yt, (double)ymin, - (double)zmax, xt + yt, (double)ymin, (double)zmin); + polygon (4, xt + yt, (double)ymin, (double)zmin, xt - yt, (double)ymax, (double)zmin, -xt - yt, (double)ymax, (double)zmax, -xt + yt, (double)ymin, (double)zmax); } } %} diff --git a/mcstas-comps/optics/Monochromator_flat.comp b/mcstas-comps/optics/Monochromator_flat.comp index 9bcf77bb5..636d817c3 100644 --- a/mcstas-comps/optics/Monochromator_flat.comp +++ b/mcstas-comps/optics/Monochromator_flat.comp @@ -251,8 +251,7 @@ TRACE MCDISPLAY %{ - multiline (5, 0.0, (double)ymin, (double)zmin, 0.0, (double)ymax, (double)zmin, 0.0, (double)ymax, (double)zmax, 0.0, (double)ymin, (double)zmax, 0.0, - (double)ymin, (double)zmin); + polygon (4, 0.0, (double)ymin, (double)zmin, 0.0, (double)ymax, (double)zmin, 0.0, (double)ymax, (double)zmax, 0.0, (double)ymin, (double)zmax); %} END diff --git a/mcstas-comps/optics/Monochromator_pol.comp b/mcstas-comps/optics/Monochromator_pol.comp index e9bba3789..eb28cd251 100644 --- a/mcstas-comps/optics/Monochromator_pol.comp +++ b/mcstas-comps/optics/Monochromator_pol.comp @@ -200,7 +200,7 @@ TRACE MCDISPLAY %{ - rectangle ("yz", 0, 0, 0, zwidth, yheight); + polygon (4, 0.0, -yheight / 2, -zwidth / 2, 0.0, -yheight / 2, zwidth / 2, 0.0, yheight / 2, zwidth / 2, 0.0, yheight / 2, -zwidth / 2); %} END