homemade 3d scanner - the working principle
 
more info
setup:
the basic setup consists of a line laser module, a pc cam and a stepper motor controller card connected to one stepper motor.

the laser is mounted on top of the stepper motor axis. the camera is placed at a well defined position with respect to the laser (the maximum detail resolution of the digitized part is determined by the resolution of the stepper motor, its gearing and the resolution of the cam).

the object is placed in front of the cam in such a way that as much as possible of it is visible to the cam. at the same time the laser should be able to sweep the entire part, generating a well visible line on the object.

scanning procedure:
1) turn on laser
2) get image from cam
3) analyze image, find laser line
4) calc 3d position of line points
5) move laser
6) loop 2 to 5 until done
7) turn off laser
8) mesh points

calculating the position of the points in space is actually pretty simple vector algebra:

λ×c = d + η×l1 + μ×l2

where
c direction vector of cam pixel
d position of laser wrt cam
l1 first laser beam vector
l2 second laser beam vector
l1 and l2 define the plane that the line laser generates

the above is a system of three equations in the three unknowns λ, η and μ. it can easily be solved and the spatial coordinate of a single point is found.
working principle