ccb833fdc3
Generated files: - gerbers/: All Gerber layers, drill files, pick-and-place CSV - SN-L00-gerbers.zip: Ready for upload to PCB fab - scripts/export_gerbers.sh: Regenerate with one command Layers: F.Cu, B.Cu, F/B.Paste, F/B.Silkscreen, F/B.Mask, Edge.Cuts
62 lines
1.4 KiB
Bash
Executable File
62 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# Export Gerbers, drill files, and pick-and-place for PCB manufacturing
|
|
# Usage: ./scripts/export_gerbers.sh
|
|
|
|
set -e
|
|
cd "$(dirname "$0")/.."
|
|
|
|
PCB_FILE="SN-L00.kicad_pcb"
|
|
OUT_DIR="gerbers"
|
|
ZIP_FILE="SN-L00-gerbers.zip"
|
|
|
|
echo "============================================"
|
|
echo "SN-L00 Gerber Export"
|
|
echo "============================================"
|
|
|
|
# Clean and create output directory
|
|
rm -rf "$OUT_DIR" "$ZIP_FILE"
|
|
mkdir -p "$OUT_DIR"
|
|
|
|
# Export Gerbers
|
|
echo "[1/4] Exporting Gerber layers..."
|
|
kicad-cli pcb export gerbers \
|
|
-o "$OUT_DIR/" \
|
|
-l "F.Cu,B.Cu,F.Paste,B.Paste,F.Silkscreen,B.Silkscreen,F.Mask,B.Mask,Edge.Cuts" \
|
|
"$PCB_FILE"
|
|
|
|
# Export drill files
|
|
echo "[2/4] Exporting drill files..."
|
|
kicad-cli pcb export drill \
|
|
-o "$OUT_DIR/" \
|
|
--format excellon \
|
|
--drill-origin absolute \
|
|
--excellon-zeros-format decimal \
|
|
--excellon-units mm \
|
|
--generate-map \
|
|
--map-format gerberx2 \
|
|
"$PCB_FILE"
|
|
|
|
# Export pick and place
|
|
echo "[3/4] Exporting pick and place..."
|
|
kicad-cli pcb export pos \
|
|
-o "$OUT_DIR/SN-L00-pos.csv" \
|
|
--format csv \
|
|
--units mm \
|
|
--side both \
|
|
--use-drill-file-origin \
|
|
"$PCB_FILE"
|
|
|
|
# Create zip
|
|
echo "[4/4] Creating zip archive..."
|
|
cd "$OUT_DIR"
|
|
zip -r "../$ZIP_FILE" .
|
|
cd ..
|
|
|
|
echo ""
|
|
echo "============================================"
|
|
echo "Generated files:"
|
|
ls -lh "$OUT_DIR"/
|
|
echo ""
|
|
echo "Upload to fab: $ZIP_FILE ($(du -h "$ZIP_FILE" | cut -f1))"
|
|
echo "============================================"
|