Re: [GD-DEVEL] Filling polygons with holes

From: Date: Wed, 08 Oct 2008 18:30:30 +0000
Subject: Re: [GD-DEVEL] Filling polygons with holes
References: 1 2 3 4  Groups: php.gd.devel 
Request: Send a blank email to php-gd-devel+get-482@lists.php.net to get a copy of this message
Brian Peschel wrote:
That looks like what I want. Assuming of course that the hole doesn't have to be the background color. I will have overlapping filled polygons with holes, so the color of the 'hole' isn't necessarily the background color. Is there sample code somewhere for the images? - Brian Pierre Joye wrote:
hi, On Tue, Sep 30, 2008 at 10:09 PM, Brian Peschel <brianp@occinc.com> wrote:
Is there an easy way to do filled polygons with holes? Think a donut where I want to fill the donut, but not the hole. I suppose I could do something where I am create an png image just of the polygon with transparent color for the hole and outside the polygon....
    
Do you mean something like that: http://pierre.libgd.org/polygons/ Cheers, I guess I should have tried it before I posted to the list. Combining into a single polygon allows it to work.
Question though. Is there a way to specify whether the fill should follow the nonzero winding rule or the even-odd rule? It appears GD is using the even-odd rule and I would prefer the nonzero winding rule. http://www.noodlesoft.com/blog/2006/11/30/mmmdonuts/ has some discussion and an image that shows the difference. Thanks! - Brian

« previous php.gd.devel (#482) next »