gerber data V 1.0
Stefan Schuermans

Stefan Schuermans commited on 2019-05-19 16:02:31
Showing 5 changed files, with 36 additions and 12 deletions.

... ...
@@ -1,5 +1,7 @@
1 1
 /*-
2 2
 /*~
3
+/*.gerber/
4
+/*.gerber.zip
5
+/*.net
3 6
 /*.pdf
4 7
 /*.ps
5
-/*.net
... ...
@@ -2148,7 +2148,7 @@ Layer(2 "solder")
2148 2148
 	Line[2.0000mm 23.0000mm 2.0000mm 8.0000mm 12.00mil 60.00mil ""]
2149 2149
 	Line[9.5000mm 30.5000mm 8.5000mm 30.5000mm 36.00mil 60.00mil ""]
2150 2150
 	Text[35.5000mm 9.0000mm 0 100 "BOT" "clearline,onsolder"]
2151
-	Text[40.0000mm 48.0000mm 0 100 "Chaosknoten 0.1.0" "clearline,onsolder"]
2151
+	Text[40.0000mm 48.0000mm 0 100 "Chaosknoten 1.0" "clearline,onsolder"]
2152 2152
 	Text[7.0000mm 3.0000mm 0 100 "by stefan@blinkenarea.org" "clearline,onsolder"]
2153 2153
 )
2154 2154
 Layer(3 "GND")
... ...
@@ -2168,6 +2168,10 @@ Layer(7 "signal3")
2168 2168
 )
2169 2169
 Layer(8 "milling")
2170 2170
 (
2171
+	Line[0.0000 47.0000mm 0.0000 3.0000mm 6.00mil 60.00mil ""]
2172
+	Line[3.0000mm 50.0000mm 62.0000mm 50.0000mm 6.00mil 60.00mil ""]
2173
+	Line[65.0000mm 47.0000mm 65.0000mm 3.0000mm 6.00mil 60.00mil ""]
2174
+	Line[62.0000mm 0.0000 3.0000mm 0.0000 6.00mil 60.00mil ""]
2171 2175
 	Arc[3.0000mm 3.0000mm 3.0000mm 3.0000mm 6.00mil 60.00mil 0 -90 ""]
2172 2176
 	Arc[3.0000mm 47.0000mm 3.0000mm 3.0000mm 6.00mil 60.00mil 0 90 ""]
2173 2177
 	Arc[62.0000mm 47.0000mm 3.0000mm 3.0000mm 6.00mil 60.00mil 90 90 ""]
... ...
@@ -360,7 +360,7 @@ N 2400 4500 1200 4500 4
360 360
 N 5200 4900 7100 4900 4
361 361
 T 4500 14500 9 20 1 0 0 0 5
362 362
 Chaosknoten - animated logo board
363
-version 0.1 date 2019-05-09
363
+version 1.0 date 2019-05-19
364 364
 Copyright (C) 2019 Stefan Schuermans <stefan@blinkenarea.org>
365 365
 Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
366 366
 a BlinkenArea project - http://www.blinkenarea.org/
... ...
@@ -1,23 +1,28 @@
1
-NAMES = Chaosknoten
1
+NAMES := Chaosknoten
2 2
 
3
-GNETLIST = gnetlist
4
-GSCHEM = gschem
5
-PCB = pcb
6
-PS2PDF = ps2pdf
3
+GNETLIST := gnetlist
4
+GSCHEM := gschem
5
+PCB := pcb
6
+PS2PDF := ps2pdf
7 7
 
8
-.PHONY: all nets pdfs tidy clean
8
+SUFFIXES :=
9
+
10
+.PHONY: all nets pdfs gbrs tidy clean
9 11
 .SUFFIXES:
12
+.SECONDARY:
10 13
 
11
-all: nets pdfs tidy
14
+all: nets pdfs gbrs tidy
12 15
 
13 16
 nets: $(addsuffix .net,$(NAMES))
14 17
 
15 18
 pdfs: $(addsuffix .sch.pdf,$(NAMES)) $(addsuffix .pcb.pdf,$(NAMES))
16 19
 
20
+gbrs: $(addsuffix .gerber.zip,$(NAMES))
21
+
17 22
 %.net: %.sch
18 23
 	$(GNETLIST) -q -g PCB -o $@ $<
19 24
 
20
-%.sch.ps: %.sch
25
+%.sch.ps: %.sch gschem-print.scm
21 26
 	$(GSCHEM) -p -s gschem-print.scm -o $@ $<
22 27
 
23 28
 %.pcb.ps: %.pcb
... ...
@@ -26,9 +31,22 @@ pdfs: $(addsuffix .sch.pdf,$(NAMES)) $(addsuffix .pcb.pdf,$(NAMES))
26 31
 %.pdf: %.ps
27 32
 	$(PS2PDF) $< $@
28 33
 
34
+%.gerber.zip: %.pcb
35
+	rm -rf $*.gerber $@
36
+	mkdir -p $*.gerber/tmp
37
+	$(PCB) -x gerber --gerberfile $*.gerber/$* $<
38
+	{ head -n $$(grep -n Via $< | head -n 1 | cut -d ':' -f 1) $<; \
39
+	  tail -n +$$(grep -n Layer $< | head -n 1 | cut -d ':' -f 1) $<; } \
40
+	  | sed 's/ 6.00mil / 1.00mil /g' > $*.gerber/tmp/$<
41
+	$(PCB) -x gerber --gerberfile $*.gerber/tmp/$* $*.gerber/tmp/$<
42
+	mv $*.gerber/tmp/$*.group7.gbr $*.gerber/$*.milling.gbr
43
+	rm $(foreach X,group7 toppaste bottompaste,$*.gerber/$*.$X.gbr)
44
+	rm -rf $*.gerber/tmp
45
+	zip -r $@ $*.gerber
46
+
29 47
 tidy:
30 48
 	rm -f *~ *- *.log *.ps
31 49
 
32 50
 clean: tidy
33
-	rm -f *.net *.pdf
51
+	rm -rf *.net *.pdf *.gerber *.gerber.zip
34 52
 
35 53