// Last edited on 2021-04-05 02:31:47 by jstolfi #macro write_pieces(mat, tagg, qt, dx,dy,dz, label) // Appends to file {pieces} the dimensions of {qt} pieces of flat // material to cut. // The {mat} parameter is a short string that identifies the // material, such as "plywd" for plywood, "plast" for plastic, // "steel" for steel plate, etc. // The {tagg} is a string without spaces that identifies the // set of pieces. // Assumes that {dx} is length, {dy} is width, {dz} is thickness. // The string {label} is printed at the right, preceded by a '#' mark. // Each line is "{mat} {tagg}.{kk} {dx} {dy} {dz} # {label}" // where {kk} is a piece count from 1 to {qt} #local adx = dx; #local ady = dy; #local adz = dz; // Reorient piece so that longest dir is horizontal: #if (adx < ady) #local temp = adx; #local adx = ady; #local ady = temp; #end #local kk = 0; #for( kk, 1, qt, 1 ) #write(pieces, mat) #write(pieces, concat(" ", tagg, ".", str(kk,1,0))) #write(pieces, concat(" ", str(adx,6,1), " ", str(ady,6,1), " ", str(adz,6,1))) #write(pieces, concat(" # ", label, "\n")) #end #end