3D scanning: Physical to digital

The challenge:
3D print an object that couldn’t be made using subtractive milling process. Scan a physical object, and for bonus points print it.

Plan of attack:
Scan something > Mess with it in CAD to make it unmillable > Print it.

Approach:
Fab Lab Wgtn has a Roland LPX-600 and Microsoft Kinect for 3D scanning, both of which I’ve used previously. So instead this weeks focus was on using photogrammetry to scan and reconstruct an object. Experimenting with different software that could be used to create a mesh.

Photos

The key to getting good results in photogrammetry is having good starting images. Lots of photos with a large amount of overlap, consistent lighting and lots of unique details in the frame. Picking an object that doesn’t move and keeping all the images focused helps as well. Like this funky tree.
Mr Tree, Scan me!

Image Processing

The approach was to try a number of different photogrammetry programs to see how they would handle the same photo set.

123D Catch

Pros:
Doesn’t require a powerful computer to process images.
Really easy interface.
Returns mesh rather than a point cloud.

Cons:
Requires uploading images to a remote server.
Limits the number of photos that could be uploaded.
Really doesn’t like corporate firewalls.
Limited options along the way.

Uploading to Catch, very slowly
Catch was fairly quick and painless. Once getting past the initial firewall issues it was very straight forward to upload images and get a mesh back. It wasn’t amazing quality, with quite a few holes. Overall catch provides a pathway to produce a scan, but with very limited options to customise along the way.
Caught trees

VisualSFM

Pros:
Works on Windows, OSX and Linux.
Utilizes GPU power to speed up image processing.
Provides options to customise processing for better results.
Command line and GUI interfaces available.
No limit on the number or size of images used.

Cons:
System intensive.
Produces point cloud that requires further processing.
Requires larger number of images to achieve results comparable to other programs.

SFM trees
VisualSFM provides the highest amount of flexibility out of the three programs investigated. Allowing for sequential or cross sampling of large images of any quantity.
SFM thinking hard
After processing the images it creates a point cloud that can be used to construct a mesh of the object or environment.
SFM cloud

Python Photogrammetry Toolkit

Pros:
Works on anything that can run python, as long as the dependency are setup.
Command line and GUI interfaces available.
Produces amazing scans.
No limit on the number of images used.

Cons:
Slow.
Requires dependency setup to make play nicely.
Really super slow, think days.
System intensive.

PPT needs a few things to make it play nicely. After trying to get it working on windows without luck I progressed to linux.
Dependency fail1
After finally getting it working PPT it immediately started asking difficult questions. CCD width in mm? No idea what that means…
camera focus
But luckily google does!
sensor size
17.3mm all right!
Unfortunately those pesky dependency issues were back, preventing PPT from being able to match details between images.
zero found
The images were too big to process without running out of memory. Conveniently PPT has a built-in resizer to deal with this common problem.
out of ram
Finally its able to process the images and identify key-points to cross reference between each image. This process ended up taking hours.
Extracting keypoints
Once complete PPT runs a starts trying to match images. The processing time varied wildly between images and again took hours.
KeyMatch
This process dumps all the resized images and their key-point files out into osm-bundle for further processing.
CMVS+PMVS
Next up was cross referencing the images with PMVS.
Later that day
This process took a long time.
Still thinking
A very long time.

The screenshots through here all look slightly difference because I was trying to get PPT to work and run faster under different environments. I was initially running on 64-bit windows 7 enviroment but ran into issues getting all the dependencies to play nicely. Swithing over to a 32 bit ubuntu virtual machine made it easier to get PPT up and running but with only 2GB of memory the process was painfully slow. I moved over to a 64-bit ubuntu install and ran it on my desktop machine which has an i7 processor and 24GB of ram. Despite this the process still took days.

It turns out that there’s also linux distro called archeos devoted to archaeological processes including photogrammetry that comes with PPT and its dependencies ready to go.

3D scanning: From mesh to model

Wow tree
The scan that came out of PPT was pretty amazing, but still had a few holes in the top and bottom where the camera couldn’t see. These were patched up using repair mode in netfabb to close the faces.
I decided to mess around with the scan data in a few different modeling programs before printing it out.
netfabb
I smashed holes in the mesh using openSCAD before taking it into meshmixer to smooth off the mesh.
Meshmixer transparent view
Meshlab can also achieve a similar effect using poisson reconstruction. Which was used to create an internal lattice structure.
meshlab lattice
Combining the two without reducing the mesh turned out to be harder than expected. As meshmixer drops faces and meshlab preserved internal vertices. Cloudcompare has a boolean union function that doesn’t have either of these cave eats and was a quick fix for nicely merging the two meshes.
upplus
The file was printed in abs on an upPlus with 0.2 layer height and a raft with ‘base only’ support, 3 Surface layers and low fill(~10%).
upplus
The raft separated easily but there was a small amount internal support that required more persuasion to remove.
upplus

Troubleshooting Up+

Prints lifting

Easily the most common issue I run into with the up printers is prints lifting off the bed. Luckly this is usually a pretty straight forward fix.
-Pre-heat the bed. Having it nice and warm stops the plastic from cooling too quickly and warping. The bed can be pre heated by selecting 3d print > table preheat 15 min.
-Look at the z height of the nozzel, if its set to high the print wont stick nicely to the bed.
-Check the placement and orentation of the object on the bed. Large flat objects tend to warp more so re-orentating the part can help reduce its surface area. The bed has a heating element right in the middle of the bed so positining the the object to be evenly heated can also help keep it nice and flat.
-Play with the fan. The up has a fan grad that can be rotated to stop air from blowing on the part as its printed. Air cooling is great for helping small details print nicely but can cause larger objects to cool unevenly and warp.

Checking the Z height

Having the start height set correctly is critical for the print succeding. Tool low and the nozzel will block, too high and the print wont stick.
The start hight can be adjusted by selecting 3d print > matainance and moving the bed to the required height and pressing set nozzel height. The ideal height seems to be about the thickness of a business card.

Fixing stopped extrusion

Some times the filliament will stop extruding. This is usually caused by one of two things, either the drive gear has worn a groove in the filliment causing it to lose its grip. Or the nozzle has become blocked.
If the first instance the fix is really straight forward. Going into matainace mode 3d print > matainance mode > withdraw, we can remove the filiment and examine the end, removing the section that has been worn away and putting it back in using the extrude option.

If the nozzel is actually blocked then the process is a little more involved.
First disconnect the power, then unplug the hot end from the extruder breakout board. Remove the fan from the heatsink and lossen the middle bolt then gently slide the hot end out. Carefully remove the nozzel from the heater block. Soak the nozzel in acetone till the built up plastic is soft then lightly brush it away for the outside of the nozzel. Use a small pin or twese to remove any plastic left inside the nozzel.
Wait for any acetone to eveaporate off then reassemble the extruded.
Test that extrusion is now working correctly using 3d print > matainance > extrude.

3D scanning - Weekly resources