[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Bug in cvs pcb concerning polygons



On Thu, Jul 26, 2007 at 03:31:04AM +0100, Peter Clifton wrote:
> On Wed, 2007-07-25 at 19:27 -0700, Ben Jackson wrote:
> > 
> > Ok, I have a fix for this.
> 
> Please send the patch..
> 
> I'll apply and test locally. This bug has kept biting me in the past.
> 
> What was the issue?

Clearing pads from polys was mistakenly put inside the all-layers-in-
layer-group loop.  So for surface layers, every pad on that surface was
subtracted from the polygon once for every layer in the same layer group.
If you only have one copper layer on the surface, you shouldn't see this
bug.  Most of the time the double-clear is harmless, but in this case
the second subtraction of one of the pads broke one of the contours.
You can see it if you create a broken poly and then turn on thin-draw.
You will see crazy "edge" lines going randomly across the board.  Figuring
out why required making an animation of the entire polygon clearing
process so I could see where it went wrong.

> And... out of curiosity, do you think the bug you found could be
> responsible for all (most?) of the polygon related crashes observed?

Quite possibly.  I looked at the CVS and the bug has been there since
the polygon code got merged.

I'm sure this also represents an underlying bug in the poly_Boolean code,
since in theory what was happening should have worked.  However, it's
very easy to just not provoke the bug, and knowing how it happens will
also make it easier to debug the polygon1.c code if there are still
crashing bugs.

-- 
Ben Jackson AD7GD
<ben@xxxxxxx>
http://www.ben.com/
Index: polygon.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/polygon.c,v
retrieving revision 1.52
diff -u -r1.52 polygon.c
--- polygon.c	28 Apr 2007 14:32:54 -0000	1.52
+++ polygon.c	26 Jul 2007 04:24:48 -0000
@@ -692,12 +692,10 @@
                     &info);
         r +=
           r_search (layer->arc_tree, &region, NULL, arc_sub_callback, &info);
-        if (info.solder
-            || group == Group (Data, Data->LayerN + COMPONENT_LAYER))
-          r +=
-            r_search (Data->pad_tree, &region, NULL, pad_sub_callback, &info);
       }
       END_LOOP;
+      if (info.solder || group == Group (Data, Data->LayerN + COMPONENT_LAYER))
+	r += r_search (Data->pad_tree, &region, NULL, pad_sub_callback, &info);
     }
   return r;
 }

_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user