Issue 040 – April 3, 2021

Meshmixer & MeshLab

Hey there,

It’s Robin from CFD Engine and I’ve got a couple of suggestions for your CFD toolkit today – Meshmixer & MeshLab.

If you use snappyHexMesh (or cfMesh) then these two recommendations have plenty of neat features that make fiddly surface mesh tasks easier & could even save the day.

They’re useful for wrangling scan data, but they’re equally at home checking & fixing meshes that originated in CAD.

I’ll give you a quick overview including what I do with them, what’s good & what’s not so good.

But, before I go any further…

Caveat

Both of these tools share a major drawback…

Neither tool will export STL/OBJ files with named surfaces 😬

You can define face groups in Meshmixer, and they get exported, but they’re called mmGroup00 or something similar. MeshLab just lumps everything into one mesh with no names.

You’ll need to apply your surface names in another tool (Rhino, FreeCAD, Blender etc) in order to get the most out of snappyHexMesh or cfMesh.

But don’t give up on them just yet, they both have enough tricks to make up for this flaw.

Meshmixer

Meshmixer is “free software for making awesome stuff” – a GUI tool from Autodesk Research that’s geared towards preparing meshes for 3D printing.

Turns out many of the tools that 3D printing folks value are pretty handy for preparing surface meshes for snappyHexMesh, especially if you like your meshes watertight 😉

It’s available for Mac & Windows (in English & Japanese) & you can download it without having to sign up or create an account.

I’m not sure if it’s still a “live” project, as it’s last release was in 2018, but the forum is still active & there’s a decent online manual.

What do I use it for?

  • Hole Fixing: Everything from smoothly filling large holes, down to closing cracks & welding vertices. It also includes a tool that inspects your model for holes and offers one-click (or even automatic) fixes.
  • Smoothing: Brush-based tools for smoothing surfaces (including local remeshing) which are great for fixing locally-noisy scan data & reducing detail in unimportant areas.
  • Thickening: Offsetting surfaces to produce a thick/solid part &/or hollowing a watertight mesh to create an inner surface.
  • Assembling: It’s a nice environment for merging several parts into one file, especially if those parts need transformation, boolean &/or alignment ops.

In addition, it has an awesome undo function which is probably my most used feature. It’s very hard to do anything too detrimental as you can always just undo it 🙏

What’s not so good?

Whilst it’s good at manipulating & fixing models that originated elsewhere, it’s not so good at creating new geometry, unless you just need simple primitives or you want to sculpt something.

MeshLab

MeshLab is an open-source, mesh processing tool with its roots in the Italian National Research Council.

It doesn’t seem to be optimised for any particular task (unlike Meshmixer for 3D printing) but it has a huge feature set which can deal with all sorts of surface-mesh related tasks, from cleaning & tidying to wrapping, aligning & texture mapping.

Like OpenFOAM, it’s not the easiest to get to grips with & there is a lot more to it than the subset of functions that I regularly use.

The latest version was released in December 2020 & binaries are available for Windows, Mac & Linux, plus the source is available on GitHub.

What do I use it for?

  • Read/Write: MeshLab reads & writes a lot of different surface mesh formats, which makes it a useful translator/checker, even if you don’t use any of the other tools.
  • Wrapping: There aren’t (to my knowledge) too many options for shrink wrapping surfaces outside of commercial codes, but MeshLab can do a pretty good job of it. Check out the Screened Poisson Surface Reconstruction function if you’re interested.
  • Remeshing: MeshLab has several functions for reducing the number of faces in a model without losing too many of the important detailsQuadric Edge Collapse Decimation is my go-to function for this.
  • Housekeeping: Random little tasks like finding/removing duplicate faces, fixing normals and closing little holes are quick & easy in MeshLab.

What’s not so good?

There is no undo function – so be careful with your saves, it can be hard to go back.

Other than that, there isn’t much documentation, which leads to much trial & error “experimentation”.

Wrap Up

If you’re using snapyHexMesh or cfMesh to generate your volume meshes, then you’ll probably have occasions where you need to get your mesh spanners out to fix your OBJ or STL files.

It might not be an everyday occurrence, but when it happens, you’ll be glad that these two codes are in your CFD toolkit (despite their inability to export OBJ/STL files with named zones) 😉

What tools do you have in your pre-processing toolkit? How do you deal with troublesome surface meshes or work with scan data?

If you’d like to see a deeper dive on Meshmixer or MeshLab, let me know & I’ll see what I can do.

Until next week, stay safe,

Signed Robin K