2 * Copyright © 2012 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 pad_width = 0.55;
22 real corner_pad_width = 0.50;
23 real pad_height = 0.30;
25 /* Required clearance between corner pads on the diagonal */
26 real corner_diag_clearance = 0.21;
28 /* horizontal/vertical size of corner cut out */
29 #real corner_pad_notch = corner_diag_clearance / sqrt(2);
30 real corner_pad_notch = 0.15;
32 real corner_pad_minimum_height = pad_height - corner_pad_notch;
33 real corner_pad_minimum_width = corner_pad_width - corner_pad_notch;
35 real pad_spacing = 0.50;
37 /* outer location of pad */
39 real pad_x_off = (3.30 + 2 * 0.5) / 2;
40 real pad_y_off = (3.30 + 2 * 0.5) / 2;
42 real package_width = 4;
43 real package_height = 4;
45 real num_pad = 7; /* per side */
47 element_start("ufqfpn-28");
50 return pad_spacing * (n - (num_pad - 1) / 2);
53 real corner(int dx, int dy) {
54 real x = dx * package_width / 2;
55 real y = dy * package_height / 2;
58 line(x, y, x - dx * len, y);
59 line(x, y, x, y - dy * len);
71 line(-package_width/2 - dot_off, -package_height/2 - dot_off,
72 -package_width/2 - dot_off, -package_height/2 - dot_off);
74 for (int pad = 0; pad < num_pad; pad++) {
82 if (pad == 0 || pad == num_pad-1)
85 for (int s = 0; s <= nstep; s++) {
87 real pad_x, pad_y, pad_w, pad_h;
90 real ratio = s / nstep;
94 pad_y = -pad_height / 2 * (1-ratio) + ((-pad_height / 2) + corner_pad_notch) * ratio;
96 pad_y = -pad_height / 2;
98 pad_w = corner_pad_minimum_width * (1-ratio) + corner_pad_width * ratio;
100 pad_h = pad_height * (1 - ratio) + corner_pad_minimum_height * ratio;
102 /* Make sure we don't violate the process minimums */
103 if (pad_h < process_trace)
104 pad_h = process_trace;
108 pad_y = -pad_height / 2;
114 pad_mm(-pad_x_off + pad_x + pad_w / 2,
115 pad_off(pad) + pad_y + pad_h / 2,
118 sprintf("%d", pad + 1),
119 sprintf("%d", pad + 1));
123 pad_mm(pad_off(pad) + pad_y + pad_h / 2,
124 pad_y_off + pad_x - pad_w / 2,
127 sprintf("%d", pad + 8),
128 sprintf("%d", pad + 8));
130 /* right side (15-21) */
132 pad_mm(pad_x_off - pad_x - pad_w / 2,
133 -pad_off(pad) - pad_y - pad_h / 2,
136 sprintf("%d", pad + 15),
137 sprintf("%d", pad + 15));
141 pad_mm(-pad_off(pad) - pad_y - pad_h / 2,
142 -pad_y_off - pad_x + pad_w / 2,
145 sprintf("%d", pad + 22),
146 sprintf("%d", pad + 22));