|
@@ -26,42 +26,93 @@
|
26
|
26
|
# | source. |
|
27
|
27
|
# ------------------------------------------------------------------------------
|
28
|
28
|
|
29
|
|
-cd "$(dirname "$0")"
|
30
|
|
-
|
|
29
|
+INSCH="dispensy.kicad_sch"
|
|
30
|
+INPCB="dispensy.kicad_pcb"
|
31
|
31
|
OUTDIR="plot"
|
32
|
|
-LAYER="F.Cu,B.Cu,F.Mask,B.Mask,F.Paste,B.Paste,F.Silkscreen,B.Silkscreen,Edge.Cuts,User.Drawings"
|
|
32
|
+LAYER_F="F.Cu,F.Mask,F.Paste,F.Silkscreen,Edge.Cuts,User.Drawings"
|
|
33
|
+LAYER_B="B.Cu,B.Mask,B.Paste,B.Silkscreen,Edge.Cuts,User.Drawings"
|
33
|
34
|
|
|
35
|
+cd "$(dirname "$0")"
|
34
|
36
|
rm -rf $OUTDIR
|
35
|
37
|
mkdir -p $OUTDIR
|
36
|
38
|
|
37
|
|
-for VAR in pdf svg
|
|
39
|
+# --------------
|
|
40
|
+# | 2D Schematic |
|
|
41
|
+# --------------
|
|
42
|
+
|
|
43
|
+for IN in $INSCH
|
38
|
44
|
do
|
39
|
|
- echo "Exporting schematic $VAR"
|
40
|
|
- rm -rf $OUTDIR/dispensy_sch.$VAR
|
41
|
|
- kicad-cli sch export $VAR \
|
42
|
|
- -t "KiCad Default" \
|
43
|
|
- -o $OUTDIR/dispensy_sch.$VAR \
|
44
|
|
- dispensy.kicad_sch
|
45
|
|
-
|
46
|
|
- echo "Exporting board $VAR"
|
47
|
|
- rm -rf $OUTDIR/dispensy_pcb.$VAR
|
48
|
|
- kicad-cli pcb export $VAR \
|
49
|
|
- -t "KiCad Classic" \
|
50
|
|
- -l $LAYER \
|
51
|
|
- -o $OUTDIR/dispensy_pcb.$VAR \
|
52
|
|
- dispensy.kicad_pcb
|
53
|
|
- echo
|
|
45
|
+ echo "Exporting schematic $IN"
|
|
46
|
+
|
|
47
|
+ for TYPE in pdf svg
|
|
48
|
+ do
|
|
49
|
+ echo "Exporting schematic $TYPE"
|
|
50
|
+ rm -rf $OUTDIR/$IN.$TYPE
|
|
51
|
+ kicad-cli sch export $TYPE \
|
|
52
|
+ -t "KiCad Default" \
|
|
53
|
+ -o $OUTDIR/$IN.$TYPE \
|
|
54
|
+ $IN
|
|
55
|
+ echo
|
|
56
|
+ done
|
54
|
57
|
done
|
55
|
58
|
|
56
|
|
-echo "Exporting board step file"
|
57
|
|
-rm -rf $OUTDIR/dispensy_pcb.step
|
58
|
|
-kicad-cli pcb export step \
|
59
|
|
- -o $OUTDIR/dispensy_pcb.step \
|
60
|
|
- dispensy.kicad_pcb
|
|
59
|
+for IN in $INPCB
|
|
60
|
+do
|
|
61
|
+ echo "Exporting board $IN"
|
|
62
|
+
|
|
63
|
+ # -----------
|
|
64
|
+ # | 2D Layout |
|
|
65
|
+ # -----------
|
|
66
|
+
|
|
67
|
+ for TYPE in pdf svg
|
|
68
|
+ do
|
|
69
|
+ rm -rf $OUTDIR/$IN.$TYPE
|
|
70
|
+ mkdir -p $OUTDIR/$IN.$TYPE
|
61
|
71
|
|
62
|
|
-echo "Converting step to 3mf"
|
63
|
|
-rm -rf $OUTDIR/dispensy_pcb.3mf
|
64
|
|
-prusa-slicer --export-3mf $OUTDIR/dispensy_pcb.step
|
|
72
|
+ echo "Exporting board $TYPE"
|
|
73
|
+ kicad-cli pcb export $TYPE \
|
|
74
|
+ -t "KiCad Classic" \
|
|
75
|
+ -l $LAYER_F,$LAYER_B \
|
|
76
|
+ -o $OUTDIR/$IN.$TYPE/0_both.$TYPE \
|
|
77
|
+ $IN
|
|
78
|
+ echo
|
65
|
79
|
|
66
|
|
-echo "Deleting step file"
|
67
|
|
-rm -rf $OUTDIR/dispensy_pcb.step
|
|
80
|
+ echo "Exporting board front $TYPE"
|
|
81
|
+ kicad-cli pcb export $TYPE \
|
|
82
|
+ -t "KiCad Classic" \
|
|
83
|
+ -l $LAYER_F \
|
|
84
|
+ -o $OUTDIR/$IN.$TYPE/1_front.$TYPE \
|
|
85
|
+ $IN
|
|
86
|
+ echo
|
|
87
|
+
|
|
88
|
+ echo "Exporting board back $TYPE"
|
|
89
|
+ kicad-cli pcb export $TYPE \
|
|
90
|
+ -t "KiCad Classic" \
|
|
91
|
+ -l $LAYER_B \
|
|
92
|
+ -o $OUTDIR/$IN.$TYPE/2_back.$TYPE \
|
|
93
|
+ $IN
|
|
94
|
+ echo
|
|
95
|
+ done
|
|
96
|
+
|
|
97
|
+ echo "Concatenating board PDFs"
|
|
98
|
+ mv $OUTDIR/$IN.pdf $OUTDIR/$IN.tmp
|
|
99
|
+ pdfunite $OUTDIR/$IN.tmp/*.pdf $OUTDIR/$IN.pdf
|
|
100
|
+ rm -rf $OUTDIR/$IN.tmp
|
|
101
|
+
|
|
102
|
+ # -----------
|
|
103
|
+ # | 3D Export |
|
|
104
|
+ # -----------
|
|
105
|
+
|
|
106
|
+ echo "Exporting board step file"
|
|
107
|
+ rm -rf $OUTDIR/$IN.step
|
|
108
|
+ kicad-cli pcb export step \
|
|
109
|
+ -o $OUTDIR/$IN.step \
|
|
110
|
+ $IN
|
|
111
|
+
|
|
112
|
+ echo "Converting step to 3mf"
|
|
113
|
+ rm -rf $OUTDIR/$IN.3mf
|
|
114
|
+ prusa-slicer --export-3mf $OUTDIR/$IN.step
|
|
115
|
+
|
|
116
|
+ echo "Deleting step file"
|
|
117
|
+ rm -rf $OUTDIR/$IN.step
|
|
118
|
+done
|