3D scanning, on the cheap

I have this friend, Mr. Bot, he always has some cool magic trick up his sleeve.  Sometimes, it's sabering the tops off of wine bottles with a wine glass.  Sometimes, it's a mobile pool in the back of his Toyota truck.  This time, it was a brand new Microsoft Kinect. 

"What's that for?" I asked him. 

"3D selfies" 

My curiosity had been piqued. 

After a half hour of downloading, installing, and fiddling around on the shop computer, the system was finally set up properly.  Some troublesome googling yielded the correct Kinect SDK, and the black box Kinect was now ready to grok all the 3D information put in front of it. 

Showing me how to use the system, Bot poked around at some scan settings, sat down in front of the sensor on a swiveling chair, and spun himself around slowly so Skanect could build a 3D model.  This is accomplished by sampling many single sided depth maps and stitching the result together (which is why it's important to set preferences in the beginning, determining the depth of field to scan).

Before configuring the system thoroughly, Skanect was able to sample at 3-5 frames per second, requiring us to swivel on the chair at about 1 RPM.  This low sample rate is due to a few variables, primarily having a misconfigured graphics card.  I'm using a nice PowerColor ATI card (thanks CharlieX), but it seems that Skanect prefers the Nvidia family of cards to take advantage of their CUDA drivers.  My machine ran fine without the precisely specified card.   I've heard of Skanect running on a real flame-throwing computer at nearly 30 FPS, allowing the system to record detailed depth information in nearly real-time, and also mapped in full color!

Regardless of a little bit of lag, the Skanect software performed admirably.  One challenge with 3D models (and the resulting STL file) is continuity of surfaces.  Since STLs (and the raw data coming in from Skanect) consists soley of a very large point cloud, you can imagine that there's a few vertices which are malformed or unconnected.  Unconnected vertices pose a problem for 3D slicing programs, when the program is tracing the perimeter of a slice and suddenly sees a small but disconnected vertex, the slicing program usually vomits all over itself and forces you to tweak your model ever so slightly, which is usually a big pain when you have a million-plus vertices to inspect.  Not with Skanect, though.

Skanect has a few tools built into the software to prepare the model for printing.  In addition to unconnected vertex problems on the model, the depth of the resulting surface is also an important consideration.  3D modeling programs are quite picky about whether your model is either a surface (with no volume), or a solid model (with volume).  Depending on how you move around the scanner (you can also move the scanner around you) will determine whether the resulting model has a continuous surface, or it may miss some geometry at the top of your head, leaving you with a big gaping hole at the top of the model.  The "hole in the head" jokes get tiresome quickly, so be prepared.

Here's those "disconnected vertices" that can cause hell for your slicing program.  Luckily, Skanect contains some handy tools to solve those problems for you.  There's a "Watertight" command available which auto-magically fills in any gaps on the model, eliminating some of those missing, floating, enigmatic vertices. 

If you're using the demoware version of the software, you're limited to outputting models with 5000 faces.  That may be enough resolution for you, and it also keeps the files down to a manageable size.  Should you decide to spring for the paid version ($150) of the software, you can now save a much more complex model, sometimes surpassing a million vertices.

5000 polygons
1 Million Polygons

Striking resemblance, no?

It's hard to see in the image, but the sensor was even able to detect the fuzzy texture of my sweater that day.  The brown you see is undissolved support material (I was in a hurry to see this, and didn't wait around for the cleaning tank to finish).  The above model was well over a million vertices, and the file ended up being about 100 MB.  I never cease to be impressed with the fine rendering of organic curves by my Stratasys 3D printer.

Depending on how much of a graphics oriented computer you're using, and how well developed the slicing software is, that can put an unruly load on your computer.  Skanect also allows you to simplify the model to any number of target vertices you specify.  There's definitely a fine balance to be struck between resolution and file size.  One useful target is <25,000 faces, under which you can easily import the shapes into Solidworks, for more powerful 3D manipulation. 

For those of us on a budget, there's always MeshLab

