Tag Archives: tutorial

Complicated Selections in Maya

Sometimes geometry comes into Maya with difficult tessellation; the original designer might have never intended the model to be edited in the first place, or, more likely, was a lunatic.

Take, for example, this knurled surface by aubenc (not a lunatic, AFAIK) on Thingiverse. All those edges on the top surface N-gon trace to a single vertex. Performing an extrude on that top surface is going to get messy and difficult to deal with down the road.

ugly

So, how to delete that collection of edges and replace with a nice clean N-gon?

There’s always the brute force solution, hand-selecting each edge by picking them with the selection tool. This’ll work, but it’s tedious and one always runs the risk of accidentally selecting an edge somewhere else on the model.

I can’t count the number of times a stray edge got accidentally beveled because I selected it this way.

Sometimes it’s possible to switch to an orthographic view, drag-select all the edges on a face from the side, and then CTRL-select the edges you dont want from the other side.

select side A

deselect side

This technique will work with a model that’s oriented nicely along the X and Z axes like this knurled cylinder, but what if you can’t get a clean orthographic selection? Like in this (admittedly fabricated for the purposes of this blog post) case? There are no guarantees that a model you find out there in the wild is going to be well-positioned by the time you get to it.

bad orient

Here’s where Maya’s selection conversion tools become astoundingly useful. First, switch to perspecive view and hit F9. This will put you into component selection mode. Select the single vertex that is common to all the edges you want to delete.

single vert

Hold down the CTRL key and then hit F11. This will convert your vertex selection to faces. (CTRL-F10 will convert to edges, by the way.)

Right click and use the contextual menu to switch to face selection.

context

Hold down CTRL again and unpick the faces that you don’t want in your selection.

faces selected

Then delete the unwanted faces.

border edge

With most models, Polygon-> Fill Hole will give you a nice, clean N-gon if you select a border edge before applying it.

clean

With some fiddling and fuddling and boolean magic, Aubenc’s model became the base for the thumbscrews in Zheng’s GoPro Gubbinses.

Zheng’s GoPro Gubbinses

(Free download, it’s in The Forge, support Open Source design by throwing me a bone yadda yadda yadda.)

Calibrating the Printrbot Simple

printrbot calibration fails

As a barebones 3D printer the Printrbot Simple needs a little bit of software love before you can reliably print stuff. You’ve gotten your printer together, the X-Y fishing lines are tight, and it’s plugged in. You’re satistifed that despite your hamfisted build process, the bot won’t catch fire, and it’s time to get it calibrated so you can get started on your adventures in 3D printing.

First things first, download and install Repetier-Host. I’m using Version .56 on OSX, but the clicky points should be pretty much the same no matter what OS you’re on. If you’re a TL;DR type, skip to the starting gCode settings at the end of this post and proceed from there.

Repetier-Host desperately needs a name change. In the hierarchy of 3d printing software names, MakerWare is clearly the hep cat, followed by ReplicatorG. Pronterface sounds like a schoolyard insult, and Repetier-Host is the foreign exchange student who eats his own scabs.

Connect to the printer with the button on the top left of the screen. Assuming you get something cryptic in the log at the bottom like:

5:37:47 AM: FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:http://www.mendel-parts.com PROTOCOL_VERSION:1.0 MACHINE_TYPE:Mendel EXTRUDER_COUNT:1

You’re connected and ready to go. First, let’s calibrate the X-axis.

The plan here is to find the difference between how we’re telling the bot to move in software and how it’s actually moving in hardware. Variance in motors, line tension, humidity, gear slippage, localized tachyon concentrations, sunspots, Lindsay Lohan, all these things contribute to unpredictability in the Simple’s motion.

Once we find the difference we’ll write a little bit of simple gCode to correct for it.

The first thing you’ll do is set a default value for the X-axis steps per mm. I’ve been using 114.20, but any number in that neighborhood will work for this step. You’ll likely change this value later, so don’t worry too much about it.

Go to the Print panel and enter the following gCode in the G-Code field (inside the Print Panel tab) and then click Send:

M92 X114.20

Not much will appear to happen, but Repetier-Host has silently told your Printrboard to set the steps per mm of the X-axis motor to 114.20. We’re off and running with the calibration process.

