#!/bin/csh

#bev_void_2.csh
#Make color STL file for each void grain, and make bird's eye view maps/movie

set dir0=obs_fin			#input file name

set vg=a1				#name of void grain
set scale=5				#scale for bird's eye view map


set dir=051120jk
set area=(823 558 773 976 788 926)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(0 255 128)		#color for stl file
set cn=CG				#Cyan-Green

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


set dir=051120lm
set area=(825 501 863 1014 931 1050)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(255 255 0)			#color for stl file
set cn=Y				#Yelow

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


echo OPERATIONS FOR SPHERULES COMPLETED

