#!/bin/bash

PROJECT="airboat"

if [ $# -gt 0 ]
then
	PROJECT=$1
fi

# -------------------------------------------------

echo
read_obj -v -o WS/${PROJECT}.evblob ${PROJECT}.obj

echo
export_evblob -t vertices WS/${PROJECT}.evblob |
	./bub2inc.awk > WS/${PROJECT}_v.incc

echo
export_evblob -t edges WS/${PROJECT}.evblob |
	./edg2inc.awk > WS/${PROJECT}_e.incc

# -------------------------------------------------

ERR="WS/runme.stderr"

POVOPT=" +Q9 +A -v -d -W1280 -H1024 -wt4"

echo "   Raytracing, please wait..."
povray	${POVOPT} +K360 			\
	-I${PROJECT}.pov -o${PROJECT}.png  2> $ERR

echo "=========================================="
	tail -15 $ERR
echo "=========================================="

