Permalink
Browse files

Adding automated scan cleanup/moving scripts.

  • Loading branch information...
1 parent ab74c14 commit f7ecd06e18d863f326ce3b36573821910f00cc05 @jherrm committed Sep 28, 2012
Showing with 82 additions and 0 deletions.
  1. +27 −0 automation/Reconstruct Me.ahk
  2. +4 −0 automation/clean_scan.bat
  3. +36 −0 automation/clean_scan.mlx
  4. +15 −0 automation/move_scans.bat
@@ -0,0 +1,27 @@
+; AutoHotkey stuff
+#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
+SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
+SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
+
+; Scanbooth Stuff
+
+; Start ReconstructMe command line application
+Run "C:\ReconstructMe\Start ReconstructMe Record OpenNI.bat"
+
+; Wait until ReconstructMe starts
+WinWait C:\Windows\system32\cmd.exe
+Sleep 500
+
+; Agree to the terms of service
+Send y{Enter}
+
+; Wait until the window closes
+; NOTE: since ReconstructMe runs under cmd.exe, this
+; script will wait until ALL cmd.exe windows are closed
+WinWaitClose
+
+; Wait a sec until things actually close
+Sleep 1000
+
+; Go to the next step - move the
+Run C:\ScanBooth\move_scans.bat
@@ -0,0 +1,4 @@
+:: Filename is the first argument provided to the script
+set filename=%1
+"C:\Program Files\VCG\MeshLab\meshlabserver" -i %filename% -o %filename%.stl -s C:\ScanBooth\clean_scan.mlx -om vn
+move %filename%.stl C:\ScanBooth\cleaned_scans\
View
@@ -0,0 +1,36 @@
+<!DOCTYPE FilterScript>
+<FilterScript>
+ <filter name="Small component selection">
+ <Param type="RichFloat" value="0.3" name="NbFaceRatio"/>
+ <Param type="RichBool" value="false" name="NonClosedOnly"/>
+ </filter>
+ <filter name="Delete Selected Faces and Vertices"/>
+ <filter name="Transform: Rotate">
+ <Param enum_val0="X axis" enum_val1="Y axis" enum_cardinality="4" enum_val2="Z axis" enum_val3="custom axis" type="RichEnum" value="0" name="rotAxis"/>
+ <Param enum_val0="origin" enum_val1="barycenter" enum_cardinality="3" enum_val2="custom point" type="RichEnum" value="0" name="rotCenter"/>
+ <Param type="RichDynamicFloat" value="90" min="-360" name="angle" max="360"/>
+ <Param type="RichBool" value="false" name="snapFlag"/>
+ <Param x="0" y="0" z="0" type="RichPoint3f" name="customAxis"/>
+ <Param x="0" y="0" z="0" type="RichPoint3f" name="customCenter"/>
+ <Param type="RichFloat" value="30" name="snapAngle"/>
+ <Param type="RichBool" value="true" name="Freeze"/>
+ <Param type="RichBool" value="false" name="ToAll"/>
+ </filter>
+ <filter name="Transform: Scale">
+ <Param type="RichDynamicFloat" value="0.084" min="0.1" name="axisX" max="10"/>
+ <Param type="RichDynamicFloat" value="0.084" min="0.1" name="axisY" max="10"/>
+ <Param type="RichDynamicFloat" value="0.084" min="0.1" name="axisZ" max="10"/>
+ <Param type="RichBool" value="true" name="uniformFlag"/>
+ <Param enum_val0="origin" enum_val1="barycenter" enum_cardinality="3" enum_val2="custom point" type="RichEnum" value="0" name="scaleCenter"/>
+ <Param x="0" y="0" z="0" type="RichPoint3f" name="customCenter"/>
+ <Param type="RichBool" value="false" name="unitFlag"/>
+ <Param type="RichBool" value="true" name="Freeze"/>
+ <Param type="RichBool" value="false" name="ToAll"/>
+ </filter>
+ <filter name="Surface Reconstruction: Poisson">
+ <Param type="RichInt" value="9" name="OctDepth"/>
+ <Param type="RichInt" value="8" name="SolverDivide"/>
+ <Param type="RichFloat" value="1" name="SamplesPerNode"/>
+ <Param type="RichFloat" value="1" name="Offset"/>
+ </filter>
+</FilterScript>
View
@@ -0,0 +1,15 @@
+@echo off
+
+:: Prefix the filename with a datetime stamp
+For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
+For /f "tokens=1-3 delims=/:/ " %%a in ('time /t') do (set mytime=%%a-%%b-%%c)
+set mytime=%mytime: =%
+
+:: Loop through all .ply files in the ReconstructMe folder
+for /r "C:\ReconstructMe" %%x in (*.ply) do (
+move "%%x" "C:\ScanBooth\raw_scans\%mydate%_%mytime%_%%~nx.ply"
+:: Clean the scans
+call clean_scan.bat "C:\ScanBooth\raw_scans\%mydate%_%mytime%_%%~nx.ply"
+:: You can move the cleaned scans to a shared directory to continue editing or send to 3D printer
+move "C:\ScanBooth\cleaned_scans\%mydate%_%mytime%_%%~nx.ply.stl" "C:\ScanBooth\cleaned_scans\%mydate%_%mytime%_%%~nx.stl"
+)

0 comments on commit f7ecd06

Please sign in to comment.