Index: trunk/pcblib-param/so =================================================================== --- trunk/pcblib-param/so (nonexistent) +++ trunk/pcblib-param/so (revision 263) @@ -0,0 +1,20 @@ +#!/bin/sh + +#@@example dip(18) + +#@@purpose Generate classic DIP packages. + +#@@desc Generate SO packages with variable number of pins and +#@@desc row spacing +#@@params n, row_spacing, pad_spacing + +#@@param:n number of pins +#@@param:row_spacing spacing between the two rows of pads: distance between the end of the first and last pins (in mil, or in mm using the mm suffix; optional, default is 100 mil) +#@@param:pad_spacing spacing between the centerline of two pads (in mil, or in mm using the mm suffix; optional, default is 100 mil) +#@@param:ext_bloat how much longer the pad should extend outwards from the end-point of the pin (in mil, or in mm using the mm suffix; optional) +#@@param:int_bloat how much longer the pad should extend inwards from the end-point of the pin (in mil, or in mm using the mm suffix; optional) + +#@@include common.awk + +awk -f `dirname $0`/common.awk -f `dirname $0`/so.awk -v "args=$*" + Property changes on: trunk/pcblib-param/so ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: trunk/pcblib-param/so.awk =================================================================== --- trunk/pcblib-param/so.awk (nonexistent) +++ trunk/pcblib-param/so.awk (revision 263) @@ -0,0 +1,32 @@ +BEGIN { + proc_args(P, "n,row_spacing,pad_spacing,ext_bloat,int_bloat", "n") + + set_arg(P, "?row_spacing", 250) + set_arg(P, "?pad_spacing", 50) + set_arg(P, "?ext_bloat", 10) + set_arg(P, "?int_bloat", 55) + + if ((P["n"] < 2) || ((P["n"] % 2) != 0)) + error("Number of pins have to be an even positive number") + + row_spacing=parse_dim(P["row_spacing"]) + pad_spacing=parse_dim(P["pad_spacing"]) + ext_bloat=parse_dim(P["ext_bloat"]) + int_bloat=parse_dim(P["int_bloat"]) + + element_begin(P["n"] "*" P["row_spacing"] " DIP socket", "U1", P["n"] "*" P["row_spacing"] ,0,0, 0, mil(-100)) + + for(n = 1; n <= P["n"]/2; n++) { + y = (n-1) * pad_spacing + element_pad(-ext_bloat, y, int_bloat, y, pad_width, n, "square") + element_pad(row_spacing-int_bloat, y, row_spacing+ext_bloat, y, pad_width, P["n"] - n + 1, "square") + } + + silk_dist = pad_spacing/2 + rarc = pad_spacing/2 + + dip_outline(-silk_dist-ext_bloat, -silk_dist, row_spacing + silk_dist+ext_bloat , (n-2) * pad_spacing + silk_dist, rarc) + + + element_end() +}