[cairo] New user question. How do I fill inside of a curve?

Jody Winston josephwinston at mac.com
Thu Jan 3 09:18:09 PST 2008


First of all, thanks for the help with my first attempt at Cairo.  I 
also am apologizing for munging the email headers by hand but I do not 
have the original email chain with me.

I think that I did everything you suggested and have attached a 
standalone example with your changes, but I still am having problems.

What I am attempting to do is color the area of a curve that either is 
above or below the line y = 0 as quickly as possible since I have a 
large number of these curves to process.

The problem might be best expressed by looking at a contrived example. 
Given a curve defined by [(-100, -100), (100, 100), (200, -200), (300, 
300)].  I need to color the triangles [(0, 0), (100, 100), (400/3, 0)] 
and [(240, 0), (300, 300), (300, 0)] with one color since they are the 
areas of the curve that are between y = 0 and the curve itself. 
Likewise, I need to color the triangles [(-100, -100), (-100, 0), (0, 0, 
0)] and [(400/3, 0), (240, 0), (200, -200)] since they are between the 
curve and the line y = 0.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.py
Type: text/x-python
Size: 1879 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080103/575c2b26/attachment.py 


More information about the cairo mailing list