Index: pcblib/parametric/common.awk =================================================================== --- pcblib/parametric/common.awk (revision 686) +++ pcblib/parametric/common.awk (revision 687) @@ -375,3 +375,31 @@ x = tolower(x) return (x == "true") || (x == "yes") || (x == "on") } + +# default pin1 mark on a box +# style: mark style, "+" separated list (TODO) +# x,y: the coordinates of the origin corner (top-left) +# half: half the stepping of the pin grid - the size of the mark +function silkmark(style, x, y, half) +{ + if (style == "angled") { + element_line(x, y-half, x-half, y) + } + else if (style == "square") { + element_line(x-half, y+half, x+half, y+half) + element_line(x+half, y-half, x+half, y+half) + } + else if ((style == "external") || (style == "externalx")) { + element_line(x-half, y, x-step, y-half/2) + element_line(x-half, y, x-step, y+half/2) + element_line(x-step, y-half/2, x-step, y+half/2) + } + else if (style == "externaly") { + element_line(x, y-half, x-half/2, y-step) + element_line(x, y-half, x+half/2, y-step) + element_line(x-half/2, y-step, x+half/2, y-step) + } + else if ((style != "none") && (style != "")) { + error("invalid silkmark parameter: " style) + } +} Index: pcblib/parametric/connector.awk =================================================================== --- pcblib/parametric/connector.awk (revision 686) +++ pcblib/parametric/connector.awk (revision 687) @@ -79,26 +79,7 @@ element_rectangle(-half, -half, P["nx"] * step - half + xo, P["ny"] * step - half + yo) - if (P["silkmark"] == "angled") { - element_line(0, -half, -half, 0) - } - else if (P["silkmark"] == "square") { - element_line(-half, half, half, half) - element_line(half, -half, half, half) - } - else if ((P["silkmark"] == "external") || (P["silkmark"] == "externalx")) { - element_line(-half, 0, -step, -half/2) - element_line(-half, 0, -step, +half/2) - element_line(-step, -half/2, -step, +half/2) - } - else if (P["silkmark"] == "externaly") { - element_line(0, -half, -half/2, -step) - element_line(0, -half, +half/2, -step) - element_line(-half/2, -step, +half/2, -step) - } - else if ((P["silkmark"] != "none") && (P["silkmark"] != "")) { - error("invalid silkmark parameter: " P["silkmark"]) - } - + silkmark(P["silkmark"], 0, 0, half) + element_end() }