Index: pcblib/parametric/acy =================================================================== --- pcblib/parametric/acy (revision 362) +++ pcblib/parametric/acy (revision 363) @@ -5,12 +5,15 @@ #@@purpose Generate axial lead tru-hole component #@@desc Generate axial lead tru-hole component with 2 pins (typical use: resistor) -#@@params spacing,pol,dia +#@@params spacing,type,pol,dia #@@param:spacing spacing between the two pins -#@@param:pol how to mark polarity: none, sign, bar (optional; default: do not mark polarity) +#@@param:type silk symbol type: block, coil, core, core2, zigzag, line (optinal; default: block) +#@@param:pol how to mark polarity: none, sign, bar, dot (optional; default: do not mark polarity) #@@param:dia body diameter - affects the silk rectangle (optional; default: spacing/12) +#@@param:wiper silk symbol wiper type: none, parrow, aarrow, looparrow thermistor (optinal; default: none) + #@@include common.awk awk -f `dirname $0`/common.awk -f `dirname $0`/acy.awk -v "args=$*" Index: pcblib/parametric/acy.awk =================================================================== --- pcblib/parametric/acy.awk (revision 362) +++ pcblib/parametric/acy.awk (revision 363) @@ -1,6 +1,23 @@ +function wave(type, repeat, step,x,y) +{ + step = len/repeat + for(x = sx1; x < sx2; x += step) { + if (type == 1) { + element_arc(x+step/2, 0, step/2, step/2, 0, -180) + } + else if (type == 2) { + y = dia + element_line(x, 0, x+step/4, -y) + element_line(x+step/4, -y, x+3*step/4, y) + element_line(x+3*step/4, y, x+step, 0) + + } + } +} + BEGIN { - - proc_args(P, "spacing,pol,dia", "spacing") + set_arg(P, "?type", "block") + proc_args(P, "spacing,type,pol,dia", "spacing") spacing = parse_dim(P["spacing"]) dia = either(parse_dim(P["dia"]), spacing/12) @@ -12,11 +29,71 @@ element_pin(-spacing/2, 0, 1) element_pin(+spacing/2, 0, 2) -# silk rectangle and pins - element_rectangle(-spacing/4, -dia, +spacing/4, +dia) - element_line(-spacing/2, 0, -spacing/4, 0) - element_line(+spacing/4, 0, +spacing/2, 0) +# silk pins + if (P["type"] != "line") { + element_line(-spacing/2, 0, -spacing/4, 0) + element_line(+spacing/4, 0, +spacing/2, 0) + } +# silk symbol + sx1 = -spacing/4 + sx2 = +spacing/4 + len = sx2-sx1 + if (P["type"] == "block") { + element_rectangle(sx1, -dia, sx2, +dia) + } + else if (P["type"] == "zigzag") { + wave(2, 3) + } + else if (P["type"] == "coil") { + wave(1, 4) + } + else if (P["type"] ~ "^core") { + wave(1, 4) + nlines = P["type"] + sub("^core", "", nlines) + if (nlines == "") + nlines = 1 + + cdist = 3 * DEFAULT["line_thickness"] + y = -len/8 + for(nlines = int(nlines); nlines > 0; nlines--) { + y-=cdist + element_line(sx1, y, sx2, y) + } + } + else if (P["type"] == "line") { + element_line(-spacing/2, 0, +spacing/2, 0) + } + else { + error("Invalid type") + } + +# silk wiper + if (P["wiper"] == "thermistor") { + x = len/3 + element_line(-4*x/4, dia*2, -2*x/4, dia*2) + element_line(-2*x/4, dia*2, +2*x/4, -dia*2) + } + else if (P["wiper"] == "aarrow") { + x = len/3 + element_arrow(-2*x/4, dia*2, +2*x/4, -dia*2-mil(30)) + } + else if (P["wiper"] == "parrow") { + element_arrow(0, -dia*2-mil(30), 0, -dia) + } + else if (P["wiper"] == "looparrow") { + y = -dia*2-mil(30) + x = sx2+len/8 + element_arrow(0, y, 0, -dia) + element_line(0, y, x, y) + element_line(x, y, x, 0) + } + else if ((P["wiper"] != "none") && (P["wiper"] != "")) { + error("Invalid wiper") + } + +# silk sign if (P["pol"] == "sign") { size=mil(10) @@ -32,6 +109,10 @@ offs=DEFAULT["line_thickness"] element_rectangle(-spacing/4-offs, -dia, -spacing/4+offs, +dia, DEFAULT["line_thickness"]*4) } + else if (P["pol"] == "dot") { + r=2*DEFAULT["line_thickness"]/3 + element_arc(-spacing/4-r*3, -dia/2, r, r, 0, 360) + } else if ((P["pol"] != "") && (P["pol"] != "none")) { error("Invalid pol") }