Skip to content

Commit b6b4fe2

Browse files
committed
Add script to run and debug kibot locally, slim donw kibot config, add JLC rotation corrections
1 parent bbbfe89 commit b6b4fe2

File tree

3 files changed

+86
-133
lines changed

3 files changed

+86
-133
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ _autosave*
55
*-bak
66
tmp
77
jlcpcb
8+
output

.kibot/kibot-double-sided.yaml

Lines changed: 74 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,80 @@
1-
---
21
kibot:
32
version: 1
4-
53
global:
6-
output: "@NAME@-%r-%i.%x"
4+
output: '@NAME@-%r-%i.%x'
75
field_lcsc_part: LCSC
8-
6+
filters:
7+
- name: fix_rotation
8+
comment: 'Adjust rotation for JLC'
9+
type: rot_footprint
10+
negative_bottom: false
11+
mirror_bottom: true
12+
rotations_and_offsets:
13+
- field: Value
14+
regex: NCP715SQ50T2G
15+
angle: -90.0 # 270° + -90° = 180°
16+
- field: Value
17+
regex: AP63203WU
18+
angle: -90.0 # 90° + -90° = 0°
919
import:
10-
- file: JLCPCB
11-
definitions:
12-
_KIBOT_POS_ONLY_SMD: false
13-
20+
- file: JLCPCB
21+
definitions:
22+
_KIBOT_POS_ONLY_SMD: false
23+
_KIBOT_POS_PRE_TRANSFORM: fix_rotation
1424
outputs:
15-
- name: 'JLCPCB_position'
16-
type: custom
17-
definition: JLCPCB
18-
dir: JLCPCB
19-
mods:
20-
- name: JLCPCB_position
21-
corrections:
22-
- designator: ^U2$
23-
rotation: 0
24-
- designator: ^U3$
25-
rotation: 180
26-
# - name: 'Gerber'
27-
# comment: 'Gerber files'
28-
# type: 'gerber'
29-
# dir: 'gerber'
30-
# layers:
31-
# - "F.Cu"
32-
# - "B.Cu"
33-
# - "F.Mask"
34-
# - "B.Mask"
35-
# - "F.Silkscreen"
36-
# - "B.Silkscreen"
37-
# - "Edge.Cuts"
38-
# options:
39-
# output: "@NAME@-%r-Gerber-%i.%x"
40-
41-
# - name: 'Excellon'
42-
# comment: 'Excellon drill files'
43-
# type: 'excellon'
44-
# dir: 'excellon'
45-
# options:
46-
# output: "@NAME@-%r-Drill.%x"
47-
48-
# - name: 'Pick and Place'
49-
# comment: "Pick and Place file"
50-
# type: 'position'
51-
# dir: 'pick-and-place'
52-
# options:
53-
# output: "@NAME@-%r-PickAndPlace.%x"
54-
# format: "CSV"
55-
# separate_files_for_front_and_back: false
56-
57-
# - name: 'BOM'
58-
# comment: "Bill of materials (XLSX)"
59-
# type: bom
60-
# options:
61-
# output: "@NAME@-%r-BOM.%x"
62-
# format: "XLSX"
63-
# columns:
64-
# - "Row"
65-
# - "References"
66-
# - "Value"
67-
# - "Footprint"
68-
# - "Quantity per PCB"
69-
# - "MPN"
70-
# - "Manufacturer_Name"
71-
# normalize_values: true
72-
# xlsx:
73-
# logo: false
74-
# title: "BOM @NAME@ %r"
75-
# hide_pcb_info: true
76-
# hide_stats_info: true
77-
# highlight_empty: false
78-
79-
- name: 'Schematic'
80-
comment: "Print schematic (PDF)"
81-
type: pdf_sch_print
82-
options:
83-
output: "@NAME@-%r-Schematic.%x"
84-
85-
- name: 'PCB TOP image'
86-
comment: "PNG of the top side of the PCB"
87-
type: pcbdraw
88-
options:
89-
output: "@NAME@-%r-Top.%x"
90-
dpi: 1200
91-
format: png
92-
93-
- name: 'PCB BOTTOM image'
94-
comment: "PNG of the bottom side of the PCB"
95-
type: pcbdraw
96-
options:
97-
output: "@NAME@-%r-Bottom.%x"
98-
dpi: 1200
99-
format: png
100-
bottom: true
101-
102-
- name: "3D Blender top image"
103-
comment: "@NAME@ 3D render from top (High Quality)"
104-
type: blender_export
105-
options:
106-
render_options:
107-
background1: "#8FBCF7FF"
108-
background2: "#0B1E35FF"
109-
samples: 20
110-
resolution_y: 1440
111-
resolution_x: 2560
112-
point_of_view:
113-
rotate_x: -5
114-
outputs:
115-
- type: render
116-
output: "@NAME@-%r-Top-3D.png"
117-
118-
- name: "3D Blender bootom image"
119-
comment: "@NAME@ 3D render from bottom (High Quality)"
120-
type: blender_export
121-
options:
122-
render_options:
123-
background1: "#8FBCF7FF"
124-
background2: "#0B1E35FF"
125-
samples: 20
126-
resolution_y: 1440
127-
resolution_x: 2560
128-
point_of_view:
129-
rotate_x: 5
130-
rotate_y: 180
131-
outputs:
132-
- type: render
133-
output: "@NAME@-%r-Bottom-3D.png"
134-
135-
- name: "Step file"
136-
comment: "@NAME@ Step file"
137-
type: export_3d
138-
options:
139-
output: "@NAME@-%r.step"
25+
- name: Schematic
26+
comment: Print schematic (PDF)
27+
type: pdf_sch_print
28+
options:
29+
output: '@NAME@-%r-Schematic.%x'
30+
- name: PCB TOP image
31+
comment: PNG of the top side of the PCB
32+
type: pcbdraw
33+
options:
34+
output: '@NAME@-%r-Top.%x'
35+
dpi: 1200
36+
format: png
37+
- name: PCB BOTTOM image
38+
comment: PNG of the bottom side of the PCB
39+
type: pcbdraw
40+
options:
41+
output: '@NAME@-%r-Bottom.%x'
42+
dpi: 1200
43+
format: png
44+
bottom: true
45+
- name: 3D Blender top image
46+
comment: '@NAME@ 3D render from top (High Quality)'
47+
type: blender_export
48+
options:
49+
render_options:
50+
background1: '#8FBCF7FF'
51+
background2: '#0B1E35FF'
52+
samples: 20
53+
resolution_y: 1440
54+
resolution_x: 2560
55+
point_of_view:
56+
rotate_x: -5
57+
outputs:
58+
- type: render
59+
output: '@NAME@-%r-Top-3D.png'
60+
- name: 3D Blender bootom image
61+
comment: '@NAME@ 3D render from bottom (High Quality)'
62+
type: blender_export
63+
options:
64+
render_options:
65+
background1: '#8FBCF7FF'
66+
background2: '#0B1E35FF'
67+
samples: 20
68+
resolution_y: 1440
69+
resolution_x: 2560
70+
point_of_view:
71+
rotate_x: 5
72+
rotate_y: 180
73+
outputs:
74+
- type: render
75+
output: '@NAME@-%r-Bottom-3D.png'
76+
- name: Step file
77+
comment: '@NAME@ Step file'
78+
type: export_3d
79+
options:
80+
output: '@NAME@-%r.step'

run-kibot.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
docker run --rm -it \
4+
-v .:/board \
5+
-v .kibot/kibot-double-sided.yaml:/config.yaml \
6+
ghcr.io/inti-cmnb/kicad9_auto_full:latest \
7+
kibot -v -c /config.yaml \
8+
-b /board/BSH-Board.kicad_pcb \
9+
-e /board/BSH-Board.kicad_sch \
10+
-d /board/output \
11+
-E NAME=BSH-Board

0 commit comments

Comments
 (0)