Re: [Groff] Drawing filled circle segments

2005-10-28 Thread Clarke Echols
I solved my problem for now by changing my approach to the pie chart and using solid color for the circle, then I filled one small segment by drawing short, straight lines a few points wide before drawing over the entire thing with an outer dark circle and the various radii. It works well for

Re: [Groff] Drawing filled circle segments

2005-10-28 Thread Werner LEMBERG
It works well for what I need right now, but the macro approach makes sense provided groff supports sine, cosine, and tangent functions... Given that groff doesn't have a `float' data type only ad-hoc solutions for the trigonometric functions, suitable to a specific problem, make sense IMHO.

Re: [Groff] Drawing filled circle segments

2005-10-28 Thread Ted Harding
Here is a variant where the sectors are outlined with thin black lines, if you prefer that. \X'ps: def \ /drawwedge { \ newpath \ 0 0 moveto \ 0 0 rad ang1 ang2 arc \ closepath \ } def' \X'ps: def \ /wedge { gsave \ currentpoint translate 1 -1 scale \ /ang2 exch def \ /ang1 exch

Re: [Groff] Drawing filled circle segments

2005-10-28 Thread Werner LEMBERG
Well, here's a skeleton with an example of use. *Very* nice! Basically, as it is, you invoke in-line it with \*[wedge radius(pts) Red Green Blue Angle1 Angle2] Aah, you use the new string syntax with arguments! This means that you need at least groff 1.18. Thanks a lot for your

Re: [Groff] Drawing filled circle segments

2005-10-28 Thread Ted Harding
On 28-Oct-05 Werner LEMBERG wrote: Well, here's a skeleton with an example of use. *Very* nice! Basically, as it is, you invoke in-line it with \*[wedge radius(pts) Red Green Blue Angle1 Angle2] Aah, you use the new string syntax with arguments! This means that you need at least

Re: [Groff] Drawing filled circle segments

2005-10-28 Thread Tadziu Hoffmann
This one works without string arguments: .sp 3c .de YY ps: def /wedge { gsave currentpoint translate 1 -1 scale newpath 0 0 moveto 0 0 5 2 roll 3.6 mul exch 3.6 mul dup 3 1 roll add arc closepath gsave fill grestore 0 setgray stroke grestore } def .. \Y[YY]\c .de wedge

Re: [Groff] Drawing filled circle segments

2005-10-28 Thread Ted Harding
On 28-Oct-05 Tadziu Hoffmann wrote: Lots of fun with pie charts. Just for the heck of it, here's a modified version of Ted's pie-chart mechanism that remembers the angles of the wedges and allows you to give the wedge size as a percentage of the whole pie (plus, it allows you to use groff

RE: [Groff] Drawing filled circle segments

2005-10-25 Thread Ted Harding
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,