1 | # Is there a way to tell readfile not to use .xf files? |
---|
2 | |
---|
3 | # Create a bunch of ply files in a subdirectory |
---|
4 | |
---|
5 | set file [lindex $argv 0] |
---|
6 | set root [file root $file] |
---|
7 | readfile $file |
---|
8 | set dir ${root}_plys |
---|
9 | set res 0 |
---|
10 | catch {exec mkdir $dir} msg; puts $msg |
---|
11 | catch {exec chmod 775 $dir} msg; puts $msg |
---|
12 | set mmConfLines [plv_write_mm_for_vrip $res $dir] |
---|
13 | set CONF [open "$dir/vrip.conf" w] |
---|
14 | foreach bmesh $mmConfLines { |
---|
15 | puts $CONF $bmesh |
---|
16 | } |
---|
17 | close $CONF |
---|
18 | |
---|
19 | catch {chdir $dir} msg |
---|
20 | |
---|
21 | # Vrip all the files at 7 resolutions |
---|
22 | |
---|
23 | puts "" |
---|
24 | |
---|
25 | |
---|
26 | puts -nonewline "\rMerging at 0.25mm... " |
---|
27 | flush stdout |
---|
28 | exec vripnew temp.vri vrip.conf vrip.conf 0.25 -rampscale 625 -use_bigger_bbox |
---|
29 | exec vripsurf temp.vri temp.ply |
---|
30 | exec mv temp.ply 0.25mm.ply |
---|
31 | |
---|
32 | puts -nonewline "\rMerging at 0.5mm... " |
---|
33 | flush stdout |
---|
34 | exec vripnew temp.vri vrip.conf vrip.conf 0.5 -rampscale 1250 -use_bigger_bbox |
---|
35 | exec vripsurf temp.vri temp.ply |
---|
36 | exec mv temp.ply 0.5mm.ply |
---|
37 | |
---|
38 | puts -nonewline "\rMerging at 1mm... " |
---|
39 | flush stdout |
---|
40 | exec vripnew temp.vri vrip.conf vrip.conf 1 -rampscale 2500 -use_bigger_bbox |
---|
41 | exec vripsurf temp.vri temp.ply |
---|
42 | exec mv temp.ply 1mm.ply |
---|
43 | |
---|
44 | puts -nonewline "\rMerging at 2mm... " |
---|
45 | flush stdout |
---|
46 | exec vripnew temp.vri vrip.conf vrip.conf 2 -rampscale 5000 -use_bigger_bbox |
---|
47 | exec vripsurf temp.vri temp.ply |
---|
48 | exec mv temp.ply 2mm.ply |
---|
49 | |
---|
50 | puts -nonewline "\rMerging at 4mm... " |
---|
51 | flush stdout |
---|
52 | exec vripnew temp.vri vrip.conf vrip.conf 4 -rampscale 10000 -use_bigger_bbox |
---|
53 | exec vripsurf temp.vri temp.ply |
---|
54 | exec mv temp.ply 4mm.ply |
---|
55 | |
---|
56 | puts -nonewline "\rMerging at 8mm... " |
---|
57 | flush stdout |
---|
58 | exec vripnew temp.vri vrip.conf vrip.conf 8 -rampscale 20000 -use_bigger_bbox |
---|
59 | exec vripsurf temp.vri temp.ply |
---|
60 | exec mv temp.ply 8mm.ply |
---|
61 | |
---|
62 | puts -nonewline "\rMerging at 16mm... " |
---|
63 | flush stdout |
---|
64 | exec vripnew temp.vri vrip.conf vrip.conf 16 -rampscale 40000 -use_bigger_bbox |
---|
65 | exec vripsurf temp.vri temp.ply |
---|
66 | exec mv temp.ply 16mm.ply |
---|
67 | |
---|
68 | puts "" |
---|
69 | |
---|
70 | #Create the sets |
---|
71 | |
---|
72 | |
---|
73 | set cmd "exec rm temp.vri vrip.conf [glob ${root}*ply]" |
---|
74 | catch {eval $cmd} msg |
---|
75 | |
---|
76 | catch {chdir ..} msg |
---|
77 | |
---|
78 | set cmd "exec plys2set -no_dir_strip -no_xform ${root}.set [glob ${dir}/*mm.ply]" |
---|
79 | puts $cmd |
---|
80 | catch {eval $cmd} msg |
---|
81 | |
---|
82 | exit |
---|
83 | |
---|