Issue 133 – February 11, 2023

It's a wrap

Hey there,

It’s Robin from CFD Engine & a couple of months ago I wrote about a new feature in Rhino that can wrap a watertight mesh around any geometry.

I wondered at the time, whether I could use it to compress a month of CAD clean-up into a week 🤔

Well, I tried & I came pretty close – here’s what I learned…

Quick Context

It’s not exaggeration, I really have spent a month tidying CAD before. In fact, to my shame, I’ve done it a few times 🙈 Getting overly-complex CAD assemblies stripped-down, tidied-up & into snappyHexMesh takes time.

Could I replace most of the hole closing, leak chasing & de-featuring with shrink-wrapping? Or would I spend just as much time faffing about with the wrapper?

Rhino’s Wrapper

Rhino’s shrink-wrapper is super-simple, it’s quick & it’s light (i.e. I could wrap complex stuff in less than a minute, on my laptop). There are only four parameters (with sensible defaults) plus a handful of toggles to play with. That’s it.

The Shrink Wrap dialog in Rhino v8 showing simple, user-friendly settings

You give it a target edge length (i.e. the level of detail you want to capture) & let it rip.

With Preview toggled on, it automatically re-wraps every time you change a setting – really handy when you’re trying to find the best recipe for your wrap.

Fill Holes... is an interesting one, it does exactly what it says, but probably not what you’d hope.

It’s great for filling empty bolt holes, slots or pockets in the input geometry (even features that are way bigger than your target edge length), but it doesn’t deal with gaps between parts (or the irregular holes that you’ll often find in scan data).

You’ll need to block/fill/fix these yourself, otherwise your wrap will fail 🫢 (see below for a workaround).

The other settings do what you’d imagine, although I’m still not sure what the percentage refers to in the polygon optimisation 🤔

How I used it

Here’s the workflow I settled on, it’s iterative, but the wrapping is quick enough that it’s not painful (especially if you wrap things in smaller, sub-assemblies).

I would start out with a guesstimate for the target edge length (with fill holes turned off, no offset, one smoothing pass & 10% poly optimisation). Then I’d iteratively reduce the edge length until it captured all the details I wanted.

If it didn’t wrap properly, it was probably because there were gaps, larger than my target edge length, hiding in my model 🤦‍♂️

In those cases, I’d increase the edge length until I got a valid/closed wrap & then add a small negative offset, so that the new wrap sat just inside my model.

Then I’d go back to my normal method, but this time I’d include the new inside wrap as well as the original geometry. 9 times out of 10 the inside surface would block any leak paths & I could reduce the target edge length until it captured all the finer details 👍

The final wrap was usually watertight & ready for snappyHexMesh.

Occasionally I’d get a wrap that wasn’t quite watertight (i.e. there were a handful of unmatched vertices or a few non-manifold edges) but they never caused me a problem in SHM (you could fix them in MeshLab , Meshmixer or Rhino, if needed).

Shrink wrapping was a huge timesaver & it enabled a project that I’d otherwise have lost. But I had the option of using Rhino v8, so it was an easy win.

What about you? What does your typical CAD clean-up involve? Is it a 5min job or are you filling, bridging, trimming & thickening for weeks on end (like me)?

Would wrapping save you much time? Is it worth me taking a look at some open-source wrapping options for a future email? Or is it not something you’d use?

I hadn’t realised how effective wrapping could be & I wish I’d explored it earlier. But, what do you reckon? Would it be a good fit for you?

Drop me a note, I’m keen to hear your thoughts.

Until next week, stay safe,

Signed Robin K