Skip to content

DIY -> one red line laser, step motor, raspberry pi, python and pygame, point cloud to MeshLab

License

Notifications You must be signed in to change notification settings

octopusengine/simple3dscanner

Repository files navigation

simple3dscanner

It is only the first step - and my first project here.
I would be very happy to see people "testing" or forking this and creating bigger and better versions ;-)
I'm also grateful for any advice, error correction or recommendations how to proceed...

fig5-ball-schematic.jpg

Also look at pictures in a directory images - it was a hard job to explain how easy principle I use ;-)

What do you need for program testing?
For imperfect testing you can use only Raspberry pi 2 and lowcost webcam, without step motor.
set only:
piCamera=0
webCamera=1

But I recommend faster Raspberry pi 3 and Raspberrypi camera (full HD)
piCamera=1 is deafult setting

Program scannStart.py works in Python 2.7 with Pygame module

How setup ramdisk (temporary files)?
sudo mkdir /home/pi/ramdisk
sudo nano /etc/fstab
and add the line
tmpfs /home/pi/ramdisk tmpfs defaults,size=100M 0 0


simple starting on your Raspberry pi:
sudo python scannStart.py [projectName] [numberOfScann]
numberOfScann = rotation steps

What more do you need for scanner testing?
red line laser, voltage source 12V + step motor with driver
I am using Nema and A4988

picture of hardware - first alpha edition (with one laser):
scanner-hardware1.jpg

schematic:
http://www.octopusengine.eu/2016gal/scanner-schematic.gif


220V > 12V

220V.jpg



Camera and laser detail:

camera.jpg


laser.jpg



simple idea - how to create points cloud:

loop {

take a picture

recognize red line

transform to xyz

}

example of processing
https://www.instagram.com/p/BEYRg99R7TE/?taken-by=octopusengine


fig6math.jpg


How to convert found a red dot to xyz coordinates?
https://www.mathsisfun.com/polar-cartesian-coordinates.html
When we know a point in Polar Coordinates (r, θ), and we want it in Cartesian Coordinates (x,y) we solve a right triangle with a known long side and angle


Point cloud file xyz is simple "txt" format:
x1 y1 z1
x2 y2 z2
...
xn yn zn

for exaple 5 points:
-14.7657331345 -8.525 177
-10.7387150069 -6.2 178
-1.34233937587 -0.775 179
32.2161450208 18.6 288
41.6125206518 24.025 311
49.666556907 28.675 318

For treatment use program MeshLab
MeshLab is an open source, portable, and extensible system for the processing and editing of unstructured 3D triangular meshes. The system is aimed to help the processing of the typical not-so-small unstructured models arising in 3D scanning, providing a set of tools for editing, cleaning, healing, inspecting, rendering and converting this kind of meshes.

How import point cloud (yourFile.xyz) to MeshLab software?
Basic step:
File / Import mesh...


History:

2016/04
0.10 first experiment, it works! I was really surprised ;-)
0.20 my first "open source" post for GitHub
0.30 oeHelp, oeGPIO
0.33 filter1 - digital filter Xn=aver(Xn-1,Xn,Xn+1)
2016/08
testing on Raspberry Pi 3
small bug correcting


ToDo:

better user input / GUI (Pygame?)
faster computing / C library or Cython testing
second line laser (FET transistor switching?)
digital filter - RAW data 2D filtering
light detection / daylight.. color of object..
converting to STL

Licence:

MIT
Copyright (c) 2016 Octopusengine.eu

About

DIY -> one red line laser, step motor, raspberry pi, python and pygame, point cloud to MeshLab

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages