Thursday, September 08, 2011
Being in a 3D world, with a 3D printer? what do I need? A 3D scanner!
It turns out that I've well and truly been beaten to the punch when it comes to reprapping 3D scanners and such, so this post isn't about hardware, but more the software / workflow I've been playing with. I'm standing on the shoulders of giants here, none of the tools are mine, I'm just trying to build a workflow for a 3D "photocopier"! one_object->scan->[stuff]->print->two_objects = awesome!
In my case this is:
SpinScan - laser scanner hardware and point cloud generation
- by tbuser, awesome
http://www.thingiverse.com/thing:9972
On my mac, I installed the following to make this work ( it's Processing based, so should work anywhere very similarly ) :
Processing 1.5.1 http://processing.org/download/
OpenCV Framwork http://ubaa.net/shared/processing/opencv/download/opencv-framework.1.1.dmg
and then downloaded these extra libraries:
OpenCV Processing library: http://ubaa.net/shared/processing/opencv/
ControlP5 library: http://www.sojamo.de/libraries/controlP5/
( unzip the libraries, and copy the zip contents as-is to /Applications/Processing.app/Contents/Resources/Java/modes/java/libraries/ )
I then opened the spinscan.pde from GIT ( github.com/tbuser/spinscan ) with the Processing.app, and it loads, and runs ( press play etc ).
Once it's setup and working right , the SpinScan software generates a .ply file.
for more, read here:
http://en.wikipedia.org/wiki/PLY_%28file_format%29
meshlab for point cloud -> stl / triangulation , ( by many many people smarter than me) :
( use the latest meshlab ) .
once you have a .ply file, convert it to .stl with meshlab using these hints...
or here's one possible method:
summary:
subsampling , normal reconstruction, surface reconstruction / triangulation, cleaning up and assessing.
1. open meshlab ( starts with an empty project )
2. File -> import mesh -> [browse to and locate the .ply file you generated in spinscan or similar ]
3. Open Layer view (7th icon from the left , looks like a pile of papers)
3. SUBSAMPLING: Filters > Sampling > Poisson-disk Sampling: Enter the Number of Samples as the resulting vertex number / number of points you want. Good to start with about the same number as your vertex to maintain resolution, or if you have a very large file, choose something like 10000 or so to reduce your point cloud to something easier to work with ) - you MUST tick the "Base Mesh Subsampling" tickbox or you'll get an error here.
4. COMPUTE NORMALS: Filters > Normals/Curvatures and Orientation > compute Normals for Point Sets [set neighbours = 10 or 20]
5. TRIANGULATION : ( try any of these, and see which works best for you ) :
a. Filters > Point set -> Surface Reconstruction: Poisson, set octree to 11 (ish) [you should now see a new layer in the Layer Dialog to the right] but really strange border! ( increase this to 12 or 13 if you loose too much resolution on your object at 11. )
b. Filters > Point set -> Marching cubes RIMLS. Set Grid resolution to 1000 for a detailed mesh, or approx 200 for less details.
c. Filters -> "Remeshing , Simplification and reconstruction" -> Alpha Complex / Shape ( might work, not sure )
6. Fill holes by Filters -> "Remeshing , Simplification and reconstruction" -> Close Holes , picks out number automatically
7. SAVE MESH !
save often as program crashes a lot!
here's a way that someone else did it:
http://www.instructables.com/id/Using-Meshlab-to-Clean-and-Assemble-Laser-Scan-Dat/
In my case this is:
SpinScan - laser scanner hardware and point cloud generation
- by tbuser, awesome
http://www.thingiverse.com/thing:9972
On my mac, I installed the following to make this work ( it's Processing based, so should work anywhere very similarly ) :
Processing 1.5.1 http://processing.org/download/
OpenCV Framwork http://ubaa.net/shared/processing/opencv/download/opencv-framework.1.1.dmg
and then downloaded these extra libraries:
OpenCV Processing library: http://ubaa.net/shared/processing/opencv/
ControlP5 library: http://www.sojamo.de/libraries/controlP5/
( unzip the libraries, and copy the zip contents as-is to /Applications/Processing.app/Contents/Resources/Java/modes/java/libraries/ )
I then opened the spinscan.pde from GIT ( github.com/tbuser/spinscan ) with the Processing.app, and it loads, and runs ( press play etc ).
Once it's setup and working right , the SpinScan software generates a .ply file.
for more, read here:
http://en.wikipedia.org/wiki/PLY_%28file_format%29
meshlab for point cloud -> stl / triangulation , ( by many many people smarter than me) :
( use the latest meshlab ) .
once you have a .ply file, convert it to .stl with meshlab using these hints...
or here's one possible method:
summary:
subsampling , normal reconstruction, surface reconstruction / triangulation, cleaning up and assessing.
1. open meshlab ( starts with an empty project )
2. File -> import mesh -> [browse to and locate the .ply file you generated in spinscan or similar ]
3. Open Layer view (7th icon from the left , looks like a pile of papers)
3. SUBSAMPLING: Filters > Sampling > Poisson-disk Sampling: Enter the Number of Samples as the resulting vertex number / number of points you want. Good to start with about the same number as your vertex to maintain resolution, or if you have a very large file, choose something like 10000 or so to reduce your point cloud to something easier to work with ) - you MUST tick the "Base Mesh Subsampling" tickbox or you'll get an error here.
4. COMPUTE NORMALS: Filters > Normals/Curvatures and Orientation > compute Normals for Point Sets [set neighbours = 10 or 20]
5. TRIANGULATION : ( try any of these, and see which works best for you ) :
a. Filters > Point set -> Surface Reconstruction: Poisson, set octree to 11 (ish) [you should now see a new layer in the Layer Dialog to the right] but really strange border! ( increase this to 12 or 13 if you loose too much resolution on your object at 11. )
b. Filters > Point set -> Marching cubes RIMLS. Set Grid resolution to 1000 for a detailed mesh, or approx 200 for less details.
c. Filters -> "Remeshing , Simplification and reconstruction" -> Alpha Complex / Shape ( might work, not sure )
6. Fill holes by Filters -> "Remeshing , Simplification and reconstruction" -> Close Holes , picks out number automatically
7. SAVE MESH !
save often as program crashes a lot!
here's a way that someone else did it:
http://www.instructables.com/id/Using-Meshlab-to-Clean-and-Assemble-Laser-Scan-Dat/