An interesting command to know in MeshLab to change the face count of your model is "Quadratic Edge Collapse Decimation".  This command allows you to simplify your mesh to a target number of faces.  You lose some resolution in this process, but also may lose the unwieldiness of a humongous file.  This allows you to reduce the resolution on a model to the point that you end up looking like Max Headroom, glitches and all.

MeshLab also has some limitations for opening unwieldy files, so keep that in mind when you initially export the model from Skanect.  I've found it's easier to reduce the size of the file when initially processing the scan, rather than upon exporting the STL. 

Come by the shop sometime for a 3D printed selfie.  In the meantime, stay tuned to part 2 when we test the dimensional accuracy of the scanner against known references.

Bonus: if you're an LA / OC local, the Long Beach Public Library has a free 3D printing studio open during the week.  I HIGHLY recommend that you swing by and check it out, that's where I made the green print above.  The entire process from scan to print to walking out the door took about an hour.  They also have a seat of Solidworks on a public computer there (!), as well as some other powerful photo and video editing software.  It's a great way to get started with the scanning / printing process without spending a single dollar. 


Angry Electric Pickle

Years ago, my dad pulled off a memorable trick for a Halloween party.  He cut an extension cord in half and stripped the wires back a bit.  After connecting the hot and neutral wires to dinner forks ("What's he doing?" I thought), he set up an electrically isolated jig to hold a pickle which is now impaled on either end of said forks. Plugging the extension cord into the wall gave us a 120 volt pickle-colored light show, something like this one. 

Okay, maybe our light show that evening was not quite that scale, but you get the idea.  The yellow-green glow is actually the spectral emission of sodium, through a pickle filter.  (Would this be called an Organic Light-Emitting Diode?)  Think of the color of the Sodium lights we all know from streetlights.

One of the perks of hackerspace patronage is that you get access to things like bigger and better power supplies, and you can use those tools to facilitate thinking "out of the box".  

There is a 15KV neon sign transformer sitting on the back bench, but after some consideration, I worried about the pickle lasing onto my bare retinas, or emitting energetic x-rays if I used the wrong thoriated tungsten electrodes.  I wondered if I was thinking in the wrong direction. 

"Hey, that big TIG/Arc welder in the back is essentially a big low-voltage transformer that can handle a lot of abuse..." 

A few months ago, me and Harald were trying to solve a problem.  We had a hundred or so lengths of 3/4" mild steel bar that needed to have 90* bends in them.  There were too many bars for the amount of acetylene that remained squirreled away in the tanks, so we had to consider a heat source other than oxyfuel.  In his stereotypically overbuilt fashion, Harald remarked, "Maybe we could use carbon gouging rods" 

Carbon's melting point is roughly 6500F, it can surely handle the amount of heat from the torrent of electrons flowing through an arc.  Using a single electrode attached to a welding stinger, you can generate a powerful enough stream of electrons and photons to cut through thick chunks of steel.    Carbon electrodes are also used in electric arc furnaces, the heart of most modern foundries.  Giant electrodes flow tens of thousands of amps to melt large cauldrons of steel and aluminum.  Serious heat generating capability, for sure. 

So what happens, we thought, when we connect two of these electrodes together?  Better yet, who remembers the inanimate carbon rod that saved Homer Simpson and all those astronauts many years ago?  The inanimate carbon rod was also given the "Worker of the Week Award" in recognition of his long overlooked "tireless efforts" which the plant could not function without, earning a managerial position above Homer.  Heh heh heh. 
Have you ever seen a carbon arc lamp attached to a searchlight?  That's the type of brilliant photonic emission we're talking about.  Pure bright white light from a large electric arc between two carbon electrodes.  For a second, consider the vast amount of visible light emitting from this beam.  There's also a healthy amount of infrared photons, which is far easier to detect when you're up close and personal.

