#!/bin/tcsh -f

if ("$argv" == "") then
  set argv="parts/*.iv"
endif

if (! -e topo) then
  mkdir topo
endif

cat /dev/null > TOPO

foreach a ($argv)
   switch ($a:t:r:r:r)
     case interior:
       setenv TTOL 0.8
       breaksw
     default:
       setenv TTOL 1.0
       breaksw
   endsw

   echo opoptimize $a -tess no -ttol $TTOL -batch topo/$a:t:r.csb
   opoptimize $a -tess no -ttol $TTOL -batch topo/$a:t:r.csb >>& TOPO
end

set argv
