Hi Carl, You are right, I misunderstood the approach. As far as I understand now, I just have to adjust the width of the line-rectangle accoring to the pen-strcuture which is approproate for the choosen line-width, is this right?
I'll read through the paper tomorrow. Thanks, Clemens > You are already stroking your lines with a pen---you just happen to be > using a circular pen, (that is, the pen has the same cross-sectional > diameter in all directions). The key part of Hobby's solution is that > the cross-sectional "diameter" is different depending on the angle of > the line being drawn. And it's this difference that gives the result > you want, (the appearance of uniform line-width in the final result). Thanks for the explanation. 2008/6/2 Carl Worth <[EMAIL PROTECTED]>: > On Mon, 2 Jun 2008 22:36:46 +0200, "Clemens Eisserer" wrote: >> 2.) Currently I've implemented lines the same way as Cairo does >> (generating three trapezoids), which gives the same result as with >> XDrawLine when line_width is set to 1.0, it looks to some degree ugly >> :-/ >> I created some screenshots: http://picasaweb.google.com/linuxhippy/Cairo >> >> The problem is that I don't see any way to do nice lines with XRender, >> without a lot of overhead and many trapezoids. >> Carl Worth was very helful, pointing me to a solution: >> http://cm.bell-labs.com/who/hobby/87_2-04.pdf >> However that means stroking with a pen -> complex stuff probably >> generating many more than "just" 3 Trapezoids. > > No. I don't think you understood the solution. It should not generate > any more trapezoids than your current approach. > > You are already stroking your lines with a pen---you just happen to be > using a circular pen, (that is, the pen has the same cross-sectional > diameter in all directions). The key part of Hobby's solution is that > the cross-sectional "diameter" is different depending on the angle of > the line being drawn. And it's this difference that gives the result > you want, (the appearance of uniform line-width in the final result). > > So you should be able to easily write a function, (with an explicit or > implicit Hobby pen polygon), that simply computes the correct > cross-sectional width for any particular line, (based on its angle), > and then generate your trapezoids based on that. > > So what you will then be handing to Xrender won't be any more complex, > but the result should be much more appealing. > > I'll be quite interested to see your results if you pursue this > approach. > > -Carl >