[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Groff] pic: how to fill a diamond shape?
From: |
Ted Harding |
Subject: |
RE: [Groff] pic: how to fill a diamond shape? |
Date: |
Mon, 09 Mar 2009 20:43:11 -0000 (GMT) |
On 09-Mar-09 03:44:33, Louis Guillaume wrote:
> Hi,
> I'm making a flowchart with pic and I want to fill a "decision"
> diamond, which is drawn like this...
>
> define decision {
> DECA: box invis wid $1 ht $2 $3
> line from DECA.w to DECA.n then to DECA.e then to DECA.s then to
> DECA.w
> }
>
> ... is there a better way to draw the diamond? Or perhaps close the
> path made by the four lines so that it can be filled?
>
> Louis
Have a look at the following and see if you can adapt to do
what you want:
.PS
box wid 2 ht 2 at (0,0)
"\v'-0.5n'\D'p 1i -1i 1i 1i -1i 1i -1i -1i'" at (-1,0)
box wid 2 ht 2 at (0,-3)
"\v'-0.5n'\D'P 1i -1i 1i 1i -1i 1i -1i -1i'" at (-1,-3)
.PE
It is based on the fact that, when you tell 'pic' to draw a unit
"box", it outputs
\h'0.750i'\v'0.500i'\D'p0.000i -0.500i -0.750i 0.000i 0.000i 0.500i'
In other words it uses troff's \D'p ... ' "polygon" drawing
command. With \D'p ... ' you get the outline of the polygon.
If you use \D'P ... ' instead, you get a filled polygon (with
the current fill-value).
The "\v'-0.5n'" was put in empirically!
Hoping this helps, and please repot back!
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 09-Mar-09 Time: 20:43:08
------------------------------ XFMail ------------------------------