Harald and I put on our P.P.E. (safety third), connect the electrodes, flip the welder into AC mode, and strike an arc between the carbon rods. It took a moment to get the hang of scratch starting them together, and getting the arc gap set just right between my hands.  Playing around with the gap and the orientation of the electrodes allowed us to controlthe shape and the brilliance of the arc. 

We could only do this for about 30 seconds at a time before the residual oil on the backs of the welding gloves started to vaporize from the sheer intensity of infrared radiation of the arc.  Even after wrapping our gloves in aluminum tape, the heat was still too intense to bear for more than a brief moment.

I'll never forget the neighbor's surprise.  He saw our silhouettes outlined on the opposing building's wall and came over to find out WTF we were up to.  "I was wondering what you guys were doing" he remarked with a chuckle.

Harald and I wound up cold-working the steel bars.  Give me a lever long enough and a fulcrum on which to place it, and I shall move the world.

Problem solved, but now we have a bunch of useless carbon gouging rods. 

Or are they....

The arc welder and accoutrements are rolled out into the parking lot, along with the beefiest extension cord known to man.  A makeshift pickle jig is hastily cobbled together from a milk crate, duct tape, and pvc pipes.  We get the pickle and electrodes assembled on the rig, excitedly twisting knobs and flipping switches on the welder to get the AC settings just right.  After some fussing, gloriously brilliant results burst out as jets of plasma along the pickle's major axis. 

Unlike the parlor trick from Halloween from many years ago, this monstrosity is a significantly different energy source for the pickle light, causing a distinct "dual mode" effect.  ar the Halloween trick, at 120 volts coming out of the wall (15 amps at most), you're looking at 1800 watts of electric power.  Max.  With dinner forks, operating in low-energy mode, there's not so much of an electric arc as a dull glow reminiscent of a nightlight.  When attached to the welder, pushing 48 volts at 200 amps max, that's nearly 10 kw of pickle-colored goodness running full blast.

Here's another vantage point, from a previous event...


(for some reason, blogger isn't letting me embed this video).  Note in this one the jet of fire shooting out the sides of the pickle before it takes off with super-bright mode. 

Here's Trent from MAG Lab running the pickle rig.  Note the brilliant white light projected on a wall from the hole that the arc has burned through the pickle, directly emitting arc light. 

A diagram of our electric pickle jig -

The trick was in setting the arc gap just right.  Sometimes, the pickle would only steam, without generating any light at all, this usually happened due to misaligned electrodes.  Other times, it would only fizzle a little bit of light and give up; a dud.  After some experimentation, we found the more coaxially aligned the electrodes were to one another, the better the results.  It also helped to get the electrodes located correctly the first time, as subsequent stabs would turn the pickle's innards into mush.  When set just right, for the first 30 seconds the pickle emitted a nice gentle sizzling glow.  Once warmed up and excited, it would suddenly take off into arc lamp mode, and emit what must be at least a million times more photons.  Once in this excited state, raising the amperage makes the pickle go into overdrive. 

A gap between the electrodes of about 1/4" seemed to be optimal, but sometimes I'd have to tease the electrode ever so gently to scratch-start the arc.  Use caution, as this is a deadly amount of energy should the arc cross certain parts of your body.  Handling the pickle left me soaked in brine, which gave me a temporary but much-needed OCD hand washing complex.  Also, don't adjust the electrodes with both hands while the machine is running, only use one hand at a time, that will prevent stray current from crossing your heart. 

One mistake I should share, we initially made a pickle holder out of stainless steel, trying to get the weight off of the electrodes.  After ignition, a stray arc made quick work of the holder, quickly slicing off a support arm. You can see remnants of it in the second video on this page. 

The Angry Electric Pickle is a neat parlor trick, and was a definite draw for the Sparklecon crowd.  Try it at your next party to win friends and influence people.  If you don't electrocute yourself, let us know how it goes.  If you DO electrocute yourself (and survive), let us know how it goes.  Whatever you do, make sure that you have a buddy standing by with a wooden baseball bat to slug you to safety, should any electrical mishaps occur. 

Happy scienceing!