2 * Copyright © 2019 Keith Packard <keithp@keithp.com>
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.
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.
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.
21 real small_pad_width = 0.2;
22 real small_pad_height = 0.6;
23 real small_pad_x_sep = 0.5;
24 real small_pad_center_distance = 2.3;
25 real small_pad_y_off = small_pad_center_distance / 2;
27 real large_pad_width = 1.05;
28 real large_pad_height = 0.4;
29 real large_pad_x_sep = 1.35;
30 real large_pad_y_sep = 0.7;
32 real package_width = 2.0;
33 real package_height = 2.5;
35 real num_pad = 4; /* per side */
37 element_start("VQFN-HR-12");
39 real corner(int dx, int dy) {
40 real x = dx * package_width / 2;
41 real y = dy * package_height / 2;
44 line(x, y, x - dx * len, y);
45 line(x, y, x, y - dy * len);
55 line(-package_width/2 - dot_off, -package_height/2 - dot_off,
56 -package_width/2 - dot_off, -package_height/2 - dot_off);
61 return -1.5 * small_pad_x_sep + x * small_pad_x_sep;
66 return -small_pad_y_off + y * 2 * small_pad_y_off;
69 for (int y = 0; y < 2; y++) {
70 for (int x = 0; x < 4; x++) {
76 string name = sprintf("%d", pad);
77 pad_mm(small_x(x), small_y(y),
88 return -large_pad_x_sep / 2 + large_pad_x_sep * x;
93 return -large_pad_y_sep / 2 + large_pad_y_sep * y;
96 for (int y = 0; y < 2; y++) {
97 for (x = 0; x < 2; x++) {
103 string name = sprintf("%d", pad);
104 pad_mm(large_x(x), large_y(y),