groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Groff] Drawing filled circle segments


From: Ted Harding
Subject: RE: [Groff] Drawing filled circle segments
Date: Tue, 25 Oct 2005 21:16:09 +0100 (BST)

On 25-Oct-05 Clarke Echols wrote:
> 
> I need to use drawing requests (\D'...') directly (without
> using PIC) to make pie-chart segments that can be filled with
> color.
> 
> I have no problem getting filled boxes and polygons, but I
> have not discovered how to draw two lines with an included
> angle, then connect the two outside ends with an arc whose
> radius is centered at the vertex of the two lines.
> 
> Any suggestions?  I must be missing something very obvious...
> 
> Thanks,
> 
> Clarke

I don't think you are, Clarke! What you want to do does not,
as far as I know, fall withing the repertoire of \D'...'.

A similar question was discussed recently on the list (Sep 13-18)
regarding producing a "shaded" box with round corners. As was
pointed out by Keith Marshall and me, pic's approach to this
involves drawing several shaded entities -- two rectangles and
four circles -- because the method of drawing a simple box with
rounded corners is to draw 4 lines and four arcs with \D'...',
and not "closing" the resulting path. As a result, PostScript
cannot shade it.

The same would apply to your pie segments. And I can't think
of a clean way to make one of these in a similar way (especially
if you want to place them side by side in a pie chart).

The only entities that \D'...' (and therefore also pic) can
shade are polygons (\D'P ...'), ellipses (\D'E ...') and
circles (\D'C ... '), because these are also intrinsically
closed entities in PostScript.

As I said before, pic needs an attribute "closed" for entities
drawn with line and curve segments, so that these can be
filled in PostScript.

I can only think of setting up a little stanza in PostScript
which would be invoked to draw the necessary item, though
making sure that it was placed at the roght point and at the
right angle would need careful watching.

I will try to invent one, but probably others will beat me
to it!

Best wishes,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 25-Oct-05                                       Time: 21:16:03
------------------------------ XFMail ------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]