From 76987b1dfb2c113ef5d463283b14ab05dd48b88e Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 7 May 2017 14:29:16 -0300 Subject: [PATCH] fab/gmerge: support non-circular apertures Had this sitting around uncommitted for eight months ... --- fab/gmerge | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fab/gmerge b/fab/gmerge index b80aca2..9fafbe3 100755 --- a/fab/gmerge +++ b/fab/gmerge @@ -2,8 +2,8 @@ # # gmerge - Merge multiple KiCAD Gerber files into one # -# Written 2011 by Werner Almesberger -# Copyright 2011 Werner Almesberger +# Written 2011, 2016 by Werner Almesberger +# Copyright 2011, 2016 Werner Almesberger # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,7 +29,8 @@ LINE: while (<>) { $state = "CMD"; next; } - die "unrecognized aperture" unless /^%ADD(\d+)C,((\d|\.)+)\*%/; + die "unrecognized aperture" + unless /^%ADD(\d+)([CRO],(\d|\.)+(X(\d|\.)+)?)\*%/; for (keys %apt) { if ($apt{$_} == $2) { $map{$1} = $_; @@ -71,7 +72,7 @@ LINE: while (<>) { print $ghdr || die $!; print "G04 APERTURE LIST*\n" || die $!; for (sort keys %apt) { - print "\%ADD".$_."C,".$apt{$_}."*%\n" || die $!; + print "\%ADD".$_.$apt{$_}."*%\n" || die $!; } print "G04 APERTURE END LIST*\n" || die $!; print $c || die $!;