#! /bin/csh -f

foreach f ( $* )
  foreach h ( f80s00n f40s40n f00s80n f80s00u f40s40u f00s80u  )
    set flatten   "-flatten `echo ${h} | sed -e 's/f\(..\)s\(..\)/\1/'`"
    set spread    "-spread  `echo ${h} | sed -e 's/f\(..\)s\(..\)/\2/'`"
    set normalize "`echo ${h} | sed -e 's/f\(..\)s\(..\)\(.\)/\3/'`"
    if ( "x${normalize}" == "xu" ) then
      set normalize = ""
    else
      set normalize = "-normalize"
    endif
    set options = ( ${flatten} ${spread} ${normalize} )
    echo ${f} ${options}
    SmoothShape \
      -inFile ../../RandomShapes/tests/${f} \
      -outFile ${f}-${h} \
      ${options} \
      -showAll \
      -energy 0.1000 Curv \
      -energy 0.1000 PArea \
      -energy 0.0010 Corner \
      -energy 1.0000 Excen \
      -energy 0.1000 Poten \
      -energy 0.1000 Elect
  end
end
