Add ghid_route_style_selector_empty to GHidRouteStyleSelector
[geda-pcb/whiteaudio.git] / lib / bourns.inc
blob0ebc298312a310cc27c3272ab97c8093ca320efd
1 # -*- m4 -*-
3 # $Id$
4 #                            COPYRIGHT
6 #   PCB, interactive printed circuit board design
7 #   Copyright (C) 2003, 2005 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; either version 2 of the License, or
12 #   (at your option) any later version.
13
14 #   This program is distributed in the hope that it will be useful,
15 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
16 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 #   GNU General Public License for more details.
18
19 #   You should have received a copy of the GNU General Public License
20 #   along with this program; if not, write to the Free Software
21 #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23
25 #  Bourns Specific Footprints
28 # Surface mount trim pots, such as the 3224 series.
30 # $1: canonical name
31 # $2: name on PCB
32 # $3: value
33 # $4: pin 1,3 width (1/100 mm)     width is in the direction parallel to the
34 # $5: pin 1,3 length (1/100 mm)    line which intersects pins 1 and 3
35 # $6: pin 2 width (1/100 mm)
36 # $7: pin 2 length (1/100 mm)
37 # $8: spacing from pad center to pad center between 2 and 1,3 (1/100 mm)
38 # $9: spacing from pad center to pad center between 1 and 3 (1/100 mm)
39 # $10: package width (1/100 mm)
41 define(`PKG_BOURNS_GENERIC_POT',
42        `
43         # pin 1,3 width, length (1/100 mm)
44         define(`W13',  `$4')
45         define(`L13',  `$5')
47         # pin 2 width, length (1/100 mm)
48         define(`W2',  `$6')
49         define(`L2',  `$7')
51         # spacing from pad center to pad center between 2 and 1,3 (1/100 mm)
52         define(`S12', `$8')
53         # spacing from pad center to pad center between 1 and 3 (1/100 mm)
54         define(`S13', `$9')
55         
56         # package width (1/100 mm)
57         define(`WIDTH', `$10')
59         # silkscreen width (mils)
60         define(`SILKW', `10')
62         # how much space to leave around the part before the
63         # silk screen (mils)
64         define(`SILKS', `8')
65         # lower right corner for silk screen (mil)
66         ifelse(eval(L2 > L13), 1
67                 define(`SILKX', `eval((S12+L2)*50/254 + SILKS + SILKW/2)'),
68                 define(`SILKX', `eval((S12+L13)*50/254 + SILKS + SILKW/2)')
69         )
70         define(`SILKY', `eval((WIDTH/2)*100/254 + SILKS + SILKW/2)')
72         # refdes text size (mil)
73         define(`TEXTSIZE', 100)
74         # x,y coordinates for refdes label (mil)
75         define(`TEXTX', -SILKX)
76         define(`TEXTY', `eval(-SILKY - 10 - TEXTSIZE/2)')
78 Element(0x00 "$1" "`$2'" "$3" TEXTX TEXTY 0 TEXTSIZE 0x00)
81 # pin 1
82 ifelse(0, eval(W13>L13),
83         # Pads which have the perpendicular pad dimension less
84         # than or equal to the parallel pad dimension   
85         Pad(eval( (S12 - L13 + W13)*50/254) eval( S13*50/254) 
86             eval( (S12 + L13 - W13)*50/254) eval( S13*50/254) eval(W13*100/254) "1" 0x100)
87         ,
88         # Pads which have the perpendicular pad dimension greater
89         # than or equal to the parallel pad dimension 
90         Pad(eval( (S12 + L13)*50/254) eval((-S13 - W13 + L13)*50/254)
91             eval( (S12 + L13)*50/254) eval((-S13 + W13 - L13)*50/254) eval(L13*100/254) "1" 0x100)
92         )
94 # pin 2
95 ifelse(0, eval(W2>L2),
96         # Pads which have the perpendicular pad dimension less
97         # than or equal to the parallel pad dimension   
98         Pad(eval( (-S12 - L2 + W2)*50/254) 0 
99             eval( (-S12 + L2 - W2)*50/254) 0 eval(W2*100/254) "2" 0x100)
100         ,
101         # Pads which have the Y (width) pad dimension greater
102         # than or equal to the X (length) pad dimension 
103         Pad(eval( -S12*50/254) eval((- W2 + L2)*50/254)
104             eval( -S12*50/254) eval((  W2 - L2)*50/254) eval(L2*100/254) "2" 0x100)
105         )
107 # pin 3
108 ifelse(0, eval(W13>L13),
109         # Pads which have the perpendicular pad dimension less
110         # than or equal to the parallel pad dimension   
111         Pad(eval( (S12 - L13 + W13)*50/254) eval(-S13*50/254) 
112             eval( (S12 + L13 - W13)*50/254) eval(-S13*50/254) eval(W13*100/254) "3" 0x100)
113         ,
114         # Pads which have the perpendicular pad dimension greater
115         # than or equal to the parallel pad dimension 
116         Pad(eval( (S12 + L13)*50/254) eval((-S13 - W13 + L13)*50/254)
117             eval( (S12 + L13)*50/254) eval((-S13 + W13 - L13)*50/254) eval(L13*100/254) "3" 0x100)
118         )
120 # Silk screen around package
121 ElementLine( SILKX  SILKY  SILKX -SILKY SILKW)
122 ElementLine( SILKX -SILKY -SILKX -SILKY SILKW)
123 ElementLine(-SILKX -SILKY -SILKX  SILKY SILKW)
124 ElementLine(-SILKX  SILKY  SILKX  SILKY SILKW)
126 # Mark at the center of the part
127 Mark(0 0)
130 # -------------------------------------------------------------------
132 # EXTRACT_BEGIN
136 ##  Bourns 3224 Series SMT Trim Pot
139 define(`PKG_BOURNS_3224G',  `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3',
140         `127', `127', `200', `127', `520', `230', `480')')
141 define(`PKG_BOURNS_3224J',  `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3',
142         `130', `200', `200', `200', `400', `230', `480')')
143 define(`PKG_BOURNS_3224W',  `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3',
144         `130', `160', `200', `160', `290', `254', `480')')
145 define(`PKG_BOURNS_3224X',  `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3',
146         `132', `190', `200', `190', `510', `254', `480')')
148 # EXTRACT_END