c8a1d2b5fc797011c449528dadc0547eed2b96ea
[hw/altusmetrum] / packages / trapc5mx.py
1 #!/usr/bin/python3
2 # Copyright 2020 by Bdale Garbee <bdale@gag.com>.  GPLv3
3 #
4 # Program to emit PCB footprint for switchcraft 5-pin mini-XLR, TRAPC5MX
5 #
6
7 # dimensions in mils from TRAPC_X-TRASM_X_SERIES_CD.PDF
8 # reference plane is board edge (shoulder for box wall opening)
9
10 BodyWidth = 530         # connector body outline
11 BodyHeight = 400
12 NoseWidth = 437         # threaded "snout" that projects through box wall
13 NoseHeight = 280
14
15 Mnt_Y = 135             # how far mounting studs are back from plane
16 Mnt_X = 470             # mounting studs center to center
17 Mnt_Drill = 70          # mounting hole diameter
18 Mnt_Thickness = 120     # mounting hole pad diameter
19 Mnt_Mask = 130          # opening in mask for mounting hole
20
21 Pin_Y = (110 + Mnt_Y)   # how far first pin row is back from plane
22 PinSpacing = 100        # space between rows and between pins in a row
23 Pin_Drill = 40          # signal pin hole diameter
24 Pin_Thickness = 65      # signal pin hole pad diameter
25 Pin_Mask = 75           # opening in mask for signal pin
26
27 Clearance = 15
28 SilkLine = 5
29
30 import sys
31
32 print ('# author: Bdale Garbee')
33 print ('# email: bdale@gag.com')
34 print ('# dist-license: GPL 3')
35 print ('# use-license: unlimited')
36
37 # Pin (rX rY Thickness Clearance Mask Drill "Name" "Number" NFlags)
38
39 print ('Element[0x0 "trapc5mx" "" "" 0 0 0 0 0 100 0x0]')
40 print ("(")
41 print ('   Pin(',\
42                 (Mnt_X / 2), \
43                 Mnt_Y, \
44                 Mnt_Thickness, \
45                 Clearance, \
46                 Mnt_Mask, \
47                 Mnt_Drill, \
48                 '"pin6" "6" 0x0001)')
49
50 print ('   Pin(',\
51                 -(Mnt_X / 2), \
52                 Mnt_Y, \
53                 Mnt_Thickness, \
54                 Clearance, \
55                 Mnt_Mask, \
56                 Mnt_Drill, \
57                 '"pin6" "6" 0x0001)')
58
59 print ('   Pin(',\
60                 (PinSpacing / 2), \
61                 Pin_Y, \
62                 Pin_Thickness, \
63                 Clearance, \
64                 Pin_Mask, \
65                 Pin_Drill, \
66                 '"pin2" "2" 0x0001)')
67
68 print ('   Pin(',\
69                 -(PinSpacing / 2), \
70                 Pin_Y, \
71                 Pin_Thickness, \
72                 Clearance, \
73                 Pin_Mask, \
74                 Pin_Drill, \
75                 '"pin3" "3" 0x0001)')
76
77 print ('   Pin(',\
78                 PinSpacing, \
79                 (Pin_Y + PinSpacing), \
80                 Pin_Thickness, \
81                 Clearance, \
82                 Pin_Mask, \
83                 Pin_Drill, \
84                 '"pin1" "1" 0x0001)')
85
86 print ('   Pin(',\
87                 0, \
88                 (Pin_Y + PinSpacing), \
89                 Pin_Thickness, \
90                 Clearance, \
91                 Pin_Mask, \
92                 Pin_Drill, \
93                 '"pin5" "5" 0x0001)')
94
95 print ('   Pin(',\
96                 -PinSpacing, \
97                 (Pin_Y + PinSpacing), \
98                 Pin_Thickness, \
99                 Clearance, \
100                 Pin_Mask, \
101                 Pin_Drill, \
102                 '"pin4" "4" 0x0001)')
103
104 print ('   ElementLine(',\
105         -(BodyWidth/2), \
106         0, \
107         (BodyWidth/2), \
108         0, \
109         SilkLine, \
110         ')')
111
112 print ('   ElementLine(',\
113         -(BodyWidth/2), \
114         BodyHeight, \
115         (BodyWidth/2), \
116         BodyHeight, \
117         SilkLine, \
118         ')')
119
120 print ('   ElementLine(',\
121         -(BodyWidth/2), \
122         BodyHeight, \
123         -(BodyWidth/2), \
124         0, \
125         SilkLine, \
126         ')')
127
128 print ('   ElementLine(',\
129         (BodyWidth/2), \
130         BodyHeight, \
131         (BodyWidth/2), \
132         0, \
133         SilkLine, \
134         ')')
135
136 print ('   ElementLine(',\
137         -(NoseWidth/2), \
138         0, \
139         (NoseWidth/2), \
140         0, \
141         SilkLine, \
142         ')')
143
144 print ('   ElementLine(',\
145         -(NoseWidth/2), \
146         -NoseHeight, \
147         (NoseWidth/2), \
148         -NoseHeight, \
149         SilkLine, \
150         ')')
151
152 print ('   ElementLine(',\
153         -(NoseWidth/2), \
154         -NoseHeight, \
155         -(NoseWidth/2), \
156         0, \
157         SilkLine, \
158         ')')
159
160 print ('   ElementLine(',\
161         (NoseWidth/2), \
162         -NoseHeight, \
163         (NoseWidth/2), \
164         0, \
165         SilkLine, \
166         ')')
167
168 print (")")