#! /bin/csh -f
# Last edited on 2000-05-02 15:44:40 by stolfi

# Draws the raw contour

set usage = "$0 PIECE VARIANT CURVETYPE BAND"

set piece = "$1"; shift
set variant = "$1"; shift
set ctype = "$1"; shift
set band = "$1"; shift
if ( $#argv != 0) then
  echo "usage: ${usage}"; exit 1
endif

set dir = "${piece}-${variant}"
set curve = "${ctype}${band}"

set input = "${dir}/${curve}"
set output = "${dir}/${curve}"

if ( -r ${input}.flc ) then
  echo "generating ${output}.eps"
  /bin/rm -f ${output}.eps
  cat ${input}.flc \
    | /n/gnu/bin/nice PZDraw \
      -window ${piece} \
      -output ${output} \
      -grid 25 \
      -axes \
      -rect ${piece}\
      -epsFormat
  if ( -r ${output}.eps ) then
    ghostview -openwindows ${output}.eps
  endif
else
  echo "${input}.flc not found"
endif