2 * Copyright © 2016 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.
23 real pixtomm(real pix) = pix / dpi * 25.4;
33 real xmm(real xpix) = pixtomm(xpix - origin_x);
34 real ymm(real ypix) = pixtomm(ypix - origin_y);
36 pos_t pos(real xpix, real ypix) = (pos_t) { .x = xmm(xpix), .y = ymm(ypix) };
38 pos_t ul = pos(543, 213);
39 pos_t ur = pos(2912, 213);
40 pos_t mll = pos(423, 1036);
41 pos_t mlr = pos(543, 1036);
42 pos_t mrl = pos(2912, 1036);
43 pos_t mrr = pos(3980, 1036);
44 pos_t ll = pos(423, 1955);
45 pos_t lr = pos(3980, 1955);
47 pos_t mount_ul = pos(781, 208);
48 pos_t mount_ur = pos(2102, 208);
50 pos_t mount_ll = pos(652, 1999);
51 pos_t mount_lr = pos(3561, 1999);
53 real mounting_hole = pixtomm(142);
55 void linepos(pos_t a, pos_t b) { line(a.x, a.y, b.x, b.y); }
69 pin_mm_clear(a.x, a.y, mounting_hole, 0.22, 0.32, "mount", "mount");
79 real ysplit = ymm(1500);
80 real ygap = pixtomm(1536 - 1442);
82 void contact(pos_t ul, pos_t lr, string name, string num) {
83 pad_mm((ul.x + lr.x) / 2,
90 void top_contact(real x, real width, string name, string num) {
91 contact((pos_t) { .x = x, .y = mll.y },
92 (pos_t) { .x = x + width, .y = ysplit - ygap / 2 },
96 real contact_left = xmm(563 + 2909 - 2667);
97 real contact_right = xmm(2922);
98 real contact_width = pixtomm(3267 - 2901);
100 void bottom_contact(real x, real width, string name, string num) {
101 contact((pos_t) { .x = x, .y = ysplit + ygap / 2 },
102 (pos_t) { .x = x + width, .y = ll.y },
106 element_start("servo");
111 bottom_contact(contact_left, contact_width, "1", "1");
112 bottom_contact(contact_right, contact_width, "2", "2");
114 top_contact(contact_left, contact_width, "3", "3");
115 top_contact(contact_right, contact_width, "4", "4");