[visionegg] Re: drawing

  • From: John Christie <jc@xxxxxxxxxxxxxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Sat, 30 Jun 2007 12:49:00 -0400

I kind of feel bad that I didn't follow this up. I asked for lots of help on drawing and didn't publish the solution.

I went with aggdraw. It makes great drawings and is about as easy to use (and simple) as the drawing in pygame.

Some things I discovered though, in case you want to use it, which are not documented in aggdraw (perhaps if you read all of agg).

Anti-aliasing doesn't yet turn off.

thickness of lines spreads from the center of the line rather than anchoring from on corner. This is true for things like rectangles too. So, if you want to draw a rectangle with thick lines you need to inset the rectangle first by half of the thickness of the lines.

Polygons follow the above such that if you want a polygon to not expand beyond a region when the line thickness increases one must inset from the top left by half of the line thickness. However, you must inset from the bottom and right by the entire thickness for any corners that extend toward that edge because, while line thickness spreads from the centre of the line, the finishing of corners is anchored upper left.

Arcs are in degrees and drawn clockwise.

aggdraw is about as fast as pygame for the few things I tested.

Oh, and don't under any circumstances use pygame for drawing anything that you care what it looks like in the end.

That was all the notes I had.

The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: