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 package_width = 3; /* B */
22 package_height = 1.93; /* C */
24 cathode_width = 2.20; /* X1 */
25 cathode_height = 1.4; /* Y2 */
26 anode_width = 0.9; /* X2 */
27 anode_height = 1.4; /* Y1 */
29 spacing = 1.0; /* G */
31 total_width = cathode_width + spacing + anode_width;
33 cathode_center_x = (total_width / 2 - cathode_width / 2);
34 anode_center_x = -(total_width / 2 - anode_width / 2);
36 element_start("powerdi123");
38 pad_mm(cathode_center_x, 0, cathode_width, cathode_height, "cathode", "2");
40 pad_mm(anode_center_x, 0, anode_width, anode_height, "anode", "1");
42 rect(-package_width/2, -package_height/2, package_width, package_height);
44 line_x = total_width /2 + cathode_height / 3;
45 line_height = package_height;
46 line_width = package_height / 4;
48 line(line_x - line_width, -line_height/2, line_x, -line_height/2);
49 line(line_x, -line_height/2, line_x, line_height/2);
50 line(line_x, line_height/2, line_x - line_width, line_height/2);