Bug in intersect algorithm?

Recommend this page to a friend!

      Polygon  >  All threads  >  Bug in intersect algorithm?  >  (Un) Subscribe thread alerts  
Subject:Bug in intersect algorithm?
Summary:"Bug" in the intersect algorithm when making a donut shape?
Author:Jeff Hoppe
Date:2011-02-24 22:49:52
Update:2011-02-26 13:25:33

  1. Bug in intersect algorithm?   Reply   Report abuse  
Jeff Hoppe - 2011-02-24 22:49:52
I believe I have found either a bug or a limitation of the polygon library when two intersecting polygons are combined using the OR functionality ($poly->intersect($poly1, "A|B").

If you can imagine two polygons: one is a blocky, "C" shaped polygon... the other is a rectangle just to the right of this polygon, slightly overlapping the ends of the "C" shape polygon such that a hole is created from the resulting intersected "OR" polygon shape.

The shape that is returned from the function is the hole itself, rather than a larger polygon with a hole in the middle.

Anyone else seen this?

  2. Re: Bug in intersect algorithm?   Reply   Report abuse  
Jeff Hoppe - 2011-02-26 13:25:33 - In reply to message 1 from Jeff Hoppe
Problem resolved (it wasn't a bug at all, rather a PEBKAC) -- that pesky "linked list" got the best of me, and I was failing to check the rest of the polygons in the list.

Works perfect now.


For more information send a message to info at phpclasses dot org.