#!/usr/bin/perl

# A REALLY simple perl script to allow you to use feet instead of
# inches in a transform...I've found it handy not to have to constantly
# multiply stuff by 12 to position it in a model that is using units
# of inches.

# Use it JUST like xform, except pass feet to the -t option instead of
# inches:
#
# gen... ... | uxform -t 10 5 0
#
# instead of:
#
# gen... ... | xform -t 120 60 0
#
# Rotations and other options are passed through without modification.
# If you want, you could muck with them, or even get fancy and add an
# option like -ti to translate in inches, and -tf to translate in feet.
# OR EVEN BETTER, add units support:
#
# uxform -t 3ft 6in 6in ...  (CURRENTLY NOT SUPPORTED)
#
# Gosh, I just thought of that one...I like it and will probably do that
# in the future :-)

@args = ('xform');

for $arg (@ARGV)
{
   $translate = 1 if $arg =~ /^-t/;
   $translate = 0 if $arg =~ /^-[arms]/;
   if($arg =~ /^-?[0-9]*\.?[0-9]*$/ && $translate) {
      $arg *= 12;
   }
   push @args, $arg;
}

exec @args;
