On 17-Apr-10 19:09:49, Jeronimo Pellegrini wrote: > Hello, > > Ijust started learning to use pic but there's something I didn't > find in the tutorials I've found (and it looks like the section > of the Groff manual on pic is empty). > > I'd like to draw a number of boxes in "cascading" style, like this: > > .PS > A:box wid 0.7i ht 1i > B:box wid 0.7i ht 1i at (A.e.x-0.1i, A.e.y-0.1i) > C:box wid 0.7i ht 1i at (B.e.x-0.1i, B.e.y-0.1i) > .PE > > But this actually draws all of them completely -- I'd like the > topmost to actually hide part of the box below it, and so on, so > the picture would look as paper sheets diagonally aligned on a desk. > > Is there a simple way to do that? Can I, for example, fill the boxes > with white so that'd cover the lines behind it? > > Thanks, > Jeronimo
Yes, you can -- use 'shaded "white"' as in: .PS A:box wid 0.7i ht 1i B:box wid 0.7i ht 1i at (A.e.x-0.1i, A.e.y-0.1i) shaded "white" C:box wid 0.7i ht 1i at (B.e.x-0.1i, B.e.y-0.1i) shaded "white" .PE Only: this will make C appear on top of B which will appear on top of A (they are drawn in the order written, so the shading of B will overlay part of A, and the shading of C will overlay part of B. So, to answer your description (if I have understood correctly, i.e. A is the top one and should overlay B which should overlay C) you would need to change the signs of the relative positions, and the reference point to "w" instead of "e": .PS A:box wid 0.7i ht 1i B:box wid 0.7i ht 1i at (A.w.x+0.1i, A.w.y+0.1i) shaded "white" C:box wid 0.7i ht 1i at (B.w.x+0.1i, B.w.y+0.1i) shaded "white" .PE Note that you should not use 'coloured "white"', since this will make the entire box (including outline) white, and it will disappear: .PS A:box wid 0.7i ht 1i B:box wid 0.7i ht 1i at (A.w.x+0.1i, A.w.y+0.1i) coloured "white" C:box wid 0.7i ht 1i at (B.w.x+0.1i, B.w.y+0.1i) shaded "white" .PE Since "white" is at one end of the range of greys given by 'fill x', where x is a number between 0 (white) and 1 (black), you can also use this (and its simpler for your case): .PS A:box wid 0.7i ht 1i B:box wid 0.7i ht 1i at (A.w.x+0.1i, A.w.y+0.1i) fill 0 C:box wid 0.7i ht 1i at (B.w.x+0.1i, B.w.y+0.1i) fill 0 .PE The use of 'shaded', however, gives you the option of useing other colours, not just greys. Hoping this helps, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <[email protected]> Fax-to-email: +44 (0)870 094 0861 Date: 17-Apr-10 Time: 22:04:15 ------------------------------ XFMail ------------------------------
