Introduction: GotMesh: the Most Cheap and Simplistic 3D Scanner.

Picture of GotMesh: the Most Cheap and Simplistic 3D Scanner.

got mesh? is the most cheap and simplistic open source 3D scanner.

If you liked this instructable, please vote for it in the 3D Printing Contest 2016.

got mesh? allows owners of 3D printers to easily recreate detailed difficult to model objects to later 3D print. The goals for this project was to make the simplest 3D scanner possible with low cost materials from around the house to scan 3D printable ojects. This idea to use milk as a scanner can be first seen here, proposed before 3D printing exploded. Our version is a lot simpler and is more automated and is geared towards 3D printing.

The system at its core uses draining of a large tub of opaque liquid to create contours between the liquid and the object to be scanned. The contours are captured by your favorite time-lapse device (DSLR, smartphone, etc.) and then imported into a folder on your computer. A python script that employs OpenCV converts the collection of images to a 3D point cloud mesh of .xyz format. If desired the output file can be converted into an .stl file for 3D printing by a program like MeshLab.

This project was originally entered in HackPSU 2016 and received second place overall. We are also on Devpost (on the homepage as the time of writing this), check it out here.

Step 1: Gather Your Supplies

Picture of Gather Your Supplies

Because got mesh is so simple, this list will be very brief:

  • ($0) picture taking time-lapse device: This can be any device that takes fast paced time lapses. For our first iteration we used an Android smartphone and a free app called Auto Camera.
  • ($12) two stack-able plastic bins: The idea is the top one will drain into the other creating the full range of contours overtime. For our first iteration we used two stack-able bins from Walmart.
  • ($3) opaque liquid / dye: It needs to provide good contrast against the image. For our first iteration we used milk but it cast a fairly strong glare so I would recommend trying food coloring.
  • ($0) phone holder: This serves to suspend the phone over the liquid to take the time lapse. It could be made out of one of the lids. For our first iteration, we used a piece of HDPE plastic and drilled a hole in it.
  • ($0) string: It is to allow you to pull the stopper when ready.
  • ($0) hot glue nub: This serves as the stopper to prevent the liquid from flowing into the lower box.

Step 2: Assemble the Parts

Picture of Assemble the Parts

Again, not too difficult so the following steps are:

  • Drill a hole (1/8" or smaller) into the top bin.
  • Shape the hot glue nub into a cone that fits into the previously stated hole.
  • Thread the string into the hot glue nub to it will stay together when it is pulled.
  • Cut your piece of material to hold your time-lase device so it securely straddles the top bin.
  • Drill a hole for the camera to see through.
  • Remove the handle of the lid of bottom bin / drill a hole larger than the first one allow for the liquid to flow from the top bin to the lower one.

Step 3: Get the Code

Picture of Get the Code

I wrote a short python script that uses OpenCV that takes a series of images (only images for now) and allows you to find the contour for each of them and then exports the set as an .xyz point cloud mesh format. From then we will use meshlab to convert the .xyz point cloud into an 3D printable .stl file.

The git repository that contains the code is here.

Step 4: Scan for Images

Picture of Scan for Images

At this point we need to get the series of images to import into the computer for processing.

  • Stack the bins one on top of another with the stopper inserted into the top bin.
  • Fill the top bin with the opaque liquid and the object to be scanned.
  • Place the phone and phone holder over the top bin.
  • Start the time lapse for a picture every second or two (depending on your top hole size) and pull the plug to drain the top container.
  • Then take the time lapse photos and put them into a folder on your computer.

Step 5: Create the .xyz Point Cloud File

Picture of Create the .xyz Point Cloud File

Using the python script on the git repository and the instructions on the git repository, run the script. A black screen with a few white lines indicating the calculated edges (using canny edge detection). The next step is to minimize wherever an edge is not supposed to be and make the edges appear clearly where the object is by adjusting the two top bars. When the selected image is correctly outlined you can click start to move onto the next image. If all the images seem like one setting is working well, you can click save settings to automatically process all remaining images with those settings. When you are done, an output .xyz file will appear. This tool will be changed to have a better UI in the future when I have more time.

Step 6: Using MeshLab

Picture of Using MeshLab

Finally, to generate an .stl for 3D printing, we will use MeshLab. First open MeshLab and click File ---> Import Mesh... and select the .xyz file. Next select unwanted artifacts with Edit ---> Select Vertexes and delete them with "Delete the current set of vertices" in the toolbar. Then click Filters ---> Normals, Curvatures, Orientation ---> Compute normals for point set to prepare the point cloud for conversion. Finally click Filters ---> Point Set ---> Surface Reconstruction: Poisson for surface reconstruction. Try out different parameters as each scan will turn out differently. Then to export as an .stl click File ---> Export Mesh As... to export as an .stl.

Step 7: Wrapping It Up

Picture of Wrapping It Up

I hope you found this instructable useful and I hope you find the GotMesh project also useful for general model reconstruction in conjuncture with 3D printing. 3D scanning can get complex and expensive and this was an attempt to simplify some of the DIY process and keep the costs almost nonexistent. I will try to continue to update some of the design but mainly the software so stay tuned for updates. Thank you for reading this and good luck with your 3D endeavors.

If you liked this instructable, please vote for it in the 3D Printing Contest 2016.

Step 8: UPDATE TIPS

As I have learned the hard way milk goes bad quick but provides the best interface by far when compared to diluted paint, soda and food coloring. One solution to this is trying ultrapasteurization or beyond as no one will drink it anyway. This would be accomplished by heating it beyond 275 *F. I will try to post the best method for doing this.

Thank you very much for liking and commenting on this instructable.

Comments

aklesh3 (author)2016-10-27

Instead of adding salt how about using salt insteaqd of a liquad? have the salt drain out like in an hourglass.

JohnC430 (author)2016-04-26

thanks for sharing. very clever approach.

how many viewing angles are needed if there are overhangs? do u need to take a set of pictures from different angles for over hangs? how does this work?

thanks

seamster (author)2016-04-13

This is a really clever idea. I enjoyed seeing what you've done.

The comments on the older post you linked to are interesting, and address a lot of the thoughts I had while considering your take on this method. Worth a look for anyone interested :)

