-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkikit_post.py
79 lines (67 loc) · 2.32 KB
/
kikit_post.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env python3
from kikit.common import resolveAnchor, EDA_ANGLE
from kikit.units import mm, deg
from kikit.defs import EDA_TEXT_HJUSTIFY_T, EDA_TEXT_VJUSTIFY_T, Layer
import pcbnew
def kikitPostprocess(panel, arg):
# Front Top
position = resolveAnchor("mt")(panel.boardSubstrate.boundingBox())
position.y += int(2.5 * mm)
panel.addText(
"${TITLE} - REV${REVISION}",
position,
orientation=EDA_ANGLE(0,1),
hJustify=EDA_TEXT_HJUSTIFY_T.GR_TEXT_HJUSTIFY_CENTER,
thickness=int(0.3 * mm),
layer=Layer.F_SilkS
)
# Front Bottom
position = resolveAnchor("mb")(panel.boardSubstrate.boundingBox())
position.y -= int(2.5 * mm)
panel.addText(
"${ISSUE_DATE} ${COMPANY}",
position,
orientation=EDA_ANGLE(0,1),
hJustify=EDA_TEXT_HJUSTIFY_T.GR_TEXT_HJUSTIFY_CENTER,
thickness=int(0.2 * mm),
layer=Layer.F_SilkS
)
# Back Top
position = resolveAnchor("mt")(panel.boardSubstrate.boundingBox())
position.y += int(2.5 * mm)
panel.addText(
"${TITLE} - REV${REVISION} ",
position,
orientation=EDA_ANGLE(0,1),
hJustify=EDA_TEXT_HJUSTIFY_T.GR_TEXT_HJUSTIFY_CENTER,
thickness=int(0.3 * mm),
layer=Layer.B_SilkS
)
# Back Bottom
position = resolveAnchor("mb")(panel.boardSubstrate.boundingBox())
position.y -= int(2.5 * mm)
panel.addText(
"JLCJLCJLCJLC",
position,
orientation=EDA_ANGLE(0,1),
hJustify=EDA_TEXT_HJUSTIFY_T.GR_TEXT_HJUSTIFY_CENTER,
thickness=int(0.2 * mm),
layer=Layer.B_SilkS
)
# # Add top panel dimension
# dim = pcbnew.PCB_DIM_ALIGNED(panel.board)
# dim.SetStart(resolveAnchor("tl")(panel.boardSubstrate.boundingBox()))
# dim.SetEnd(resolveAnchor("tr")(panel.boardSubstrate.boundingBox()))
# dim.SetHeight(int(-2.5 * mm));
# dim.SetUnits(pcbnew.EDA_UNITS_MILLIMETRES)
# dim.SetLayer(Layer.Cmts_User)
# panel.board.Add(dim)
# # Add side panel dimension
# dim = pcbnew.PCB_DIM_ALIGNED(panel.board)
# dim.SetStart(resolveAnchor("tl")(panel.boardSubstrate.boundingBox()))
# dim.SetEnd(resolveAnchor("bl")(panel.boardSubstrate.boundingBox()))
# dim.SetHeight(int(2.5 * mm));
# dim.SetUnits(pcbnew.EDA_UNITS_MILLIMETRES)
# dim.SetLayer(Layer.Cmts_User)
# panel.board.Add(dim)
panel.save()