2 * Copyright © 2020 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 Footprint::process_soldermask = 0.05;
23 real pad_outside = 0.15;
24 real pad_width = 0.70;
25 real corner_pad_width = 0.50;
26 real corner_pad_height = 0.30;
27 real pad_height = 0.30;
29 /* Required clearance between corner pads on the diagonal */
30 real corner_diag_clearance = 0.40;
32 /* horizontal/vertical size of corner cut out */
33 #real corner_pad_notch = corner_diag_clearance / sqrt(2);
34 real corner_pad_notch = 0.125;
36 real corner_pad_minimum_height = pad_height - corner_pad_notch;
37 real corner_pad_minimum_width = corner_pad_width - corner_pad_notch;
39 real pad_spacing = 0.50;
41 real package_width = 3;
42 real package_height = 3;
44 /* outer location of pad */
46 real pad_x_off = (package_width/2 + pad_outside);
47 real pad_y_off = (package_height/2 + pad_outside);
49 real num_pad = 5; /* per side */
51 element_start("ufqfpn-20");
54 return pad_spacing * (n - (num_pad - 1) / 2);
57 real corner(int dx, int dy) {
58 real x = dx * package_width / 2;
59 real y = dy * package_height / 2;
62 line(x, y, x - dx * len, y);
63 line(x, y, x, y - dy * len);
75 line(-package_width/2 - dot_off, -package_height/2 - dot_off,
76 -package_width/2 - dot_off, -package_height/2 - dot_off);
78 /* rect(-package_width/2, -package_width/2, package_width, package_width); */
80 for (int pad = 0; pad < num_pad; pad++) {
88 if (pad == 0 || pad == num_pad-1)
91 for (int s = 0; s <= nstep; s++) {
93 real pad_x, pad_y, pad_w, pad_h;
96 real ratio_a = s / nstep;
97 real ratio_b = 1 - ratio_a;
101 pad_y = -pad_height / 2 * ratio_b + ((-pad_height / 2) + corner_pad_notch) * ratio_a;
103 pad_y = -pad_height / 2;
105 pad_w = corner_pad_minimum_width * ratio_b + corner_pad_width * ratio_a;
107 pad_h = pad_height * ratio_b + corner_pad_minimum_height * ratio_a;
109 /* Make sure we don't violate the process minimums */
110 if (pad_h < process_trace)
111 pad_h = process_trace;
115 pad_y = -pad_height / 2;
121 pad_mm(-pad_x_off + pad_x + pad_w / 2,
122 pad_off(pad) + pad_y + pad_h / 2,
125 sprintf("%d", pad + 1),
126 sprintf("%d", pad + 1));
130 pad_mm(pad_off(pad) + pad_y + pad_h / 2,
131 pad_y_off + pad_x - pad_w / 2,
134 sprintf("%d", pad + num_pad + 1),
135 sprintf("%d", pad + num_pad + 1));
137 /* right side (13-18) */
139 pad_mm(pad_x_off - pad_x - pad_w / 2,
140 -pad_off(pad) - pad_y - pad_h / 2,
143 sprintf("%d", pad + num_pad * 2 + 1),
144 sprintf("%d", pad + num_pad * 2 + 1));
148 pad_mm(-pad_off(pad) - pad_y - pad_h / 2,
149 -pad_y_off - pad_x + pad_w / 2,
152 sprintf("%d", pad + num_pad * 3 + 1),
153 sprintf("%d", pad + num_pad * 3 + 1));