Index: trunk/pcblib-param/connector =================================================================== --- trunk/pcblib-param/connector (revision 234) +++ trunk/pcblib-param/connector (revision 235) @@ -14,6 +14,8 @@ #@@param:ny number of pins in the Y direction (mandatory, no default) #@@param:spacing spacing between the pins (in mil, or in mm using the mm suffix; optional, default is 100 mil) #@@param:silkmark how to mark pin 1; values: square, external, angled, none (optional; default is square) +#@@param:eshift shift even rows or columns by half spacing; values: x (shift columns), y (shift rows) (optional; default: don't shift) +#@@param:etrunc truncate the last pin of a shifted row or column (optional boolean, defaults to false) awk -f `dirname $0`/common.awk -f `dirname $0`/connector.awk -v "args=$*" Index: trunk/pcblib-param/connector.awk =================================================================== --- trunk/pcblib-param/connector.awk (revision 234) +++ trunk/pcblib-param/connector.awk (revision 235) @@ -2,7 +2,7 @@ P["spacing"] = 100 P["silkmark"] = "square" - proc_args(P, "nx,ny,spacing,silkmark", "nx,ny") + proc_args(P, "nx,ny,spacing,silkmark,eshift,etrunc", "nx,ny") step=P["spacing"] @@ -19,17 +19,46 @@ if (pin_drill > pin_ringdia*0.9) pin_drill = pin_ringdia*0.9 - half=step/2 + eshift=tolower(P["eshift"]) + etrunc=tolower(P["etrunc"]) + if ((eshift != "x") && (eshift != "y") && (eshift != "")) + error("eshift must be x or y (got: ", eshift ")"); + element_begin(spacing " mil connector", "CONN1", P["nx"] "*" P["ny"] ,0,0, 0, -step) - for(x = 0; x < P["nx"]; x++) - for(y = 0; y < P["ny"]; y++) - element_pin(x * step, y * step) + for(x = 0; x < P["nx"]; x++) { + if ((eshift == "x") && ((x % 2) == 1)) + yo = step/2 + else + yo = 0 + for(y = 0; y < P["ny"]; y++) { + if ((eshift == "y") && ((y % 2) == 1)) { + xo = step/2 + if ((etrunc) && (x == P["nx"]-1)) + continue + } + else { + xo = 0 + if ((etrunc) && (y == P["ny"]-1) && (yo != 0)) + continue + } + element_pin(x * step + xo, y * step + yo) + } + } - element_rectangle(-half, -half, P["nx"] * step-half, P["ny"] * step-half) + xo = 0 + yo = 0 + if (!etrunc) { + if (eshift == "y") + xo = step/2 + if (eshift == "x") + yo = step/2 + } + element_rectangle(-half, -half, P["nx"] * step - half + xo, P["ny"] * step - half + yo) + if (P["silkmark"] == "angled") { element_line(0, -half, -half, 0) }