Blender notes from a Meshlab user

When I first started working with meshes, the first tool that people told me to get started with was Meshlab. It’s an open source mesh processing tool that lets you visualize your meshes, do some mesh editing, and also lets you pick from a kitchen sink full of filters with various tools. See my previous post for an example of computing triangle surface area on a mesh by putting together a few of these filters. However, if you want to get more “hands-on” with your mesh, touch up certain areas in a fine-grained way, Meshlab disappoints.

This is where Blender comes in. It’s another nice open-source tool that everyone will recommend, but it’s loaded with so much stuff that it is probably less intuitive to use. I’m not a professional at 3d modeling but I do need to curate the data that I work with in my research, so here’s a few notes about Blender that I’ve taken that have been helpful to me in my mesh editing work.

You can focus on selected primitives by right-clicking in Edit mode and hitting PERIOD.

You can select boundaries by going into Edit mode, then going to Select -> Edges -> Non-manifold. Blender actually has a nice scripting environment

You can fill holes by selecting a hole and pressing ALT + F.

You can hit TAB to go between Object and Edit mode. Tab out of Edit mode before exporting your mesh so that any changes are committed to the model first.

You can open the properties panel by hitting N. This is context-dependent what it contains. You’ll watch some videos or read some tutorial and it will refer you to this, but it might be mysterious at first how this is even reached, so now you know.

For context-dependent actions on edges, press CTRL + E.

For context-dependent actions on vertices, press CTRL + V.

Importing/exporting with OBJ file format works best if you want to keep mesh data consistent across Meshlab and Blender.

For reference, the latest version of Blender at the time of this post is 2.69. There’s a lot of good tutorial videos for users, such as this one. I just wished that there was a web page to go with some of these so I don’t have to browse a lengthy video to review content, hence this mini- cheat sheet of things that were helpful to me.

Compute area for each triangle facet in meshlab

Meshlab is probably the first program that comes to mind when you think of working with meshes. Depending on what you actually want to do, you might be completely disappointed or completely blown away by what meshlab functionality has to offer. This post is an example of the latter, where I needed to do some processing on triangles that were too big.

Meshlab lets you compute and associate numbers to facets: this is called facet quality. If you go to Filters > Quality Measure and Computations > Per Face Quality Function, you can key in a function in terms of the vertex positions, and the function will be evaluated and stored at each facet. Here’s a useful equation that will calculate the area of each triangle:

sqrt( ((sqrt((x1-x0)^2 + (y1-y0)^2 + (z1-z0)^2) + sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2) + sqrt((x2-x0)^2 + (y2-y0)^2 + (z2-z0)^2)) / 2) * (((sqrt((x1-x0)^2 + (y1-y0)^2 + (z1-z0)^2) + sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2) + sqrt((x2-x0)^2 + (y2-y0)^2 + (z2-z0)^2)) / 2) - sqrt((x1-x0)^2 + (y1-y0)^2 + (z1-z0)^2)) * (((sqrt((x1-x0)^2 + (y1-y0)^2 + (z1-z0)^2) + sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2) + sqrt((x2-x0)^2 + (y2-y0)^2 + (z2-z0)^2)) / 2) - sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2)) * (((sqrt((x1-x0)^2 + (y1-y0)^2 + (z1-z0)^2) + sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2) + sqrt((x2-x0)^2 + (y2-y0)^2 + (z2-z0)^2)) / 2) - sqrt((x2-x0)^2 + (y2-y0)^2 + (z2-z0)^2)))

Basically, I used this to be able to select and subdivide regions of the mesh that are too sparsely sampled. After computing the area, I select the triangles based on a threshold on the face quality (Filter > Selection > Select Faces by Face Quality), then run loop subdivision (Filters > Remeshing, Simplification, and Reconstruction > Subdivision Surfaces: Loop).

The triangles on this mesh are colored based on their size. Hot colors are smaller.

The triangles on this example mesh are colored based on their size. Hot colors are smaller.

The idea is that only the large triangles will be affected: the small faces will remain the same, which is important because I already have data attached to those vertices.