Background information

How difficult is it to build a 3D scanner?

Kevin Hofer
16.3.2020
Translation: machine translated

I am a passionate tinkerer. Hardware suits me, but software is always a problem, as my latest experiment shows: I'm trying to build a 3D scanner.

While browsing through Thingiverse, I came across this thing. Designer QLRO has built an open, Arduino and Android-based 3D scanner. I want something like that too.

How does the scanner work?

The 3D scanner consists of a 3D printed platform that is driven by a stepper motor. You place the object of your desire on the platform and an Android smartphone photographs it from different angles while the platform rotates. Once the pictures have been taken, you transfer them from the smartphone to the computer to create a three-dimensional image in Meshroom, a 3D reconstruction software. Sounds simple? I think so too, especially as the designer QLRO points out that his design is minimalist and functional.

Far from it. I've almost run out of hair and the ones I have left I'm almost tearing out during the project.

This is what it takes

First, I print out the platform. It consists of six parts and includes a gear mechanism. Thanks to my 3D printer Creality CR-10S Pro, the parts are printed in just over eight hours.

Furthermore, I need a stepper motor that drives the platform via the gear mechanism and a stepper motor driver that enables communication between the motor and the Arduino. This product contains both in one.

In order for the platform to turn, I need an Arduino. I still have an Arduino Nano from my floppy music project.

  • Background information

    Play that floppy music white guy: Music with old drives

    by Kevin Hofer

Building the platform and connecting the stepper motor with the stepper motor driver and the Arduino is done quickly. As I said, I don't usually have any problems with hardware. Everything is running smoothly so far. So we can continue.

I have an Android smartphone, a computer and a network that includes the smartphone and computer at home. Time to install the software.

Hardware aye, software nay

In terms of software, I need to install Meshroom on my computer so that the photos taken by the smartphone can be assembled into a three-dimensional image.

Arduino IDE is also required. I need the software to load a script into the Arduino to make the stepper motor turn.

Finally, I also need Python for computers and smartphones.

This is where it starts for me. I've worked with Python scripts before, but each time it took me ages to get my projects up and running.

The big problem this time: In order for the computer and smartphone to communicate with each other, I have to run a script on both. I'm already having trouble transferring the script from the computer to the Android smartphone. In QPython, the app that allows me to run Python scripts on the smartphone, I'm shown an empty script. In other words: If I run it, nothing happens.

I'm pulling my hair out for the first time. But not for the last time.

For some reason, QPython can't read the transferred script. I therefore try to create the script in QPython directly. Copy Paste from Git Hub doesn't work, because everything is pasted on one line in the QPython editor. So I first copy it into Google Docs and then into the editor - a stupid idea, as I find out later. At the moment I just think: Yes, everything is correct now. It added a few extra lines, but they are quickly cleaned up again.

I let both scripts run for the sake of experiment. With the Android script, which is called Server.py, I already get an error message at the line with the COM port that I have to specify.

What have I done wrong? A few hairs are falling out again.

After a bit of trial and error and asking my colleague Jon Andri Hoppler, who unlike me knows a thing or two about Python, the problem is quickly solved. Jon can also help me a few lines further down, with the server. But then comes something that neither he nor I understand:

Everything should actually work here. What's the point? I don't even have to pull my hair out anymore, it falls out automatically. If this continues, I won't have any hair left at the end of the project.

I rack my brains for a long time. Until I finally remember why I work with scripts on the computer using Notepad++: nothing is formatted here. Have I perhaps copied the wrong formatting into Google Docs? I delete the spaces before the code and run the script again. Yes, I get one line further.

I delete the spaces here too. Again, I get one line further. I repeat this for the rest of the script. I run it again. Finally: The smartphone is now ready to communicate with the computer. I run the Client.py script there and I see what I want to see: the platform rotates, QPython says "Photo Taken" after each photo and the progress is also displayed on the computer.

Yes!!!

All's well that ends well?

My smartphone shoots 180 pictures. According to the designer QLRO, this is necessary to optimise the quality of the 3D model. The first thing I put on the platform is a Brio bridge - just what you have lying around as a father.

Then I connect my smartphone to the PC so that I can transfer the images and create a three-dimensional model with Meshroom. The images should be in the QPython folder.

Should be.

I can't find any images. WTF? I try again. No images again. I change the storage location in the script and start the process again. Still no images. I was so happy that it was finally working and that I still had hair. Now there are a few less again, by the way.

After doing some research in the comments on the QLRO thing, I realised that I had given QPython permissions on my smartphone, but not for the camera. I did that and now it actually works. I finally have 180 pictures of a Brio bridge on my smartphone - I've always wanted that.

Now I "only" have to convert the individual images into a three-dimensional image using Meshroom. Software again. I'm dreading it. Nevertheless, I at least try to import the images. Shit, I get an error message: "Not a PNG file." For every damn one of the 180 images. Now I've definitely had enough and need some space before I go completely bald. I'll try again in a few days. I'll tell you if and how it worked out in the sequel. Later this week. I promise.

26 people like this article


User Avatar
User Avatar

From big data to big brother, Cyborgs to Sci-Fi. All aspects of technology and society fascinate me.


Gaming
Follow topics and stay updated on your areas of interest

Computing
Follow topics and stay updated on your areas of interest

These articles might also interest you

  • Background information

    What is the DIY 3D scanner good for?

    by Kevin Hofer

  • Background information

    My own NAS system – Part 4: searching for the right hardware

    by Richie Müller

  • Background information

    3D printers made from old drives: an experiment that failed late in the game

    by Kevin Hofer

3 comments

Avatar
later