Now move the print head all the way to the left. I do this by disconnecting the power supply to disengage the motors and physically sliding the print bed to the right, as if it were an old-style typewriter carriage.

warningWARNING: It looks like physically moving the X-stepper this way generates a current, which you’ll see lights up the status LED on the Printrboard. I’ve done this dozens of times with no apparent damage to the bot, so I’m assuming there’s a diode in there somewhere protecting it. Manhandle your bot at your own risk.

Once you have the X-axis homed, move the Z-axis up just enough that you can slide a ruler under the print head. I’ve covered my print bed in painters’ tape to help prints adhere, which also makes a handy writing surface. Record the start position of the print head with a mark on the tape.

marking the first line

Remove the ruler and click the X +10 button 5 times, for a sofwtare move of 50mm. Record the position of the head again and measure the distance between the two points, in millimeters. Mine was 46mm in this case, but yours may be different. In the unlikely event that your hardware move already matches your software move, congratulations! You’re done with X and can skip on to calibrating your Y-axis.

If your print bed doesn’t move or moves haltingly, there’s a good chance that you don’t have enough tension in the X line. Tighten it up and try again. The first few times I adjusted the line I was being way too gentle and got unpredicatble movement in the print bed, especially before the motor took up the slack on one end. Really pull hard on the line, like you’re trying to land a walleye.

A note to our international readers: a walleye is a type of North American antelope traditionally hunted with tethered harpoons.

We need a little bit of math to figure out our steps per mm. The Magic Formula is:

(old steps value * software move) / hardware move = new steps value

So plugging in our values we get:

(114.20 * 50) / 46 = new steps value

Which evaluates to 124.13 for my bot. Put your value into the gCode field like this:

M92 X124.13

And hit Send again. Test your X calibration by moving the print head back to the left with the X -10 button and recording the position. Repeat as needed until you’re satisfied that the print head is moving precisely enough for your needs. I’m OK with a little slop in my calibration because I’m trying to have fun with this machine and not get obsessive about print quality. It’s not like I’m printing jet engine parts here.

Repeat this process with the Y-axis, except swap the X for a Y in your gCode. I calculated a Y-value of 114.58 this time.

M92 Y114.58

The process is very similar with the Z-axis. Measure the distance from the top of the leadscrew to the extruder head, Z-move the extruder in software, and measure again. I’ve got one end of the ruler resting right on the plywood, sandwiched between the leadscrew and the head of a hex nut.

UPDATE 6/3/13: Read Bill Owens’ comments below on Z-axis calibration.

measuring the leadscrew

Plug your measurements into the Magic Formula and calculate. Calculate like the WIND!

After you’ve got the motion motors moving the way you think they should be, the next thing to do is calibrate the extruder motor. You need to make sure that the motor’s feeding enough filament to the hot end, but not so much that you spaghettify your print bed during a print.

The process is pretty straightforward: wrap a piece of tape around the filament, 10 centimeters up from the extruder.

filament

Set the extruder temperature to 220°. Repetier-Host won’t let you extrude with a cold hot end, so while you’re waiting set the extrude distance to 10mm. It shouldn’t take more than two or three minutes to go from room temperature to 220°.

If your hot end gets up to around 80° and stalls, check to make sure the power supply is plugged in. USB power will get you to 80° without the power supply, which can be deceptive.

After the extrusion is done, measure the distance to the tape again, and use the Magic Formula one more time.

Once you think you’ve all four motors calibrated, it’s time for a test print. You’ll want something simple and small, so that you can iterate quickly through test prints and really home in on the correct settings for your printer.

I’ve been using a 2x2x0.5cm test lozenge, which you can download right here if you’re not into 3d modelling yourself. The lozenge is nothing fancy, no bevels or geegaws. I keep the gCode for it handy so that I can quickly calibrate after a mishap or hardware adjustment. Do not suck the lozenge.

I’ll be exploring Slic3r and test printing in a subsequent post. For now just accept the defaults, hit Slice with Slic3r, and cross your fingers.

Before I print, I put my calibration setting into the Start gCode dropdown. If you’ve never done this before the dropdown can be a little hard to find:

start gCode

Here are the values that have been working well for me lately. They’ll be decent default settings for a Simple, but more than likely you’ll be tweaking them for your own bot. Note that these are a little different from the values I calculated above– there’s been some adjustments done to my bot since I originally started measuring things.

