#! /bin/csh -f

# creates a eps file from a state file (.st)

set usage = "$0 <FILE> [AON|AOFF]"

if ( $#argv != 2) then
  echo "usage: $usage"; exit 1
endif

set inst   = "$1"; # file name input

set smooth = "$2"; # flag to PovRay

set mydir = /home/phd/lplozada

set mybin = ${mydir}/programas/m3

${mybin}/ProjectTo3D/SOLgnu/ProjectTo3D \
  -inFileTp $inst \
  -inFileSt $inst \
  -outFile  $inst \
  -projection Parallel \
  -autoProject
   echo "-> ProjectTo3D done"

${mybin}/TriangToPov/SOLgnu/TriangToPov \
  -inFileTp   $inst \
  -inFileSt3  $inst-Par \
  -outFile    $inst \
  -silhouette
  echo "-> TriangToPov done"

gzip $inst.st3
  
${mydir}/bin/RunPOV $inst $smooth

${mydir}/bin/make-eps $inst.ppm

gzip $inst.ppm

ghostview $inst.eps&

