#! /bin/bash
# Last edited on 2019-11-22 13:18:19 by jstolfi

# Reads from standard input a file produced by the povray macro "write_pieces".
# Arranges those pieces in standard sheets of material to cut out.
# For each material {mat}, thickness {thk}, and sheet index {ix}, writes a PDF file 
# "{prefix}_{mat}_{thk}_ix}.pdf" with a drawing of the sheet and how the pieces are
# to be cut out.

# !!! For now just sorts and prints the pieces !!!

cat \
  | sort -b -k1,1 -k4,4g -k3,3g \
  | pack_pieces.gawk
