From 420eeee620a287ac5bf133f8a17329a7182d5bbf Mon Sep 17 00:00:00 2001 From: epoch Date: Tue, 5 Feb 2019 21:48:29 -0600 Subject: forgot to add bin dir that contains a LOT of the handy stuff --- bin/dat2hackvr.pl | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 bin/dat2hackvr.pl (limited to 'bin/dat2hackvr.pl') diff --git a/bin/dat2hackvr.pl b/bin/dat2hackvr.pl new file mode 100755 index 0000000..03c5315 --- /dev/null +++ b/bin/dat2hackvr.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl + +use strict; + +die "usage: dat2hackvr.pl name file\n" unless $ARGV[0]; + +my $line; +my $prev; +my $first; +open(FILE,$ARGV[1]) if $ARGV[1]; +while($line=) { + chomp $line; + if(!($line =~ m/^#/)) { + if($line eq "") { +# print $ARGV[0]; +# print " addtriangle "; +# print $prev . " 0 " . $first . " 0 " . $first . " 0"; +# print "\n"; + $first=""; + } else { + if($prev ne "") { + print $ARGV[0]; + print " addshape 2 2 "; + print $line . " 0 " . $prev . " 0"; + print "\n"; + } + $prev=""; + } + if($first eq "") { + $first=$line; + } + $prev=$line; + } +} -- cgit v1.2.3