adding/updating some parts for QuantiMotor
[hw/altusmetrum] / packages / g6z1f.5c
1 /*
2  * Copyright © 2013 Bdale Garbee <bdale@gag.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
16  */
17
18 load "footprint.5c"
19 import Footprint;
20
21 int total_pad = 14;
22 real center_gap = 6.00;
23
24 real pad_width;
25 real rf_pad_width = 0.8;
26 real misc_pad_width = 1.1;
27 real pad_height = 2.3;
28 real pad_spacing = 2.54;
29
30 int num_pad = total_pad / 2;    /* per side */
31
32 string name = sprintf ("G6Z-1F");
33
34 real package_width = 20.0;
35 real package_height = 8.6;
36
37 real pad_y_off = center_gap / 2 + pad_height / 2;
38
39 element_start(name);
40
41 real pad_off(int n) {
42         return pad_spacing * (n - (num_pad - 1) / 2);
43 }
44
45 real corner(int dx, int dy) {
46         real    x = dx * package_width / 2;
47         real    y = dy * package_height / 2;
48         real    len = 0.4;
49
50         line(x, y, x - dx * len, y);
51         line(x, y, x, y - dy * len);
52 }
53
54 corner(-1, -1);
55 corner(1, -1);
56 corner(-1, 1);
57 corner(1, 1);
58
59 real dot_off = -.3;
60
61 line(-package_width/2 + dot_off, package_height/2 - dot_off,
62      -package_width/2 + dot_off, package_height/2 - dot_off);
63
64 for (int pad = 0; pad < num_pad; pad++) {
65         /* bottom (1-num_pad) */
66
67     if (pad == 3) {
68         pad_width = rf_pad_width;
69     } else {
70         pad_width = misc_pad_width;
71     }
72     if (pad != 1 && pad != 5) {
73         pad_mm(pad_off(pad),
74                pad_y_off,
75                pad_width,
76                pad_height,
77                sprintf("%d", pad + 1),
78                sprintf("%d", pad + 1));
79     }   
80
81         /* top side (total_pad - num_pad+1) */
82
83     if (pad == 0 || pad == 6) {
84         pad_width = rf_pad_width;
85     } else {
86         pad_width = misc_pad_width;
87     }
88
89     if (pad != 3) {
90         pad_mm(-pad_off(pad),
91                -pad_y_off,
92                pad_width,
93                pad_height,
94                sprintf("%d", total_pad - pad),
95                sprintf("%d", total_pad - pad));
96     }   
97 }
98
99 element_end();