Mail Archives: geda-user/2012/07/09/18:46:25
On Sat, Jul 07, 2012 at 09:27:20PM -0700, Andrew Poelstra wrote:
> On Sat, Jul 07, 2012 at 12:41:56PM +0200, Peter Stuge wrote:
> > Gabriel Paubert wrote:
> > > @@ -668,7 +695,7 @@ gerber_set_layer (const char *name, int group, int empty)
> > > }
> > > /* Notice the last zeroes are literal zeroes here, a *
> > > * x10 scale factor. v v */
> > > - pcb_fprintf (f, "X%06.0ml0Y%06.0ml0\r\n",
> > > + pcb_fprintf (f, metric ? "X%06.0muY%06.0mu\r\n" : "X%06.0ml0Y%06.0ml0\r\n",
> > > gerberDrX (PCB, pending_drills[i].x),
> > > gerberDrY (PCB, pending_drills[i].y));
> >
> > It seems there is a whitespace error in this hunk.
> >
>
> Nope, it was actually the old whitespace that was wrong, hence
> the funny-looking patch.
>
> However, the v's above are supposed to point to the extra 0's
> on the imperial string, which I fixed. That is the only change
> I made before pushing the patch.
Thanks for pointing this out, I completely missed it, but I think
that they point to the wrong 0 when looking at the source.
Corrected in the following, with a fix for octogonal apertures
in which I did a mistake and ended up with two metric conversion
specifications. Note that I have touched a bit the whitespace at
the beginning of the comments so that they start with a tab like
the surrounding code lines.
Now what would be the right solution to produce ncdrill files
with 0.1 mil resolution?
Adding a new conversion specifier ?
(%md is taken, %mh for hole, %mX for eXcellon?)
The fact that imperial Gerber have 2 orders or magnitude better
resolution than the associated drill is a problem (25.4µm versus
0.254µm). At least metric gives micrometer resolution for both.
Gabriel
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 79c0447..b2567cb 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -240,7 +240,7 @@ fprintAperture (FILE *f, Aperture *aptr)
break;
case OCTAGON:
pcb_fprintf (f, metric ? "%%AMOCT%d*5,0,8,0,0,%.3`mm,22.5*%%\r\n"
- "%%ADD%dOCT%d*%%\r\n" : "%%AMOCT%d*5,0,8,0,0,%.3`mm,22.5*%%\r\n"
+ "%%ADD%dOCT%d*%%\r\n" : "%%AMOCT%d*5,0,8,0,0,%.4`mi,22.5*%%\r\n"
"%%ADD%dOCT%d*%%\r\n", aptr->dCode,
(Coord) ((double) aptr->width / COS_22_5_DEGREE), aptr->dCode,
aptr->dCode);
@@ -693,8 +693,8 @@ gerber_set_layer (const char *name, int group, int empty)
Aperture *ap = findAperture (curr_aptr_list, pending_drills[i].diam, ROUND);
fprintf (f, "T%02d\r\n", ap->dCode);
}
- /* Notice the last zeroes are literal zeroes here, a x10 scale factor. *
- * v v */
+ /* Notice the last zeroes are literal zeroes here, a x10 scale factor. *
+ * v v */
pcb_fprintf (f, metric ? "X%06.0muY%06.0mu\r\n" : "X%06.0ml0Y%06.0ml0\r\n",
gerberDrX (PCB, pending_drills[i].x),
gerberDrY (PCB, pending_drills[i].y));
- Raw text -