; build3d file_name
; builds a 3d from a set of 2D, the name of which are found in file_name
; one entry per line
;
; see also : READ build2d

; get name
if (!$arg) print 'Enter name of the list of file:'
set file = $_

; get length using wc and shell  (could be in gifa)
sh ('wc'//sp(1)//$file//'> /tmp/build3d.tmp')
open /tmp/build3d.tmp   set si1 = </tmp/build3d.tmp
set si1 = (head($si1))
close /tmp/build3d.tmp sh 'rm /tmp/build3d.tmp'

; prepare
open $file
dim 2 readh <$file                 ; get first one
dim 3 chsize $si1 $si1_2d $si2_2d  ; set-up sizes
put plane 1

set i = 2                          ; then loop
=loop
  dim 2 readh <$file
  dim 3 put plane $i
  set i = ($i+1) if ($i<=$si1)  goto loop

;finished
dim 3  close $file
exit

