<div dir="ltr">Thank you all for your efforts, I hope I will able to try it as soon as possible, even if unfortunally on my system I can't afford to use cairo from git.<div>To answer to Tobias, I could draw lines and fill the arc, but that's not what I'd need, since I have to be able to use arcs with line width smaller than the radius, so I should create two arcs and then fill, but that would require me 3 further commands from a python script that has to be as light and fast as possible while drawing (I need 50-60fps refresh rate and try to keep cpu usage low).</div><div><br></div><div>Thank you again,</div><div>Maurizio</div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-23 0:10 GMT+02:00 Bryce Harrington <span dir="ltr"><<a href="mailto:bryce@osg.samsung.com" target="_blank">bryce@osg.samsung.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Chris posted a patch to the bug tracker for this issue:<br>
<br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=84115" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=84115</a><br>
<br>
Bryce<br>
<div><div class="h5"><br>
On Sun, Sep 21, 2014 at 01:34:23PM +0200, Tobias Hoffmann wrote:<br>
> Hi,<br>
><br>
> I tried a few things, and expected the correct result to be this:<br>
> cr.arc(200, 200, 200, 0*(math.pi/180), -60*(math.pi/180))<br>
> cr.line_to(200,200)<br>
> cr.close_path()<br>
> cr.fill()<br>
><br>
> but actually PostScript (ghostscript's interpretation of it) will<br>
> not draw a horizontal line at the beginning, either:<br>
> $ gs<br>
> GS> 200 setlinewidth<br>
> GS> 200 500 100 0 60 arcn stroke<br>
><br>
> (Note: I've used arcn instead of arc and 60 instead of -60 because<br>
> the postscript coordinate system has its Y-axis going upwards,<br>
> unlike pygtk.)<br>
><br>
> Also, when using LINE_CAP_SQUARE (and a smaller line-width), I can<br>
> see that cairo and ghostscript disagrees on the tangent-direction at<br>
> the endpoints of the arc...<br>
><br>
> What cairo seems to do, is use different tangent directions for the<br>
> inner and the outer part of the stroked arc, but (AFAICS) *only at<br>
> the beginning* of the arc -- the end of it is always unaffected!<br>
> That seems strange to me.<br>
> But I'm not sure, which tangent is actually the 'correct' one.<br>
><br>
> If you want a perfect horizontal line, you should not stroke the<br>
> arc, but fill it (see my first code snippet).<br>
><br>
> Maybe someone with better knowledge of how cairo actually draws<br>
> (tesselates?) these arcs wants to explain the current behavior?<br>
><br>
> Tobias<br>
><br>
><br>
><br>
> On 20/09/14 02:04, Maurizio Berti wrote:<br>
> >Hello,<br>
> >I'm writing a cairo python script, which loads graphics and<br>
> >animations from a custom file to create "fancy" (and unuseful)<br>
> >graphics like those seen in videogames and scifi movies.<br>
> >I have a problem with arcs, though: I need to be able to draw them<br>
> >interactively, with user given coords, start/end and line width.<br>
> >When I try to draw arcs with a certain line width I have a strange<br>
> >behaviour: the beginning of the line is not straight as it should<br>
> >be, you can see an example of it here:<br>
> ><a href="http://jidesk.net/sypy/strangearc2.jpg" target="_blank">http://jidesk.net/sypy/strangearc2.jpg</a><br>
> ><br>
> >Here is the code I used for this test:<br>
> ><a href="https://bpaste.net/show/e1f3b8d1f842" target="_blank">https://bpaste.net/show/e1f3b8d1f842</a><br>
> ><br>
> >I'm using cairo 1.12.16 from the official Gentoo portage (the<br>
> >problem still remains with the latest -r3 version in the portage),<br>
> >with pycairo 1.10.0-r4, also latest stable from the portage.<br>
> ><br>
</div></div>> >CC'ing to <a href="mailto:bryce@osg.samsung.com">bryce@osg.samsung.com</a> <mailto:<a href="mailto:bryce@osg.samsung.com">bryce@osg.samsung.com</a>> who<br>
<div class="HOEnZb"><div class="h5">> >confirmed the issue on #cairo using cairo<br>
> >1.13.0~20140204-0ubuntu1, but was not present using cairo<br>
> >1.12.16-0ubuntu1.1~bryce~precise6, with little different results:<br>
> ><a href="http://jidesk.net/sypy/strangearc-bryce.png" target="_blank">http://jidesk.net/sypy/strangearc-bryce.png</a><br>
> ><br>
> >To draw single and simple "filled" arcs I could use lines and<br>
> >curves, but that would affect the performances of my script (and<br>
> >would require a lot of complex calculations), so I'm here to ask<br>
> >if someone can confirm that this is a bug indeed.<br>
> ><br>
> >Thanks,<br>
> >Maurizio<br>
> ><br>
> >--<br>
> >Č difficile avere una convinzione precisa quando si parla delle<br>
> >ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br>
> ><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a><br>
> ><br>
> ><br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net">http://www.jidesk.net</a>
</div>