New function: Plot 3D Cut View

Motivation: I was having some problems using voxel, voxel is an excellent 3D visualization tool, but it uses so much processing and memory that it becomes unfeasible to use it. I was using a server with 2 Xeon E5-2697v2 processors and 96GB of RAM, and Paraview was having difficulty processing a 1000x1000x1000 voxel. On the other hand, I was able to generate 2D images of 30000x30000 on a regular computer.

As much as I just want a sectional view of the reactor, the voxel generates a 3D drawing of the entire reactor, even the parts that I can’t visualize.

Solution: So I needed to develop a technique to generate a 3D reactor view without much computational cost. I generated 3 sectional views of my reactor in the XY, XZ and YZ planes and used GIMP to distort the image, generating a 3D image: Isometric parallel projection (without perspective). But I could very easy have generated the view in perspective as well.

Result:

With this approach I was able to create very detailed images of the reactor in 3D!!

Extremely detailed!

Proposal: Create a function

def plot3dCutView(origin=[0,0,0], edge=[-1,-1,-1],perspective=“off”, dpi=300, etc…):

Functionality: The function will generate three 2D images, from the sectional views (In the image above it would be the blue, green and red faces of the cut cube (cube on the right)). Then use these three images to generate a new 2D image, for this it will distort the three images to form a view in isometric perspective (or parallel projection). That is, use the existing openmc function to generate the three faces of the cube, then distort the images to form a 3D view of the cube (The cube representing the cross-sectional view of the reactor).

The reported DPI corresponds to the DPI of the three original 3D views, as it is difficult to calculate the DPI of the future distorted image in perspective view.

Future perspectives: This proposal is very basic. In the future we could implement more functionalities, such as cube orientation (so that we don’t always cut to the basic planes XY, XZ, YZ), new geometric shapes, such as instead of a cube, making a spherical cut, hexagonal prism cut, etc.

But just this basic functionality would help many people who want to get a quality 3D view of the reactor, but don’t have the processing power and memory to use the voxel.

3 Likes

That’s cool! But it’s disappointing that I won’t use transforms in GIMP, can you provide a simple example?
Looking forward to hearing from you! Thanks!

First you put 3 views of the reactor separete by layers:

So you cut the views:

If you assembly like this, you can see taking format.

Now match the views like this, because you need cut more

Cut like this

Now is perfect:

You need chose a veiw, I choose 3D parallel projection (this cube)

Put the cube in GIMP to help you to imagine

Inclinate 30° like this

Inclinate the other view too

If you put the cube like this, to you can imagine better

Now is time to transform the top part, so put like this

I’m using this tool to transform, but you can use others
image

You need select the 3 corners and mov it to match the corners:

Like this:

This region I cut don’t have control bars, so I needed deleted it

Finish:

This image is not high resolution, just 5000x5000.

If you have good computer, you cant work with, for exemple, 20000x20000.

Or if you want to use “infinity” resolution, you can use InkScape to vectoraze the image, so you can apply infinity zoom, and the file size is smaller, so is good to put in articles in EPS format if you are using LaTeX.

The result is like this:

And I make the same transformations using InkScape to make the 3D View:

1 Like

Thank you very much for the tutorial that is very detailed and specific, and I followed the tutorial to make a diagram, albeit very ugly. I’m going to try to graph with a custom function next.
Once again, I would like to express my gratitude!