Add support for G00/G01 slot routing commands
Brought to you by:
spetm,
thepurlieu
This patch builds on my previous patch (submitted in ticket #51) and adds support for G00/G01 slot routing commands, which some software packages (eg, Orcad) use. I also cleaned up some of the tabbing in the drill file at the same time, hence the wider set of changes.
Might be something missing:
libtool: compile: gcc -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I. -I.. -DPREFIXDIR=\"/usr\" -DBINDIR=\"/usr/bin\" -DBACKEND_DIR=\"/usr/share/gerbv/scheme/\" -DSCMSUBDIR=\"scheme\" -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -c exportimage.c -fPIC -DPIC -o .libs/exportimage.o
drill.c: In function 'drill_parse_M_code':
drill.c:1330:7: error: 'gerbv_drill_stats_t' has no member named 'M15'
stats->M15++;
^
drill.c:1333:7: error: 'gerbv_drill_stats_t' has no member named 'M16'
stats->M16++;
^
make[3]: [drill.lo] Error 1
make[3]: Waiting for unfinished jobs....
Oops, forgot to include changes to one of the header file, here is a revised patch.
Slots work for me now with this patch, thanks navinen!
I've found another example not handled by the patch. I suspect the intent is to define a border around a PCB.
G81
M48
INCH,LZ,00.000
T1C00.025
%
T001
G00X0.003Y0.003
M15
G01X4.603Y0.003
X4.603Y3.603
X0.003Y3.603
X0.003Y0.003
M17
M30
Not sure to what extremes you want to go to.
This should fix it (must be applied on top of the previous patch).
Since I wanted the routed slot support, but this did not cleanly apply, I rebased this patch with the dependency from the previously mentioned patch. The state machine handling introduced by Nicholas is needed since the routed slots are made up of multiple commands.
Only straight routed slots are supported by this patch.
I need an example file.
Two examples attached, these are handcrafted to match the format emitted by Altium. Created by taking the drill file exported from gEDA/PCB, isolating the drill holes meant to be slots, changing them into route commands adding appropriate goto and unplunge commands according to the Excellon drill format.