#!/bin/csh -f

# Constructor routine: KP-cons-refineTEMP
# Dec 12, 1996
# Rob Scharein

# Constructor arguments:
#    $0 Constructor executable file (this file).
#    $1 First file read by KnotPlot (the prefile).
#    $2 Second file read by KnotPlot (the postfile).
#    $3 Type of machine we're running on (sgi, ibm, etc...)
#    $4 A flag either 0 or 1.
#    $5 Name of constructor.
#       Anymore more arguments are the arguments to the contructor
#       from the KnotPlot command line.

switch ($4)
case 0:
  
  set ncomps = $6
  set knot = $1.k
  echo silent=f > $1
  echo open info \> $2 >> $1
  echo silent=t >> $1
  echo save $knot 0 >> $1
  
  set compnum = 0
  while ($compnum < $ncomps)
    set comp = $1"."$compnum
    echo keep $compnum >> $1
    echo kpath $comp >> $1
    echo load $knot >> $1
    @ compnum++
  end
  
  echo load $1".0" >> $1
  set compnum = 1

  while ($compnum < $ncomps)
    set comp = $1"."$compnum
    echo load comb $comp >> $1
    @ compnum++
  end

  cp $1 ~/dum.csh

  breaksw

endsw



