Programing in Processing – Creating 3D Printable Files

In order to convert a 3D graphical object on the screen to a file in which a 3D printer can print, you will first need to import the library OBJExport. The link to the library can be found here.

The sample program is below. The OBJ file is written in the folder Processing3->libraries->OBJExport->Examples folder unless you specify otherwise.

You may have to “fix” your object in Meshmixer, a free Adobe program, to fill in any holes in the object.

Example Program

import nervoussystem.obj.*;

boolean record;

void setup() {
fullScreen(P3D);
smooth();
}

void draw() {
background(0);

if (record) {
beginRecord(“nervoussystem.obj.OBJExport”, “test.obj”);
}

fill(255);
translate(width/2, height/2);
box(100,100,100);

if (record) {
endRecord();
record = false;
}
}

void keyPressed()
{
if (key == ‘r’) {
record = true;
}
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s