Index: trunk/pcblib/parametric/common.awk =================================================================== --- trunk/pcblib/parametric/common.awk (revision 4827) +++ trunk/pcblib/parametric/common.awk (revision 4828) @@ -176,6 +176,15 @@ } } +# draw a matrix of pads; top-left corner is x1;y1, there are nx*ny pads +# of w*h size. rows/cols of pads are drawn with ox and oy offset +function element_pad_matrix(x1, y1, nx, ny, w, h, ox, oy, number, flags, clearance, mask, name, ix,iy) +{ + for(iy = 0; iy < ny; iy++) + for(ix = 0; ix < nx; ix++) + element_pad_rectangle(x1+ix*ox, y1+iy*oy, x1+ix*ox+w, y1+iy*oy+h, number, flags, clearance, mask, name) +} + # draw element pad circle function element_pad_circle(x1, y1, radius, number, clearance, mask, name) { Index: trunk/pcblib/parametric/qf =================================================================== --- trunk/pcblib/parametric/qf (revision 4827) +++ trunk/pcblib/parametric/qf (revision 4828) @@ -62,6 +62,24 @@ #@@optional:cpad_height #@@default:cpad_height false, no central pad +#@@param:cpm_nx central pad paste matrix, number of paste pads in x direction +#@@optional:cpm_nx +#@@default:cpm_nx 2 + +#@@param:cpm_ny central pad paste matrix, number of paste pads in y direction +#@@optional:cpm_ny +#@@default:cpm_ny 2 + +#@@param:cpm_width central pad paste matrix, paste pad width (dimension of each paste rectangle) +#@@dim:cpm_width +#@@optional:cpm_width +#@@default:cpm_width 1mm + +#@@param:cpm_height central pad paste matrix, paste pad height (dimension of each paste rectangle) +#@@dim:cpm_height +#@@optional:cpm_height +#@@default:cpm_height 1mm + #@@param:cpad_mask center pad mask; if not specified, use the same gap as for the rows (pad_mask) #@@dim:cpad_mask #@@optional:cpad_mask Index: trunk/pcblib/parametric/qf.awk =================================================================== --- trunk/pcblib/parametric/qf.awk (revision 4827) +++ trunk/pcblib/parametric/qf.awk (revision 4828) @@ -14,6 +14,10 @@ set_arg(P, "?pad_thickness", "0.3mm") set_arg(P, "?silkmark", "dot") set_arg(P, "?line_thickness", "0.1mm") + set_arg(P, "?cpm_width", "1mm") + set_arg(P, "?cpm_height", "1mm") + set_arg(P, "?cpm_nx", "2") + set_arg(P, "?cpm_ny", "2") } reqs = "nx,ny" @@ -27,7 +31,7 @@ if ((pre_args != "") && (!(pre_args ~ ",$"))) pre_args = pre_args "," - proc_args(P, pre_args "nx,ny,x_spacing,y_spacing,pad_spacing,ext_bloat,int_bloat,width,height,cpad_width,cpad_height,cpad_auto,rpad_round,bodysilk,pinoffs,silkmark" post_args, reqs) + proc_args(P, pre_args "nx,ny,x_spacing,y_spacing,pad_spacing,ext_bloat,int_bloat,width,height,cpad_width,cpad_height,cpad_auto,cpm_nx,cpm_ny,cpm_width,cpm_height,cpad_mask,rpad_round,bodysilk,pinoffs,silkmark" post_args, reqs) nx = int(P["nx"]) ny = int(P["ny"]) @@ -81,6 +85,12 @@ rpad_round = "square" else rpad_round = "" + + + cpm_width = parse_dim(P["cpm_width"]) + cpm_height = parse_dim(P["cpm_height"]) + cpm_nx = int(P["cpm_nx"]) + cpm_ny = int(P["cpm_ny"]) } function pinnum(num) @@ -121,6 +131,14 @@ if ((cpad_width != "") && (cpad_height != "")) { +# center pad paste matrix + if ((cpm_nx > 0) && (cpm_ny > 0)) { + ox = (cpad_width - (cpm_nx*cpm_width)) / (cpm_nx - 1) + oy = (cpad_height - (cpm_ny*cpm_height)) / (cpm_ny - 1) + element_pad_matrix(-cpad_width/2, -cpad_height/2, cpm_nx,cpm_ny, cpm_width,cpm_height, ox+cpm_width,oy+cpm_height, 2*nx+2*ny+1, "square,nopaste") + } + +# center pad tmp = DEFAULT["pad_mask"] DEFAULT["pad_mask"] = cpad_mask element_pad_rectangle(-cpad_width/2, -cpad_height/2, +cpad_width/2, +cpad_height/2, 2*nx+2*ny+1, "square,nopaste")