Add NHD-C12864LZ
[hw/altusmetrum] / packages / diodes / powerdi123.5c
1 /*
2  * Copyright © 2013 Keith Packard <keithp@keithp.com>
3  *
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.
7  *
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.
12  *
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.
16  */
17
18 load "../footprint.5c"
19 import Footprint;
20
21 package_width = 3;              /* B */
22 package_height = 1.93;          /* C */
23
24 cathode_width = 2.20;           /* X1 */
25 cathode_height = 1.4;           /* Y2 */
26 anode_width = 0.9;              /* X2 */
27 anode_height = 1.4;             /* Y1 */
28
29 spacing = 1.0;                  /* G */
30
31 total_width = cathode_width + spacing + anode_width;
32
33 cathode_center_x = (total_width / 2 - cathode_width / 2);
34 anode_center_x = -(total_width / 2 - anode_width / 2);
35
36 element_start("powerdi123");
37
38 pad_mm(cathode_center_x, 0, cathode_width, cathode_height, "cathode", "2");
39
40 pad_mm(anode_center_x, 0, anode_width, anode_height, "anode", "1");
41
42 rect(-package_width/2, -package_height/2, package_width, package_height);
43
44 line_x = total_width /2 + cathode_height / 3;
45 line_height = package_height;
46 line_width = package_height / 4;
47
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);
51
52 element_end();