#!/bin/sh
#Tag 0x006A0031
#
# Another fine tool from the...
#
######                                  ######
#     #   ####   #    #  #    #   ####  #     #    ##     ####   #    #
#     #  #    #  ##   #  #    #  #      #     #   #  #   #    #  #   #
######   #    #  # #  #  #    #   ####  ######   #    #  #       ####
#     #  #    #  #  # #  #    #       # #        ######  #       #  #
#     #  #    #  #   ##  #    #  #    # #        #    #  #    #  #   #
######    ####   #    #   ####    ####  #        #    #   ####   #    #
#
#                                                            hackers...
#
# Copy this file, dxfix and dxfix13.dxt to /usr/local/bin 
# (which should be in your PATH)
#
vrmlfile=`basename $1 \....`.wrl
case `filetype $1 | awk '{ print $2 }` in
	acad13DXFfile)
	dxfFile=/usr/tmp/t_`basename $1`
	dxfix -A6 -T/usr/local/bin/dxfix13.dxt $1 $dxfFile 2>/dev/null
	DxfToIv -q $dxfFile | ivOrient -  | ivToVRML -o $vrmlfile
	rm -f $dxfFile
	;;
	
	acad12DXFfile)
	DxfToIv -q $1 | ivOrient - | ivToVRML -o $vrmlfile
	;;

	acadGenericDXFfile)
	DxfToIv -q $1 | ivOrient - | ivToVRML -o $vrmlfile
	;;

	*)
	DxfToIv -q $1 | ivOrient - | ivToVRML -o $vrmlfile
	;;
esac	
