Mail Archives: geda-user/2012/07/11/16:08:46
Hi Geda List,
I'm writing my own geda HID (an exporter for pick and place) and I've
started out with the BOM exporter.
Looking at the source for pcb_(f)printf it's not obvious how I'd go
about using this to output the data in the form I need, I'm looking to
output the centroid location data in hundredths of mm.
Here's what I'm testing so far:
pcb_fprintf(fp, "3 : 230: 1: 3: 0:F 1X %.2mMY %.2mMA %gR %s %s %s\n",
x , y, theta * 10, name, value, FRONT (element) == 1 ? "top"
: "bot");
This seems to output mixed units, some in MM and some in Mils. Please
ignore the fact I'm printing a half-line of garbage before the data
we're interested in, the pnp file format is weird and I haven't
completely deciphered it yet.
The BOM exproter contains
pcb_fprintf (fp, "%m+%s,\"%s\",\"%s\",%.2mS,%.2mS,%g,%s\n",
xy_unit->allow, name, descr, value, x, y,
theta, FRONT (element) == 1 ? "top" : "bottom");
I'm not folowing the use of the unit here - I fail to see how it works,
but it does, and I'm having trouble replicating this and getting metric
units in hundredths of mm.
Please could someone enlighten me? Many thanks!
Ed
- Raw text -