Monday, December 30, 2013

Building 3D Printers

Building 3D printers is hard. No joke. Anyone who tells you otherwise has either never built, or is trying to sell you something.

My Clonedel took me about a summer to put together. That's about 3 months to put together something that someone else already knew worked. And that's just mechanical; calibrating your printer just right is an endless process.

WOOF, the 3D Printing Club at UW also released another set of kits called the Grawmet. I scooped up two kits about a year ago. One kit is mechanically complete (But not tested), and the other isn't even started. A large part of this is motivation -- I definitely don't work on it all the time. But a large factor was that it was an alpha design: Totally untested. This made it a bit disheartening to work on, since a large amount of time was spent figuring out how to make the damn thing work, rather than just putting together pieces!

So what did I learn? That building a 3D printer is harder to do if you're the first one to do it. You have to figure out all the bugs, and the decisions you make will affect everyone who builds it.

I've never felt that the printer kits I have built were designed to be built. They used inefficient methods (Just look at the number of bolts required for a Mendel!), or weren't well thought out, or just weren't nice.

So, being motivated by being asked to build a printer for the MSE department I made the decision (mistake?) to design my own.

I, of course, failed miserably. To quote a great doctor: "Dammit , Jim, I'm an MSE student, not a mechanical designer!"... or something like that.

I like reminding myself of my failures, so the next few posts will be chronicling this ongoing journey.

Saturday, August 3, 2013

Sculptris to Shapeways with texture

I got into Sculptris a while back, and it's a great (free) program to sculpt organic objects. Only recently did I start painting the objects that I sculpted, using Sculptris' built in painter. It works wonderfully... right up until you want to export anything. The issue that everyone runs into is that the texture that you just painstakingly made is not attached to the .obj that you export!

Many sites advise the following:

"Export the texture map, and apply it in another program"

This is almost the most incredibly useless advice I have ever seen on the internet, for a couple of reasons.
  1. If an explanation that is this vague helps you, then you must already be familiar with mapping textures to 3D models. If you are just starting with 3D modelling and texturing, then you're out of luck.
  2. Sculptris does not, by default, show the option to export the texture map, which can be a bit confusing at first.
  3. When you export the texture map and .obj, Sculptris does not create an essential file for the mapping process!
Number 3 on that list is the real killer. You can understand how Sculptris works, and you can understand how your mapping program works, but unless you delve into the intricacies of the .obj filetype, you're never going to get the texture to map.

How to Export Textured .obj Files from Sculptris: The COMPLETE Guide

I am going to outline every step that I take when creating a textured model from Sculptris. A lot of this may seem obvious, but I want this tutorial to be accessible to anyone, even if you've never exported from Sculptris before.

Here we go!


Once you're done painting, select "Show Advanced Tools"

From the buttons that appear, press "SAVE TEXMAP"
(TEXMAP stands for "Texture Map")

Save your file. It's best to create a new folder, since we will have quite a few files by the end.
(You should choose a simple name; you will be typing it often from now on)

Next export your .obj by selecting the "Export" button.

Save the .obj in the same folder as the TEXMAP.
Use the same name as your TEXMAP.

CHECKPOINT: We now have two files (.png and .obj), both named "catbug_tex", saved in the same folder.

Open the .obj in a text editor

I'm going to take a quick break here to discuss the .obj file type. It is a very common format, but it's not without its faults. An .obj does contain the information for its texture within the file. Instead, it relies on a ".mtl" file to describe how the texture is mapped to the mesh.

If you check back in your folder, you'll notice that you don't have a .mtl file! Sculptris does not automatically generate one for you. We're going to have to create it ourselves.

But we're getting just a bit ahead of ourselves. Let's go back to the .obj, opened in a text editor.

Notice the highlighted line: "usemtl (null)". Null is nothing, zilch, nada. In terms of computing,
it means that it is "pointing" at nothing.

This isn't good! We want the material used to be something, not nothing! We'll make two changes
to the file to fix this.

Here are the two changes made.
A quick break again to explain the changes.
  1. Delete "(null)" on the line that says "usemtl (null)".
  2. Add "material_0" after "usemtl"
  3. Add "mtllib catbug_tex.mtl" to a new line, above "usemtl material_0"
Please take care to notice the spelling. If you misspell anything, your texture will not apply.
Another note: "catbug_tex.mtl" is the name of my .obj and TEXMAP. Change this to match yours. 

The new code should read:
mtllib catbug_tex.mtl
usemtl material_0 

Click save, and exit the text editor. There should be no apparent change in your file folder.
Next, create a new document in the text editor of your choice.
Add the following code to your new text document.
The code should read:
newmtl material_0
map_Kd catbug_tex.png
Please note: replace "catbug_tex.png" with the name of your texture!

This will be the entirety of our .mtl file. A brief explanation:

On the first line we are creating a new material, named "material_0". This material is the one that is referenced as "usemtl" in our .obj file. The spelling of these references must be the same, or your texture will not be applied.

On the second line, we are telling the file what image will be mapped to this material. This image is the texture exported from Sculptris. The spelling of these references must be the same, or your texture will not be applied.



