Update "missing" (automake) script to a later version
[geda-pcb/pcjc2.git] / lib / bourns.inc
blob23eee32923c1b7db96e8edfa726253020b04a6bc
1 # -*- m4 -*-
3 #                            COPYRIGHT
5 #   PCB, interactive printed circuit board design
6 #   Copyright (C) 2003, 2005 Dan McMahill
8 #   This program is free software; you can redistribute it and/or modify
9 #   it under the terms of the GNU General Public License as published by
10 #   the Free Software Foundation; either version 2 of the License, or
11 #   (at your option) any later version.
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
24 #  Bourns Specific Footprints
27 # Surface mount trim pots, such as the 3224 series.
29 # $1: canonical name
30 # $2: name on PCB
31 # $3: value
32 # $4: pin 1,3 width (1/100 mm)     width is in the direction parallel to the
33 # $5: pin 1,3 length (1/100 mm)    line which intersects pins 1 and 3
34 # $6: pin 2 width (1/100 mm)
35 # $7: pin 2 length (1/100 mm)
36 # $8: spacing from pad center to pad center between 2 and 1,3 (1/100 mm)
37 # $9: spacing from pad center to pad center between 1 and 3 (1/100 mm)
38 # $10: package width (1/100 mm)
40 define(`PKG_BOURNS_GENERIC_POT',
41        `
42         # pin 1,3 width, length (1/100 mm)
43         define(`W13',  `$4')
44         define(`L13',  `$5')
46         # pin 2 width, length (1/100 mm)
47         define(`W2',  `$6')
48         define(`L2',  `$7')
50         # spacing from pad center to pad center between 2 and 1,3 (1/100 mm)
51         define(`S12', `$8')
52         # spacing from pad center to pad center between 1 and 3 (1/100 mm)
53         define(`S13', `$9')
54         
55         # package width (1/100 mm)
56         define(`WIDTH', `$10')
58         # silkscreen width (mils)
59         define(`SILKW', `10')
61         # how much space to leave around the part before the
62         # silk screen (mils)
63         define(`SILKS', `8')
64         # lower right corner for silk screen (mil)
65         ifelse(eval(L2 > L13), 1
66                 define(`SILKX', `eval((S12+L2)*50/254 + SILKS + SILKW/2)'),
67                 define(`SILKX', `eval((S12+L13)*50/254 + SILKS + SILKW/2)')
68         )
69         define(`SILKY', `eval((WIDTH/2)*100/254 + SILKS + SILKW/2)')
71         # refdes text size (mil)
72         define(`TEXTSIZE', 100)
73         # x,y coordinates for refdes label (mil)
74         define(`TEXTX', -SILKX)
75         define(`TEXTY', `eval(-SILKY - 10 - TEXTSIZE/2)')
77 Element(0x00 "$1" "`$2'" "$3" TEXTX TEXTY 0 TEXTSIZE 0x00)
80 # pin 1
81 ifelse(0, eval(W13>L13),
82         # Pads which have the perpendicular pad dimension less
83         # than or equal to the parallel pad dimension   
84         Pad(eval( (S12 - L13 + W13)*50/254) eval( S13*50/254) 
85             eval( (S12 + L13 - W13)*50/254) eval( S13*50/254) eval(W13*100/254) "1" 0x100)
86         ,
87         # Pads which have the perpendicular pad dimension greater
88         # than or equal to the parallel pad dimension 
89         Pad(eval( (S12 + L13)*50/254) eval((-S13 - W13 + L13)*50/254)
90             eval( (S12 + L13)*50/254) eval((-S13 + W13 - L13)*50/254) eval(L13*100/254) "1" 0x100)
91         )
93 # pin 2
94 ifelse(0, eval(W2>L2),
95         # Pads which have the perpendicular pad dimension less
96         # than or equal to the parallel pad dimension   
97         Pad(eval( (-S12 - L2 + W2)*50/254) 0 
98             eval( (-S12 + L2 - W2)*50/254) 0 eval(W2*100/254) "2" 0x100)
99         ,
100         # Pads which have the Y (width) pad dimension greater
101         # than or equal to the X (length) pad dimension 
102         Pad(eval( -S12*50/254) eval((- W2 + L2)*50/254)
103             eval( -S12*50/254) eval((  W2 - L2)*50/254) eval(L2*100/254) "2" 0x100)
104         )
106 # pin 3
107 ifelse(0, eval(W13>L13),
108         # Pads which have the perpendicular pad dimension less
109         # than or equal to the parallel pad dimension   
110         Pad(eval( (S12 - L13 + W13)*50/254) eval(-S13*50/254) 
111             eval( (S12 + L13 - W13)*50/254) eval(-S13*50/254) eval(W13*100/254) "3" 0x100)
112         ,
113         # Pads which have the perpendicular pad dimension greater
114         # than or equal to the parallel pad dimension 
115         Pad(eval( (S12 + L13)*50/254) eval((-S13 - W13 + L13)*50/254)
116             eval( (S12 + L13)*50/254) eval((-S13 + W13 - L13)*50/254) eval(L13*100/254) "3" 0x100)
117         )
119 # Silk screen around package
120 ElementLine( SILKX  SILKY  SILKX -SILKY SILKW)
121 ElementLine( SILKX -SILKY -SILKX -SILKY SILKW)
122 ElementLine(-SILKX -SILKY -SILKX  SILKY SILKW)
123 ElementLine(-SILKX  SILKY  SILKX  SILKY SILKW)
125 # Mark at the center of the part
126 Mark(0 0)
129 # -------------------------------------------------------------------
131 # EXTRACT_BEGIN
135 ##  Bourns 3224 Series SMT Trim Pot
138 define(`PKG_BOURNS_3224G',  `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3',
139         `127', `127', `200', `127', `520', `230', `480')')
140 define(`PKG_BOURNS_3224J',  `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3',
141         `130', `200', `200', `200', `400', `230', `480')')
142 define(`PKG_BOURNS_3224W',  `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3',
143         `130', `160', `200', `160', `290', `254', `480')')
144 define(`PKG_BOURNS_3224X',  `PKG_BOURNS_GENERIC_POT(`$1',`$2',`$3',
145         `132', `190', `200', `190', `510', `254', `480')')
147 # EXTRACT_END