Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions mcstas-comps/contrib/Monochromator_2foc.comp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
%}
Expand Down
21 changes: 9 additions & 12 deletions mcstas-comps/contrib/Monochromator_bent.comp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
21 changes: 9 additions & 12 deletions mcstas-comps/contrib/Monochromator_bent_complex.comp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions mcstas-comps/optics/Monochromator_curved.comp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
%}
Expand Down
3 changes: 1 addition & 2 deletions mcstas-comps/optics/Monochromator_flat.comp
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion mcstas-comps/optics/Monochromator_pol.comp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading