Issue 049 – June 5, 2021

ParaView Extractors

Hey there,

It’s Robin from CFD Engine & I wanted to share a couple of post-pro bits with you today – a new ParaView feature & a new (to me) open-source viewer – the combination of which could make a neat addition to any CFD toolkit.

I’m talking about ParaView Extractors & the Cinema Science project from the Data Science at Scale team at Los Alamos labs.

I’m not sure of the best way to describe either of these things so, lets see if there really is “clarity through articulation” & whether I can figure it all out by the end of this email.

Extractors?

I’ve got to say, when I saw extractors on the release notes for ParaView 5.9 I didn’t really “get it”.

I’ve since discovered, despite using them a bit, that I still don’t. So I’ll have a stab at describing them & but I’ll also try to show-rather-than-tell.

Extractors live in your ParaView pipeline & look like any other filter (or source) but they don’t affect your scene. Instead they’re a way to extract a set of images (or data) based on your scene, your timeline plus a couple of other view/camera parameters.

Unlike filters & sources, they don’t do anything until they’re triggered, either by a new time or by you clicking Save Extracts. Once triggered they output a heap of images (or data files) and that’s about it.

I suspect you may not be super-impressed with that explanation, but bear with me…

Showtime

This might not render well in an email, but here’s a very basic example of something you can do with extractors.

Small GIF of the motorBike rotating about vertical axis

A simple animation, in which the camera orbits a motorBike (check it out here if it didn’t render in your email). Nothing new so far, but wait a second.

I make these images A LOT and the ease of setup (& speed of execution) of doing this with extractors eclipses the alternatives, especially if you’re doing it in batch.

For context, in a recent project, extractors were 5x quicker at making images like this than my previous solution.

Wait, there’s more…

The above example only scratches the surface of what extractors can do.

I used one rotation axes for my orbit animation, but you have two axes available in the extractor. If you use both, it will generate a complete orbit of images for each point around the second axis 🤯 effectively giving you a sphere of views around your object.

This is pretty cool, but pretty messy. You end up with A LOT of images & they don’t really fall neatly into a sequence for animating.

So what can you do with them?

Enter the Cinema Science project – in particular its viewers & its database format. ParaView extractors include an option to write a Cinema database file, basically an index of all the output images. Read that database into one of the Cinema Science viewers & you can navigate your way around the sphere of views by moving a pair of sliders.

There’s even more…

If your dataset has a time dimension, you can also have the sphere of views extracted for each timestep. Read this database into a Cinema Science viewer you can change the view (as before) AND the timestep independently.

Check out this neat browser-based visualisation of an asteroid impact to get a better idea of what I’m talking about. Move the time slider to see the asteroid impact & then rotate the view with the other sliders

Note: The sliders can be a bit sluggish, I don’t think it’s running on the biggest of servers.

I wish my data looked that nice – I might have to smash an asteroid into a racecar sometime 🤔

Code & Downloads

Extractors are available in ParaView v5.9+

Cinema Science has a stand-alone viewer – Cinema:Scope – available for Linux, Mac & Windows.

They also have Python & JavaScript libraries, Jupyter notebook components and lots of other bits (that I don’t understand) to checkout in their GitHub repository.

My recommendation, for the interested, would be to download Cinema:Scope (the viewer), “extract” some images from your own models, and have a play.

Over to you

I probably got a bit too excited about extractors as they have sped up (& simplified) the creation of the orbit animations that I use all the time.

That may not float your boat, but I think the combination of ParaView extractors & Cinema Science tools could present some interesting options for sharing & interrogating results, especially from large datasets.

There are lots of cool visualisation libraries emerging, but this combo probably warrants a place on your radar, even if you don’t need it right now.

Could you see this being a useful addition to your CFD toolkit? Do you think you might dig in a bit more & take them for a spin? How do you solve the problem of getting more eyes on your data?

Drop me a note, I’m always keen to hear your views, especially if it involves a new tool, technique or perspective.

Until next week, stay safe,

Signed Robin K