M92 X112.20 ; calibrate X
M92 Y112.58 ; caibrate Y
M92 Z2387.0719 ; calibrate Z
M92 E450 ; calibrate E

Assuming your print bed is mostly level you should have a printed lozenge in short order. Check the dimensions with a pair of calipers and adjust the print settings repeatedly until your OCD is satisfied.

Once you’re reliably printing lozenges, head on over to The Forge and grab a more complicated model to try out.

Also! Pledge fealty to The Horde to receive the latest Zheng3 models along with assorted other useful giblets like this calibration guide.

printrbot calibration fails

Saving the Beast for Last

Here’s the last in a series of posts describing my process for creating a 3D-printed Magic: The Gathering Beast token.

beast_token

After many iterations and test prints, I settled on this pose for the Beast token. The neck and limbs are angled with minimal overhangs so that the printer can build the model all in one go.

And here’s the final model, preening in front of a pile of test prints.

beast_token

download

This model is free to download and distributed under the Attribution-ShareAlike 3.0 US license. Please remix and enjoy.

I have another MTG token in the pipeline, so stay tuned: follow this blog or find me on Twitter for updates from the Forge.

MTG Beast Token, Day 3

beast_token

MTG Beast Token, Day 3: The head’s been joined to the body and I’ve put in some facial details, including a creepy double-pupil goat eye.

I haven’t joined the horns or tusks to the main mesh yet. Now’s the time to take a step back and consider the shape of the remaining large-scale forms: mane, tail, and the as-yet undecided hooves or claws.

90 more minutes. Why 90 minutes at a time? I usually get up at 5am. By the time I get caffeinated and moving, it’s 5:30, and then I can put in an hour and a half (more or less) before it’s time to get younger Zhengspawn up for school.

If you don’t want to wait a few days to see how the Beast turned out, here’s the blog post describing the final model.

MTG Beast Token, Day 2

beast_token

90 more minutes in. I’ve built out the foreleg and roughed out the head, but haven’t joined anything yet.

He’s fast becoming a boar-lion hybrid, in keeping with the “badass herbivore” theme. I’ll put in tusks, horns, and a tail once I’m happy with the rough form.

The mouth is open for now so that I’ll have an easier time setting up the model for posing later.

SPOILERS: The final model is a free download.

MTG Beast Token, Day 1

beast_token

This is the first in a series of posts demonstrating how I modeled and printed a Magic: The Gathering Beast token.

I’m using a lion as the base animal, but the ultimate direction I’m going is “badass herbivore.” This is modeled in Maya.

Here’s what we have after 90 minutes or so. The goal here is to start roughing out one half of the model, making sure to keep a clean, quadrilateral-only topology so that the mesh deforms properly later.

When I have the half-model done I’ll duplicate it, flop it along the Z-axis, and join the two halves.

I’ll work on the foreleg and head tomorrow morning.

If you want to skip ahead to see what the final print looks like, see my earlier post, Father Knows Beast.

Joining the Voronoi Cargo Cult

WTF is a cargo cult?

If you are like me, you do not want to become an expert in Meshlab. You do not really care about learning the interface, because you’ve already learned fifty other interfaces and you do not want to be an expert in every Tom-Dick-and-Harry Open Source 3D application.

You want an easy-to-follow, step-by-step, hand-holding process that pretty much guarantees you a Voronoi surface.

You want to join the Voronoi cargo cult.

Voronizing isn’t rocket science, but other tutorials I have seen online have skipped one crucial step that makes it all but impossible for cargo cultists like me to get a Voronized surface out of Meshlab. I beat my head against the wall for hours until I stumbled upon the solution.

Now that my bruises have yellowed and my rage has mellowed, I’ve written my own tutorial at the Voronoi-bloxen inspired request of Seej player, maker, and all around nice guy AndyP.

Ok, here we go.

Step 1: Download, install, and launch Meshlab. It’s free. I’m running Meshlab 1.3.2 on OSX, but I imagine the UI will be mostly the same no matter what OS you’re on.

Step 2: We’re going to Voronize a sphere. Go to Filters->Create New Mesh Layer->Sphere.

Sphere! Woot.

