FaceCube: Copy Real Life with a Kinect and 3D Printer

by nrp, published

FaceCube: Copy Real Life with a Kinect and 3D Printer by nrp Mar 5, 2011

Featured Thing!

0 Share
Download All Files

Thing Apps Enabled

Order This Printed View All Apps



Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

7476Views 1970Downloads


This project is documented at my blog http://eclecti.cc/hardware/facecube-copy-real-life-with-a-kinect-and-3d-printer , but I will summarize it here.

This project is a tangent off of something cool I've been hacking on in small pieces over the last few months. I probably would not have gone down this tangent had it not been for the recent publication of Fabricate Yourself. Nothing inspires me more than when someone does something cool and then releases only a description and pictures of it. Thus, I've written FaceCube, my own open source take on automatic creation of solid models of real life objects using the libfreenect python wrapper, pygame, NumPy, MeshLab, and OpenSCAD.

The real magic comes from when you take advantage of all that OpenSCAD has to offer. Make a copy of yourself frozen in carbonite, put your face on a gear, or make paper weights shaped like your foot. This is also where the name FaceCube comes from. My original goal going into this, I think at my roommate’s suggestion, was to create ice cube trays in the shapes of people’s faces. This can be done very easily in OpenSCAD, involving just subtracting the face object from a cube.


The process is currently multi-step, but I hope to have it down to one button press in the future. First, run facecube.py, which brings up a psychedelic preview image showing the closest 10 cm of stuff to the Kinect. Use the up and down arrow keys to adjust that distance threshold. Pressing spacebar toggles pausing capture, to make it easier to pick objects. Click on an object in the preview to segment it out. Everything else will disappear; clicking elsewhere will clear the choice. You can still use the arrow keys while it is paused and segmented to adjust the depth of what you want to capture. You can also use the H and G keys to adjust hole filling, to smooth out noise and fill small holes in the object. If the object is intended to have holes in it, press D to enable donut mode, which leaves the holes open. Once you are satisfied, you can press P to take a screenshot or S to save the object as a PLY format point cloud.

You can then open the PLY file in MeshLab to turn it into a solid STL. I followed a guide to figure out how to do that and created a filter script attached below. To use it, click Filters -> Show current filter script, click Open Script, choose meshing.mlx, and click Apply Script. You may have to click in the preview, but after a few seconds, it will say that it Successfully created a mesh. You can click Render -> Render Mode -> Flat Lines to see what it looks like. You can then click File -> Save As, and save it as an STL. You can probably get better results if you manually pick the right filters for your object, but this script will be enough most of the time.

You can then open the STL in OpenSCAD or Blender and scale it and modify to your heart’s (or printer’s) content.

Since all of the cool kids are apparently doing it, I’ve put this stuff into a GitHub repository. Go ahead and check it out, err… git clone it out. The facecube.py script requires the libfreenect from the unstable branch, and any recent version of pygame, numpy, and scipy. You’ll need any recent version of MeshLab or Blender after that to do the meshing. I’ve been using this on Ubuntu 10.10, but it should work without much trouble on Windows or OS X. The latest code will be on git, but if you are averse to it for whatever reason, I've attached the script and the meshlab filter script below.

git clone [email protected]:nrpatel/FaceCube.git

All Apps

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Print through a distributed network of 3D printing enthusiasts from across the US, at a fraction of the cost of the competitors. We want to change the world for the better through technology, an...

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

Treatstock is an online platform that offers decentralized manufacturing services such as 3D printing and CNC machining for business-to-business and business-to-consumer sales all over the world. W...

App Info Launch App

3D print your favourite design with NinjaPrototype, a professional 3D manufacture with consistent quality and speed.

App Info Launch App

Would like top see if your interested in collaborating on robotic farming project. I was looking into using the kinect camera to scan plants for robotic handling. see http://www.firstfruitsfarms.comwww.firstfruitsfarms.com and email me if you are interested. We use python.


This is brilliant project. I don't have Kinect so I simply used my iPhone for 3d scanning at http://www.my3dscanner.comwww.my3dscanner.com

The script for MeshLab worked great for meshing my point cloud.

I managed to compile everything and capture a pointcloud. Having some trouble with simplifying my model enough that RepG can even load the STL file. Will have to tinker more tomorrow!

Hey,t hanks for sharing. I bought a kinect a month or two ago to work on a similar project, and I'd gotten as far as scanning and printing my own stuff... it's great that you've put together your own software for this!

Thaks for sharing !! Very cool. I need to buy a connect now... So many toys .. so little time.. :-D