Speed up unsubtraction from polygons when objects are deleted
[geda-pcb/gde.git] / lib / candk.inc
blob94e59b9f74d13e366a79596a868d08882edb5b43
1 # -*- m4 -*-
3 # $Id$
4 #                            COPYRIGHT
6 #   PCB, interactive printed circuit board design
7 #   Copyright (C) 2007 Dan McMahill
9 #   This program is free software; you can redistribute it and/or modify
10 #   it under the terms of the GNU General Public License as published by
11 #   the Free Software Foundation; version 2 of the License.
12
13 #   This program is distributed in the hope that it will be useful,
14 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #   GNU General Public License for more details.
17
18 #   You should have received a copy of the GNU General Public License
19 #   along with this program; if not, write to the Free Software
20 #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22 #   The symbols produced by this file may be used and redistributed 
23 #   without restriction as part of a PCB layout file.  Distribution 
24 #   of footprints produced by this file as part of a footprint
25 #   library is governed by the same license as this source file.
28 #  C&K Specific Footprints
31 # ES series surface mount switches
33 # $1: canonical name
34 # $2: name on PCB
35 # $3: value
37 define(`PKG_CANDK_ES_SMT_SWITCH',
38        `
39         # pad 1,2,3 width (1/100 mil)
40         define(`PADW1',  `3500')
42         # pad 1,2,3 length (1/100 mil)
43         define(`PADL1',  `8200')
45         # x value for pads 1,3 (1/100 mil)
46         define(`PADX1', `10000')
47         
48         # y value for pads 1,2,3 (1/100 mil)
49         define(`PADY1', `17500')
50         define(`PADY1A', `eval(PADY1 - (PADL1 - PADW1)/2)')
51         define(`PADY1B', `eval(PADY1 + (PADL1 - PADW1)/2)')
54         # mounting pad width (1/100 mil)
55         define(`PADW2',  `9150')
57         # mounting pad length (1/100 mil)
58         define(`PADL2',  `6000')
60         # x value for the mounting pads (1/100 mil)
61         define(`PADX2', `21175')
62         define(`PADX2A', `eval(PADX2 - (PADW2 - PADL2)/2)')
63         define(`PADX2B', `eval(PADX2 + (PADW2 - PADL2)/2)')
64         
65         # y value for the mounting pads (1/100 mil)
66         define(`PADY2', `-17500')
68         # package width (1/100 mil)
69         define(`PACKW', `39500')
71         # package height (1/100 mil)
72         define(`PACKH', `36000')
74         # component veritcal height off board (1/100 mil)
75         define(`COMPH', `eval($9*10000/254)')
77         # pad width and length
78         define(`PADW', `eval(PINW + 2000)')
79         define(`PADL', `eval(PINL + 2000)')
81         # y values for drawing the pad.  
82         # The Y center of the pad is 0.5*(PINL + PINS)
83         # we need a line segment of length PADL - PADW so we have end points:
84         # 0.5*(PINL + PINS) +/- 0.5*(PADL - PADW)
85         define(`PY1', `eval((PINL + PINS + PADL - PADW)/2)')
86         define(`PY2', `eval((PINL + PINS - PADL + PADW)/2)')
88         # width of soldermask relief (5 mil on each side)
89         define(`MASKW1', `eval(PADW1 + 1000)')
90         define(`MASKW2', `eval(PADL2 + 1000)')
92         # top edge of switch body (1/100 mil)
93         define(`SWTOP', `eval(PADY2 - 5000)')
95         # bottom edge of switch body (1/100 mil)
96         define(`SWBOT', `eval(SWTOP + PACKH)')
98         # how much the switch extends beyond the body
99         define(`SWEXT', `12100')
101         # y value for the far end of the switch
102         define(`SWYMAX', `eval(SWTOP - SWEXT)')
104         # silkscreen width (1/100 mils)
105         define(`SILKW', `1000')
107         # how much space to leave around the part before the
108         # silk screen (1/100 mils)
109         define(`SILKS', `800')
111         # X values for silk on sides and bottom of switch
112         define(`SX1', `eval( (PACKW + 2*SILKS + SILKW)/2)')
113         define(`SX2', `eval( 10000 + PADW1/2 + SILKS + SILKW/2)')
115         # bottom edge of the switch body
116         define(`SY1', `eval( SWBOT + SILKS + SILKW/2 )')
118         # bottom edge of upper pads
119         define(`SY2', `eval( PADY2 + PADL2/2 + SILKS + SILKW/2)')
121         # bottom edge of the lower pads
122         define(`SY3', `eval( PADY1 + PADL1/2 + SILKS + SILKW/2)')
124         # top edge of the switch body
125         define(`SY4', `eval( PADY2 - PADL2/2 - SILKS - SILKW/2)')
127         # top edge of the switch 
128         define(`SY5', `eval( SWTOP - SILKS - SILKW/2)')
131 # Element [SFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TSFlags]
132 Element[ "" "`$1'" "`$2'" "`$3'" 0 0 0 0 0 100 ""]
135 # Pad [rX1 rY1 rX2 rY2 Thickness Clearance Mask "Name" "Number" SFlags]
137 # the signal pads
138 Pad[ -PADX1 PADY1A -PADX1 PADY1B PADW1 1000 MASKW1 "1"  "1" "square"]
139 Pad[      0 PADY1A      0 PADY1B PADW1 1000 MASKW1 "2"  "2" "square"]
140 Pad[  PADX1 PADY1A  PADX1 PADY1B PADW1 1000 MASKW1 "3"  "3" "square"]
142 # the mounting pads
143 Pad[ -PADX2A PADY2 -PADX2B PADY2 PADL2 1000 MASKW2 "4"  "4" "square"]
144 Pad[  PADX2A PADY2  PADX2B PADY2 PADL2 1000 MASKW2 "4"  "4" "square"]
146 # Silk screen around package
147 # ElementLine[ x1 y1 x2 y2 width]
149 # bottom edge
150 ElementLine[ SX1 SY1  SX2 SY1 SILKW ]
151 ElementLine[-SX1 SY1 -SX2 SY1 SILKW ]
152 ElementLine[-SX2 SY1 -SX2 SY3 SILKW ]
153 ElementLine[ SX2 SY1  SX2 SY3 SILKW ]
154 ElementLine[-SX2 SY3  SX2 SY3 SILKW ]
156 # left/right
157 ElementLine[ SX1 SY1  SX1 SY2 SILKW ]
158 ElementLine[-SX1 SY1 -SX1 SY2 SILKW ]
160 # top edge
161 ElementLine[-SX1 SWYMAX  SX1 SWYMAX SILKW ]
162 ElementLine[-SX1 SY5     SX1 SY5    SILKW ]
163 ElementLine[-SX1 SY4    -SX1 SWYMAX SILKW ]
164 ElementLine[ SX1 SY4     SX1 SWYMAX SILKW ]
166 # cross at top where switch moves
167 ElementLine[-SX1 SWYMAX  SX1 SY5    SILKW ]
168 ElementLine[-SX1 SY5     SX1 SWYMAX SILKW ]
172 # -------------------------------------------------------------------
174 # EXTRACT_BEGIN
178 ##  C&K ES Series Switches
181 # See www.ittcannon.com.
183 define(`PKG_CANDK_ES01MSABE', `PKG_CANDK_ES_SMT_SWITCH(`$1', `$2', `$3')')
184 define(`PKG_CANDK_ES02MSABE', `PKG_CANDK_ES_SMT_SWITCH(`$1', `$2', `$3')')
185 define(`PKG_CANDK_ES03MSABE', `PKG_CANDK_ES_SMT_SWITCH(`$1', `$2', `$3')')
189 # EXTRACT_END