The process of Voronizing involves creating lots of vertices on the target mesh and then creating some voodoo connection between them to make the Voronoi pattern. So first we need more vertices on the sphere.

Step 3: Go to Filters->Remeshing, Simplification, and Reconstruction->Subdivision Surfaces: Loop. I just accepted the defaults. When it’s done, you’ll see that the default sphere looks a lot smoother.

Step 4: Sampling the new vertices. Choose Filters->Sampling->Poission-disk sampling. I have no idea what Poission-disk sampling is, but a value of 250 seems to work for this tutorial. Depending on how many verts you created in Step 3, you’ll adjust this number up and down.

I think this just picks a subset of the group of vertices you just created with the Loop subdivision. Remember: you’re in the cargo cult now. Doesn’t matter why this works.

If you click on the POINTS view icon, you’ll see your points. You can click on the SMOOTH view icon to make the model look solid again.

Step 5: Apply Voronoi Vertex Coloring. This is where the magic happens. Select Filters->Sampling->Voronoi Vertex Coloring and make sure the Back Distance checkbox is checked.

After you click Apply, you should have something Voronoi-ish. We haven’t actually made the holes in the mesh that give shapes their cool Voronoi webbing. All we’ve done is color the sampled vertices.

Step 6: This is the step that took me forever to figure out. I’m sharing my process with you because I hope it will help alleviate my MeshLab post-traumatic stress disorder.

Before you do anything else, you must collapse the mesh layer stack. While you’ve been following these instructions, MeshLab has been quietly building a construction history for your sphere in the background.

If you don’t merge the mesh layers, you’ll be stuck at this step forever.

Click on the LAYERS icon.

This will bring up the Layers sidebar. Right-click on the Poisson-disk Samples layer and choose “Flatten Visible Layers” from the contextual menu. Make sure you click “Apply” in the windoid that pops up.

Step 7: Now you just need to remove the interior faces from the sphere. This is easy. Go to Filters->Selection->Select Faces by Vertex Quality.

What is vertex quality? I don’t care. Cargo cult.

Check the Preview checkbox and fiddle with the sliders until the selection looks the way you want it to. Click apply and then close the selection windoid.

Click the Delete Faces button. It’s on the upper right, just above the layers sidebar. You’ll get a single-sided Voronoi webbed mesh.

Step 8: Refine the mesh. This mesh is a little chunky, but Meshlab has a number of smoothing algorithms. Select Filters->Smoothing, Fairing, and Deformation->Laplacian Smooth, click the Preview checkbox, and smooth the mesh as many times as you like. Click apply and close the windoid.

Step 9: Extrude the mesh. Your sphere is still a one-sided surface with no volume. In theory you can fix that by going to Filters->Remeshing, Simplification, and Reconstruction->Uniform Surface Resampling (Who writes these menu items?) and fiddling with the values until you get a surface with a thickness you like.

Or you can do what I did, and export the single-sided mesh and bring it into Maya, or 3DSMax, or whatever the kids are using these days to extrude their geometry.

Slightly more advanced Voronoi cargo cult behavior

We’ve Voronized a sphere, which is like the “Hello, world” of Voronizing.

BUT. Unless you’ve got a stereolithography printer like the Form1, you’ll be hard pressed to print your sphere on your Replicator or your RepRap without support.

(See this Twitter conversation in which I attempt to dupe Formlabs into printing my Voronoi bloxen, but they don’t, because they are too clever. Or perhaps because they are CHICKEN. bock bock bock @bvicarious is collateral damage in this exchange.)

Besides, you didn’t come here to learn how to Voronize spheres. You want to Voronize something you made or downloaded elsewhere. Something with some detail.

Let’s say you want to apply this process to a model with edges, like a cube. You’ll find yourself stymied after step 3 when the Loop Subdivision turns your cube into a rounded globule.

You’ll need more detail at the edges of your model. I have no idea how to do this in MeshLab, but I can make a cube in Maya pretty fast. Here’s a cube with beveled edges. Download it here if you want to try this yourself.

Import the cube into Meshlab and Loop Subdivide it a few times and you’ll see that the edges stay fairly defined. Go through steps 3-7 as before and you’ll wind up with this:

Welcome to the Voronoi Cargo Cult! We have guavas and beer every Wednesday after work.