[cairo] arc_to patch version 0.0.0

Behdad Esfahbod behdad at cs.toronto.edu
Wed Jul 27 15:13:49 PDT 2005


On Wed, 27 Jul 2005, Bill Spitzak wrote:

> Behdad Esfahbod wrote:
>
> >  except for when the arc doesn't fit, that I'm not
> > sure should be reported as an error or the radius should be
> > decreased.  Run the demo and you see what I mean.
>
> Postscript (or at least ghostview) just draws the full-sized arc, with
> the connection lines going "backwards":

That's what my implementation does too, because that's what you
get with no extra consideration.  If both of the points (x0,y0)
(current point), and (x2,y2) are near enough to (x1,y1) such that
both lines go backward, then a better solution is to draw the
other arc on the same circle which is more than pi.  That's quite
consistent with the definition of arc_to, that draws an arc with
two tangent lines ..., but the problem is that if one of the
points is near and the other far, what should be done?  I suggest
we take the distance of the current point to (x1,y1) for that
case.  How does that sound?


> 0 setgray
> 10 setlinewidth
> 100 100 moveto
> 200 100 200 200 50 arcto
> 200 200 lineto
> stroke
>
> 300 100 moveto
> 400 100 400 200 150 arcto
> 400 200 lineto
> stroke
>
> Produces attached image.
>
>

--behdad
http://behdad.org/



More information about the cairo mailing list