#!/bin/sh

#@@example connector(2, 3, silkmark=external, spacing=100)

#@@purpose Generate pin-array connectors (e.g. headers).

#@@desc Generate thru-hole connectors that consits of an array of
#@@desc evenly spaced pins, a plain frame and some optional pin marks
#@@desc on the silk layer.

#@@params nx, ny, spacing, silkmark, eshift, etrunc

#@@param:nx number of pins in the X direction
#@@param:ny number of pins in the Y direction
#@@param:spacing spacing between the pins
#@@dim:spacing
#@@default:spacing 100 mil

#@@include silkmark.help
#@@optional:silkmark
#@@default:silkmark square
#@@preview_args:silkmark 2,3

#@@param:eshift shift even rows or columns by half spacing (optional; default: don't shift)
#@@enum:eshift:x shift columns
#@@enum:eshift:y shift rows
#@@enum:eshift:none do not shift anything
#@@default:eshift none
#@@optional:eshift
#@@preview_args:eshift 2,3

#@@param:etrunc truncate the last pin of a shifted row or column
#@@bool:etrunc
#@@default:etrunc false
#@@optional:etrunc
#@@preview_args:etrunc 2,3,eshift=x

#@@param:sequence pin numbering sequence
#@@enum:sequence:normal increase by y first, then by x
#@@enum:sequence:pivot increase by x first, then by y
#@@enum:sequence:zigzag "dip-style" numbering in zig-zag: number odd x rows by y ascending, even x rows by y descending
#@@preview_args:sequence 2,4
#@@thumbsize:sequence 3
#@@thumbnum:sequence 1
#@@default:sequence normal
#@@optional:sequence

#@@param:3dshroud draw shroud (bracket) around the header on the 3d model
#@@bool:3dshroud
#@@optional:3dshroud
#@@default:3dshroud 0

#@@param:3dfemale draw female version of the 3d model
#@@bool:3dfemale
#@@optional:3dfemale
#@@default:3dfemale 0

#@@param:3dangle if set, generate 90 degree bent 3d model
#@@bool:3dfemale
#@@optional:3dangle
#@@default:3dangle 0

#@@param:3delevation z-height or thickness of the body of the 3d model
#@@optional:3delevation
#@@default:3delevation 8.8



#@@include common_subc.awk

awk -f `dirname $0`/common_subc.awk -f `dirname $0`/connector.awk -v "args=$*" -v gen=`basename $0` -v "genfull=$0"

