// Last edited on 2019-11-22 12:13:35 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. // Usually {dx} is length, {dy} is width, {dz} is thickness. // The number string {label} is printed at the right. // Each line is "{mat} {tagg}.{kk} {dx} {dy} {dz} # {label}" // where {kk} is a piece count from 1 to {qt} #if (dx < dy) // Reorient piece with longest dim horizontal: #local temp = dx; #local dx = dy; #local dy = 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(dx,6,1), " ", str(dy,6,1), " ", str(dz,6,1))) #write(pieces, concat(" # ", label, "\n")) #end #end