Nice to see the direction you've taken this. Thanks for sharing!

Azafran. (author)seamster2016-04-26

cool! that's really nice inspired idea for similar process this simply príncipe blow muy mind, thnks forma share. sharing is caring

awsome ninja (author)2016-04-22

The cheapest not the most cheap I think.

SERaGON (author)2016-04-19

So as good as in 2007

https://www.youtube.com/watch?v=XSrW-wAWZe4

SergeE (author)SERaGON2016-04-19

A little too manual - spooning milk in the scanned container and clicking to take the image every so often. GotMesh is no more expensive and much less work for scan don't you think ?

SergeE (author)2016-04-19

Often, the simpler ideas are the best. The concept presented here is great and quite economical compared to alternatives for 3D scanning. It can also be very effective.

There are a couple of issues to solve to make it even more versatile. None are show stoppers, as seen in previous comments. They just need further thought.

Someone mentioned just making several scans, changing the object's position; taking more time but very effective at addressing odd shape objects and keeps overall cost down. At worse, 6 scans should be needed - each face of a 'cube'. Doing more would imply overhangs (hidden spaces / voids). Still possible with approach taken here, just more work to scan and then stitch resulting meshes.

The use of a clear liquid with a floating layer of (near) opaque "oil", whether it's taking the images from the top or bottom (liquid proof camera needed) address problem of the milk going bad at some point, cost and recycling of the liquid, ... down to contrast with object to scan by changing the colour of the floating "oil". There is always the possibility of changing the colour of the object itself - quick layer of (removable) paint (ex: matte black to contrast with shiny white milk). It needs to be thin none pooling, so it doesn't change the object shape during the scanning process.

Giving the use of liquids, the object to be scanned needs to be water proof and 'solid' (not porous) so it does not absorb the liquid, especially one which spoils. Depending on the object, solution would be to apply a sealer. It might also help colour and/or take the glare out, depending on the sealer being used.

The use of a very fine powder would introduce need for shaking to keep surface level flat (a consistent 'water line' tracing the object) BUT it would also require a fixation method for the object (avoid object from moving around !)

The effect of the objects shape on the Z resolution, as indicated by others, can be addressed in several ways. The simplest could be to register the height of liquid's surface over time. It would then be sync'ed with the time stamp of the images. A simple approach might be using the OSD (on screen display) concept. That is, to have a readout of the height within the field of view of the camera which then gets processed by the software to 'read' the display (fixed location and height) and 'set' the Z accordingly. The resolution of the readout would have to be as precise as a 3D printer's Z axis. I suspect a float rigged to some sort of digital micrometer ? It might not be 'cheap' enough. There might be a way to do this purely a mechanical display : the float rigged to a precise 'ruler' positioned parallel to the camera's field of view. As the float follows the liquid's surface, it moves a marker along the ruler; marker is high enough contrast that software can pick it up and calculate position. The camera's resolution, along with the marker shape/contrast, becomes the limit for the precision of the calculated Z. There might not be even a need for a ruler - just a reference point and knowing the camera's resolution.

The GotMesh 3D scanning concept can be a very viable low cost approach to get precise mesh of just about any liquid proof(ed) objects of any size. Of course, I'm not ready to dunk my car to get a 3D model of it, but it would be possible (and out there, there's a person thinking about it now - LOL)

Way to go YenFre, kudo's to you. Fantastic idea !

I think I will try this to scan the body/shell of my model (1/10 scale) monster truck. Blacken the shell using something like Pasti-Dip paint (it can be peeled off 'easily' without damaging), scan it with GotMesh, then modify the resulting mesh to make my own version. Resulting 3D model could be CNC'ed to make a mold to thermo form a new customized shell. The hardest part, for me, would to paint the body in some catchy pattern. Tada... I end up with a very unique monster truck at minimal cost !