*****Check and double check that you are writing these lines correctly! I got stuck for a very long time because the website I was following did not display underscores, and used spaces instead. You don't get an error or a warning, just a model without a texture.*****


Now that we've written our .mtl, save it in the same folder as the model and TEXMAP.
Select "All files" next to "Save as Type:"
Name the file: "Your_Model_Name.mtl"

Checkpoint: An .obj, a .png, and a .mtl, all named the same!

Now open up Blender. You should see this scene.

Right click on the cube to select it, then press delete.

Now that we have a blank scene, we can import our model.
Go File->Import->Wavefront | .obj

Navigate to and select your obj.

And in comes your model! Now is the time to orient and scale your model, because you can't later.

Now simply export your file!
Shapeways accepts .x3d files, so that's what we'll choose.
Go File->Export->X3D Extensible 3D | .x3d

Save your .x3d in the same folder as your original .obj, with the same name!

Checkpoint: We have 4 files: an .obj, a .png, a .mtl, and a .x3d, all named the same.

Just to double check, let's view our textured model in Meshlab. Open Meshlab and select "Import Mesh".

Navigate to and select your .x3d,

SUCCESS! A colorful Catbug!

Close Meshlab (Don't save), and go back to the folder with your .x3d file.
Select both the .x3d (The model) and the .png (The texture).
Right click and select "Add to Archive". (If you don't use WinRAR, zip these in your preferred program)

Save the files in "Your_Model_Name.zip"
Be sure to use .zip, not .rar, or .7z, or something.

Checkpoint: All 4 files, plus the zipped files. Upload that .zip to Shapeways, and get your full color goodness on!

Conclusion:

I hope this helps people using Sculptris bring their designs to life. It's a fantastic (and free) software, but being unable to export automatically textured .obj files is a huge pain.

Taking these steps has given me a textured model every time. Some people suggest applying the texture in blender, either through UV mapping or through its painter, but Blender's UI can be a bit daunting, especially to a new user. With this method, all that is required of Blender is "Import the .obj, then export the .x3d".

Let me know if this helps you out, or if you have problems. I'll do my best to clear up any murky areas!


Thanks,
Brandon Pomeroy


Thursday, January 31, 2013

Selling out!

After months of tweaking, fine tuning, and testing, my printer is finally at the point where I feel comfortable actually letting people see the prints coming off of them!

One of my first commissions was the Imperial logo from Skyrim.

A capture of the logo from the game

It printed fairly easily. I did need to put down a bit of ABS goop, but only a very thin layer. The ridges at the top came out a bit jagged, but I hit that with some acetone, which smoothed it quite well.

Anyways, text is boring, onto pictures! 

Freshly printed!
The jaggedness of the edges is very noticeable. A lower layer height will fix this.



And lastly, a nice timelapse of the print:









Beds, beds, beds

One of the things that makes or breaks a 3D printer (other than the linear motion, extruder, hot end and countless other things...) is the build surface. The key is to get a print to stick well enough to not fall off during a print, but also being able to remove it from the surface afterwards.

Adhesion is a fickle mistress. What works great with one plastic will suck with another. in my experience, the following is generally true:

Cold beds:

PLA loves to stick to clean Kapton tape. It can stick to blue painters tape, but this is less desirable than Kapton (Kapton adheres more strongly to the bed, and is a glass smooth surface. The papery texture of painters tape is imprinted upon each print). PLA can maybe stick to glass, if it very clean, but don't count on it. There is very little warping that occurs, and the prints pop off quite easily.


ABS hates everything. Cold glass? No way. Blue tape? I don't think so. Kapton? No chance in hell. The main reason for this is really because ABS has a tendency to warp so much more than PLA. More often than not, it will simply pull itself off the bed.
The fix for this is a slurry of ABS dissolved in acetone. It should not be clumpy, but very liquid and flowing. when you apply the juice (or sludge, or goop, or whatever), to the surface, you want as little as possible. More sludge results in an uglier bottom finish.
I first put down painters tape, then put the slurry on top of that to protect my actual build platform. The warping of the ABS was enough to pull the painters tape right up and off the wooden platform. I then went and got a sheet of glass, and gooped right onto that. That did the trick; the part couldn't pull itself off the bed.

...

Unfortunately, there are still forces due to warping at play, and my print would quite literally pull itself apart! Some layers would delaminate with a *PING*, and the print would be weaker in that area. This was what drove me to a heated build platform.

Heated beds

I have not tested my bed extensively, as I have only had it for a week or two, but it has already vastly improved my prints. First layer adhesion (onto Kapton tape) works fairly well without any sludge. Some parts with very low surface area (one of which will be featured in my next post) still need a bit of goop, but that's only extreme cases.


Final thoughts, before I away to sleep...
Heated beds are not entirely necessary, but can definitely improve your print quality.
ABS cement is invaluable in sticking down difficult pieces
ABS bonds permanently to polycarbonate (You can test this if you want... But I'm pretty confident that that particular print will never be seperated from the bed)