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

gEDA-user: PCB: thermal problem with RS-274X output.



While attempting to sort out some issues with thermals I noticed a pretty
drastic difference in PCB and Gerber output.

        http://www.jurai.net/~winter/thermal-pcb.gif
        http://www.jurai.net/~winter/thermal-gerbv.gif

The length of the "fingers" in the Gerber output isn't right.

Note that I've changed the finger ends from ROUND to SQUARE and added more
fingers.  Patches for these minor changes attached.

My read of the code indicates that it should be doing the right thing. The
X11 code and the Gerber code aren't doing anything different.

Anyone else seeing this?

--
10 40 80 C0 00 FF FF FF FF C0 00 00 00 00 10 AA AA 03 00 00 00 08 00
--- src/dev_rs274x.c.orig	Sun Feb 13 21:40:57 2005
+++ src/dev_rs274x.c	Mon Feb 14 00:22:01 2005
@@ -127,6 +127,7 @@
 static void GBX_Postamble (void);
 static void GBX_Invert (int);
 static void GBX_PrintLine (LineTypePtr, Boolean);
+static void GBX_PrintLineAp (LineTypePtr, Boolean, ApertureShape);
 static void GBX_PrintArc (ArcTypePtr, Boolean);
 static void GBX_PrintPolygon (PolygonTypePtr);
 static void GBX_PrintText (TextTypePtr);
@@ -352,7 +353,7 @@
 	  if (TEST_FLAG (ALLTHERMFLAGS, pin))
 	    {
 	      int finger = (pin->Thickness - pin->DrillingHole) * PCB->ThermScale;
-	      findApertureCode (&GBX_Apertures, finger, 0, 0, ROUND);
+	      findApertureCode (&GBX_Apertures, finger, 0, 0, SQUARE);
 	      findApertureCode (&GBX_Apertures, pin->Thickness,
 				pin->Thickness + pin->Clearance, finger,
 				THERMAL);
@@ -420,7 +421,7 @@
       if (TEST_FLAG (ALLTHERMFLAGS, via))
 	{
 	  int finger = (via->Thickness - via->DrillingHole) * PCB->ThermScale;
-	  findApertureCode (&GBX_Apertures, finger, 0, 0, ROUND);
+	  findApertureCode (&GBX_Apertures, finger, 0, 0, SQUARE);
 	  findApertureCode (&GBX_Apertures, via->Thickness,
 			    via->Thickness + via->Clearance, finger, THERMAL);
 	}
@@ -646,6 +647,12 @@
 static void
 GBX_PrintLine (LineTypePtr Line, Boolean Clear)
 {
+  GBX_PrintLineAp(Line, Clear, ROUND);
+}
+
+static void
+GBX_PrintLineAp (LineTypePtr Line, Boolean Clear, ApertureShape shape)
+{
   Boolean m = False;
   int size;
 
@@ -655,7 +662,7 @@
 
   if (size == 0)
     return;
-  setAperture (&GBX_Apertures, size, 0, 0, ROUND);
+  setAperture (&GBX_Apertures, size, 0, 0, shape);
   if (Line->Point1.X != lastX)
     {
       m = True;
@@ -1071,17 +1078,30 @@
       int size2 = (size + Ptr->Clearance) / 2;
       int finger = (Ptr->Thickness - Ptr->DrillingHole) * PCB->ThermScale;
 
+      line.Thickness = finger;
+
+      line.Point1.X = Ptr->X;
+      line.Point1.Y = Ptr->Y - size2;
+      line.Point2.X = Ptr->X;
+      line.Point2.Y = Ptr->Y + size2;
+      GBX_PrintLineAp (&line, False, SQUARE);
+
+      line.Point1.X = Ptr->X - size2; 
+      line.Point1.Y = Ptr->Y;
+      line.Point2.X = Ptr->X + size2;
+      line.Point2.Y = Ptr->Y;
+      GBX_PrintLineAp (&line, False, SQUARE);
+
       if (!TEST_FLAG (SQUAREFLAG, Ptr))
 	size2 = (7 * size2) / 10;
       line.Point1.X = Ptr->X - size2;
       line.Point1.Y = Ptr->Y - size2;
       line.Point2.X = Ptr->X + size2;
       line.Point2.Y = Ptr->Y + size2;
-      line.Thickness = finger;
-      GBX_PrintLine (&line, False);
+      GBX_PrintLineAp (&line, False, SQUARE);
       line.Point1.Y += 2 * size2;
       line.Point2.Y -= 2 * size2;
-      GBX_PrintLine (&line, False);
+      GBX_PrintLineAp (&line, False, SQUARE);
     }
 }
 
--- src/draw.c.orig	Sun Feb 13 19:26:24 2005
+++ src/draw.c	Sun Feb 13 23:58:55 2005
@@ -1193,7 +1193,7 @@
 static void
 ThermPin (LayerTypePtr layer, PinTypePtr Pin)
 {
-  BDimension half = (Pin->Thickness + Pin->Clearance) / 2;
+  BDimension half = 1 + (Pin->Thickness + Pin->Clearance) / 2;
   BDimension finger;
 
   if (TEST_FLAG (SELECTEDFLAG | FOUNDFLAG, Pin))
@@ -1209,25 +1209,34 @@
   finger = (Pin->Thickness - Pin->DrillingHole) * PCB->ThermScale;
   XSetLineAttributes (Dpy, Output.fgGC,
 		      TEST_FLAG (THINDRAWFLAG, PCB) ? 1 : TO_SCREEN (finger),
-		      LineSolid, CapRound, JoinRound);
+		      LineSolid, CapButt, JoinMiter);
+  /* X */
   if (TEST_FLAG (SQUAREFLAG, Pin))
     {
 
       XDrawCLine (Dpy, DrawingWindow, Output.fgGC,
-		  Pin->X - half, Pin->Y - half, Pin->X + half, Pin->Y + half);
+		  Pin->X - half, Pin->Y - half,
+		  Pin->X + half, Pin->Y + half);
       XDrawCLine (Dpy, DrawingWindow, Output.fgGC,
-		  Pin->X - half, Pin->Y + half, Pin->X + half, Pin->Y - half);
+		  Pin->X - half, Pin->Y + half,
+		  Pin->X + half, Pin->Y - half);
     }
   else
     {
       BDimension halfs = (half * M_SQRT1_2 + 1);
 
       XDrawCLine (Dpy, DrawingWindow, Output.fgGC,
-		  Pin->X - halfs, Pin->Y - halfs, Pin->X + halfs,
-		  Pin->Y + halfs);
-      XDrawCLine (Dpy, DrawingWindow, Output.fgGC, Pin->X - halfs,
-		  Pin->Y + halfs, Pin->X + halfs, Pin->Y - halfs);
+		  Pin->X - halfs, Pin->Y - halfs,
+		  Pin->X + halfs, Pin->Y + halfs);
+      XDrawCLine (Dpy, DrawingWindow, Output.fgGC,
+		  Pin->X - halfs, Pin->Y + halfs,
+		  Pin->X + halfs, Pin->Y - halfs);
     }
+    /* + */
+  XDrawCLine (Dpy, DrawingWindow, Output.fgGC,
+              Pin->X, Pin->Y - half, Pin->X, Pin->Y + half);
+  XDrawCLine (Dpy, DrawingWindow, Output.fgGC,
+              Pin->X - half, Pin->Y, Pin->X + half, Pin->Y);
 }
 
 /* ---------------------------------------------------------------------------