2 * Copyright © 2013 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.
22 * These values come from the Carsem MLP spec */
23 real pad_outside = 0.20;
24 real pad_inside = 0.05;
25 real pad_side = 0.025; /* for pad pitch > 0.65mm */
27 real pad_width = 0.30;
28 real pad_height = 0.60;
29 real pad_spacing = 0.80;
31 real package_width = 4;
32 real package_height = 3;
34 real pad_y_off = package_height / 2;
36 real num_pad = 4; /* per side */
38 element_start("mlp8");
40 real pad_off_x(int n) {
41 return pad_spacing * (n - (num_pad - 1) / 2);
44 real corner(int dx, int dy) {
45 real x = dx * package_width / 2;
46 real y = dy * package_height / 2;
49 line(x, y, x - dx * len, y);
50 line(x, y, x, y - dy * len);
53 real pad_top(real x, real y, int n) {
54 real w_pad = pad_width + pad_side * 2;
55 real h_pad = pad_height + pad_outside + pad_inside;
57 real y_pad = y + pad_outside - h_pad/2;
59 pad_mm(x_pad, y_pad, w_pad, h_pad, sprintf("%d", n), sprintf("%d", n));
62 real pad_bottom(real x, real y, int n) {
63 real w_pad = pad_width + pad_side * 2;
64 real h_pad = pad_height + pad_outside + pad_inside;
66 real y_pad = y - pad_outside + h_pad/2;
68 pad_mm(x_pad, y_pad, w_pad, h_pad, sprintf("%d", n), sprintf("%d", n));
78 line(-package_width/2 + dot_off, package_height/2 - dot_off,
79 -package_width/2 + dot_off, package_height/2 - dot_off);
81 for (int pad = 0; pad < num_pad; pad++) {
84 pad_top (pad_off_x(pad), package_height / 2, pad + 1);
88 pad_bottom (pad_off_x(pad), -package_height / 2, 8 - pad);