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";
21 real pin_spacing = 0.1 * 25.4;
22 real pin_hole = 0.038 * 25.4;
23 real pin_copper = 0.4;
27 int rows = atoi(argv[1]);
33 File::fprintf (stderr, "must have at least two rows\n");
37 int pins = rows * cols;
39 element_start(sprintf ("100mil%dx%d", rows, cols));
41 real col_off = (cols-1) * pin_spacing / 2.0;
42 real row_off = (rows-1) * pin_spacing / 2.0;
44 rect(-rows * pin_spacing / 2.0, -cols * pin_spacing / 2.0, rows * pin_spacing, cols * pin_spacing);
46 for (int row = 0; row < rows; row++)
47 for (int col = 0; col < cols; col++) {
48 int pin = row * cols + col;
49 pin_mm_options(row * pin_spacing - row_off, col_off - col * pin_spacing, pin_hole, pin_copper,
50 sprintf ("%d", pin + 1),
51 sprintf ("%d", pin + 1),
52 pin == 0 ? "square" : "");