I just Gotmesh'ed ! And I'm loving it. ;))

DefiantZombie (author)2016-04-16

Have you tried a combination of super fine sand and vibration to level the "layers"? Just a thought that occurred when I came across this build. I will be trying this when life settles down again.

gcb4567 (author)DefiantZombie2016-04-16

No I have not but that is a really good idea. I will have to try it. Thank you for commenting and throwing that out there for everyone.

ronald.ferreira.39 (author)2016-04-15

do you have a video its hard to understand this steps

Not yet. I will try to post one by this Monday. Thank you for the interest.

rievezahl (author)2016-04-15

Nice work, man, i love that super-simple idea!

However, if i understand it right, then i see another one but way less problematic flaw next to the "bottom half"-thing: the z-axis-reference. it looks like you constantly release the milk by its natural flow, which first follows a somewhat complicated diferential equation due to the constantly changing height and corresponding pressure of the liquid.

Secondly even if id did flow constantly, the liquid height would change faster where the object is bigger, consuming more of the volume, so the milk-volume in this height region is removed faster than where the object is small. Of course, this effect might be negligible when using large boxes and small objects as you do.

What i want to say is if you want to get a precise and undistorted image in the z-direction, you would have to reference each image of the time lapse not to the time itself, but to the actual liquid height at that time. Idk exactly what the expenses of employing a precise liquid height measurement would be, but it would make this wonderful machine even work in accordance to physically correct principles!

And another thing i'd like to mention: I would suggest using soy milk, because it is super cheap and easy to make yourself in large amounts and even easier if its not intented for human consumption!

Now i hope i dont come about like super-arrogant, but these were the thoughts that struck me right after "oh god how awesome is this thing?!!".

MikB (author)rievezahl2016-04-16

> exactly what the expenses of employing a precise liquid height measurement would be,

You could always use another camera giving a side view of the milk level (either against a ruled scale, or just using OpenCV to find the level of the milk in the picture). Then it would be a case of taking pictures with the side-view camera to find the right time to trigger the main camera.

Or, you might do it on a single camera if you can use a mirror (angled) to get a look at the milk level in the same field-of-view as the contour image. Then it becomes a case of taking (and throwing away) images until the milk level has moved by 1 "unit" of depth, and retaining that image, before repeating the process.

Ingenious scanning method :)

gcb4567 (author)MikB2016-04-16

Thank you for the comment. Yes, the precision of the Z-height could certainly be improved using another camera. A mirror is a great way to still use one camera. Thank you for sharing. Additionally the camera could keep taking pictures but the script (program) could align them based on their position instead of waiting to take pictures based on the height.

gcb4567 (author)rievezahl2016-04-16

Thank you for the comment. You bring up a very good point I did not think of that the shape of the object will vary the surface area cross-section and therefore drain rate. We did try to account for the difference in flow rate from the height the of milk but we did not account for it in terms of the object itself. I will continue to thing about a solution to that. Also, I will definitely try soy milk. I am glad you enjoyed this project.

JohnB78 (author)2016-04-16

I wouldnt use milk, but maybe salt or baking soda

gcb4567 (author)JohnB782016-04-16

Thanks for the comment suggestion. I have tried both and from my experience milk works better as the liquid to be drained must be completely opaque even at very thin thicknesses but I may have not added enough salt or baking soda.

td10 (author)2016-04-14

Clever idea. I dont know much chemistry but could you float a thin layer of oil for example and then float an multicoloured LED that would only colour or maybe flourese that thin layer. Then you could use the same liquid and change the colour for maximim contrast with the item you are scanning. Then you could take an underwater picture at the same time - the underwater camera might not work if lower liquid not transparent.

gcb4567 (author)td102016-04-14

Yes, if you could float a thin layer of oil, you could use it to take pictures from another direction. Illuminating the liquid may work better than the milk as it may give a more dynamic contrast. I will have to try that. Thanks for the comment.

td10 (author)gcb45672016-04-14

Maybe also add something like cornstarch or photocopier toner into the oil to make the layer less translucent.

grayl (author)2016-04-13

Am I right, this would only work for a shape that 'grows' as the fluid drains? It would not work for something like the bottom half of a sphere.

gcb4567 (author)grayl2016-04-13

You are correct. One solution to this problem is that you would have to rescan the object and import all the points into one mesh (can be done in MeshLab). If the object has symmetry, you could instead mirror the object. My goal was to create the cheapest 3D scanner with a unique method of functioning. Thank you for your comment.

grayl (author)gcb45672016-04-14

Well done! You certainly get the most bang for a buck spent on creating 3D scans

About This Instructable

40,756views

274favorites

License:

More by gcb4567:RoboCan DIY Custom Lettering from Old T-ShirtsGotMesh: The most cheap and simplistic 3D scanner.
Add instructable to: