summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhoekstar <hoekstar@cb376a5e-1013-0410-a455-b6b1f9ac8223>2008-02-22 18:50:01 +0000
committerhoekstar <hoekstar@cb376a5e-1013-0410-a455-b6b1f9ac8223>2008-02-22 18:50:01 +0000
commit8e74da51f1b376ada048bc22385cb1cebbc5b523 (patch)
tree24a2d65b13bdab4413a4eb029c39b4a2e1fc91db
parent8b529ef4887d5a3c199acd9646dac458090ee40c (diff)
downloadreprap-backup-8e74da51f1b376ada048bc22385cb1cebbc5b523.tar.gz
reprap-backup-8e74da51f1b376ada048bc22385cb1cebbc5b523.zip
added the start of my povray stuff.
git-svn-id: https://reprap.svn.sourceforge.net/svnroot/reprap@1359 cb376a5e-1013-0410-a455-b6b1f9ac8223
-rwxr-xr-xtrunk/users/hoeken/povray/stl2pov.pl59
1 files changed, 59 insertions, 0 deletions
diff --git a/trunk/users/hoeken/povray/stl2pov.pl b/trunk/users/hoeken/povray/stl2pov.pl
new file mode 100755
index 00000000..9a4b45f6
--- /dev/null
+++ b/trunk/users/hoeken/povray/stl2pov.pl
@@ -0,0 +1,59 @@
+#!/usr/bin/perl -w
+
+use File::Basename;
+
+#get all the files in our current directory.
+@files = <*.stl>;
+$count = @files;
+
+#did we get any?
+if ($count > 0)
+{
+ #make the dir.
+ if (!-d "povray/")
+ {
+ mkdir "povray/";
+ }
+
+ #make the files.
+ foreach $file (@files)
+ {
+ $to_name = $file;
+ $to_name =~ s/stl$/pov/;
+
+ $cmd = "stl2pov $file > povray/$to_name";
+ print $cmd . "\n";
+ print `stl2pov $file > povray/$file.pov`;
+ }
+}
+
+
+#get all the files in subdirectories.
+@dir_files = <*/*.stl>;
+$count = @dir_files;
+
+#did we get any?
+if ($count > 0)
+{
+ #make the files.
+ foreach $file (@dir_files)
+ {
+ $real_name = `basename $file`;
+ $real_dir = `dirname $file`;
+ chomp $real_dir;
+ chomp $real_name;
+
+ #make the dir
+ if (!-d "$real_dir/povray/")
+ {
+ mkdir "$real_dir/povray/";
+ }
+
+ $to_name = $real_name;
+ $to_name =~ s/stl$/pov/;
+
+ $cmd = "stl2pov $file > $real_dir/povray/$to_name";
+ print $cmd . "\n";
+ print `stl2pov $file > povray/$file.pov`;
+ }
+} \ No newline at end of file