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.
18 load "../footprint.5c"
25 real pin_even_off = 9;
27 real package_left = 3.18;
28 real package_right = 3.18;
29 real package_top = 2.1;
30 real package_bottom = 15.85 - package_top;
32 real pin_diameter = 1.3;
33 real pin_spacing = 6.35;
34 real pin_copper = 1.5;
36 real package_width = package_left + (pins - 1) * pin_spacing + package_right;
37 real package_height = package_top + package_bottom;
40 return (pin - 1) * pin_spacing;
44 return ((pin & 1) == 0) ? pin_even_off : pin_odd_off;
47 element_start(sprintf("MKDS-5N-HV-%d", pins));
49 for (int pin = 1; pin <= pins; pin++) {
53 pin_mm_options(pin_x(pin), pin_y(pin), pin_diameter, pin_copper,
54 sprintf("%d", pin), sprintf("%d", pin), options);
57 rect(-package_left, -package_top, package_width, package_height);
65 printf("usage: %s <pins>\n", argv[0]);
69 if (pins <= 0 || pins > 32) {
70 printf("Invalid pins: %d\n", pins);