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

gEDA-user: GTK PCB bug in thermal drawings



Take GTK PCB 20060321, take the attached twister2.pcb, turn on all
layers, select GND-sldr, select the thermal tool. Adjust the view so
that pin 1 of CONN51 (lower left corner) is displayed on the screen in
detail.

Click the pin. The blue thermal will disapper and small "ears" will
remain. Then zoom in, zoom out, move the viewport or press 'r' (redraw).
The ears will disappear.

Now click the pin again. The thermal will appear, but with the "ears"
missing. Redrawing the screen the same way as in previous try you get
them reappear.

This seems to be because the bounding box of the thermal is calculated
too small.  Here is a patch against 20060321 that fixes it:

clock@kestrel:~$ diff -pur pcb-20060321/src/misc.c
pcb-20060321_patched/src/misc.c
--- pcb-20060321/src/misc.c     2005-08-04 05:23:56.000000000 +0200
+++ pcb-20060321_patched/src/misc.c     2006-04-02 14:20:49.000000000
+0200
@@ -155,7 +155,7 @@ SetPinBoundingBox (PinTypePtr Pin)
   /* the bounding box covers the extent of influence
    * so it must include the clearance values too
    */
-  width = (Pin->Clearance + 1) / 2 + (Pin->Thickness + 1) / 2;
+  width = (Pin->Clearance + 1) + (Pin->Thickness + 1) / 2;
   width = MAX (width, (Pin->Mask + 1) / 2);
   Pin->BoundingBox.X1 = Pin->X - width;
   Pin->BoundingBox.Y1 = Pin->Y - width;

It makes the bounding box bigger than necessary if the pin is not square
and if it doesn't contain a thermal. I don't know what speed
implications arise from this. I also don't know if the bounding box gets
recalculated when the user changes from round to square or changes the
thermal so I did it this safer way. Otherwise with more calculations a
rational upper approximation of sqrt(2) could be used and also a test
for the thermal presence could be used.

CL<