Blender is a powerful graphical opensource software for modelling and rendering 2D and 3D computer graphics and animations. This software is not designed directly for engineering post-processing and evaluation of result data from virtual FEM analyses. For such operations, there is dedicated software, so called post-processors. Some of the opensource postprocessors are listed in the CAE software list.
External 3D models can be imported to Blender in several commonly used formats and it is possible to create visualizations and animations from 3D data exported from postprocessors. In order to achieve the desired visualization outputs, more time is needed, but graphically these visualizations are of higher quality.
This article will describe a method how to create a simple scene for rendering in Blender. This is not a step-by-step tutorial but rather a general guide on how to import and render scenes with 3D FEM models. This procedure is not efficient or applicable for common engineering post-processing of the resulting simulation data since it is time consuming and in some cases may have limitations in the use of vertex colours. This procedure can be used and applied for the preparation of visuals for marketing purposes, studies, posters, etc. Although newer versions of postprocessors have, to a limited extent, 3D model rendering features implemented, the visual outputs are not of the same quality as of the Cycles engine available in Blender. This engine is based on the physical properties of light tracing and it can take several tens of minutes to generate a visualization depending on the HW used and the desired level of quality. Therefore, software such as Blender or ParaView is often used for scientific and HPC visualizations and animations of results from, for example, CFD flow simulations with tens of millions of volume elements are visually very attractive. The benefit of rendering is also evident for significantly deformed objects, such as crash test simulation results, where the depth of the structure stands out.
The output of the FEM analysis
We use the results from a simple static simulation of a truck cab for our illustrative example. The FE-model of the cab was developed as one of the results of the research project TE01020020, published results and details are available IS VAVAI. Blender, as already mentioned, is not used to process the results, they must be prepared in a postprocessor first and then exported in a supported graphical format. The most commonly used 3D data formats with the possibility of saving colour information from the postprocessor will be X3D, PLY and OBJ.
Preparing a static scene
Importing the model
Blender can import commonly used 3D data formats and the specific menu varies significantly by the version of the programme used. We export the desired results, in our case of strength FEM analysis, for example the total displacements or the stresses of the structure come into consideration, from the ParaView post-processor or other.
When importing the data into Blender we can unify the length units of the model and the scene. Depending on the graphical format used, the imported model will contain not only the geometry, but also, for example, the stored positions of cameras and light sources of light. The structure of imported 3D data is shown in the sidebar with the object tree.
Manipulating the model
In most cases, it is sufficient to position the imported 3D model appropriately, preferably in the origin of the coordinate system. Thus, the functions used in Blender will be G shift, R rotation, or S scale if the import was selected incorrectly and the imported 3D model is a few mm or on the other hand several km in size and thus not visible in the scene. It is also possible to hide unnecessary parts and assemblies, create new part groups to work more efficiently and prepare the appearance of the 3D model for final rendering.
General scene and environment settings
Depending on the chosen Blender rendering engine, some settings may vary. It is also possible to add additional light sources to the scene, use ambient lighting or load lighting settings from external exr files.
This is probably the most important part of the article with the description of how to get the imported 3D model to display the correct colours we have selected in the post-processor. You need to add an attribute called “Col” as an input node for the material colour. You can edit the material in the node editor or in the side menu in the material tab.
Then the edited material needs to be assigned to the individual parts. To assign materials in bulk, you can use function Link/Transfer Data (hotkey Ctrl+L). In this example, one material is assigned for the entire 3D model, so all parts take the colour information from the FEM analysis. Materials can be combined in the 3D models in different ways and some parts may be, for instance, transparent or with glass properties. After switching the Blender interface to the material preview, the correct colours should be visible.
There is no need to create complicated photorealistic materials in the Node editor to render results from FEM simulations. The output image of the visualization should still carry clear and unambiguous engineering information. This information is suppressed or distorted in case of inappropriate settings or choice of material type with a high surface reflectance, making interpretation of the results impossible.
After adding a camera, the Num0 key can be used to display a view of the scene. The view correction can be then adjusted using the Fly/Walk regime by Shift+f. The menu also allows you to set other parameters such as focal size and depth of field. In this demo, the camera is static and the output will be a single rendered shot of the scene. The visualization can also result in a video with a camera moving around the 3D model. However, the source data preparation is the same and only the camera settings are different.
In Blender, it is possible to render a scene using several engines. It can be, for instance, the physics-based Cycles engine or EEVEE OpenGL real-time engine. The EEVEE is new and has been available in Blender since version 2.8. Depending on the hardware of your computer, you can choose to render using the CPU or GPU. The default settings for render tile sizes are 16 px, 32 px for CPU and 256, 512 px for GPU. More detailed engine parameter settings are necessary for processing complex scenes and animations with many frames, this has an impact on the rendering time and can be unacceptably long. Use the F12 key to start rendering the active scene.
Final rendering of the scene
The final rendering of the imported 3D FEM model may look like this.
This simple procedure should give you an overview of the options for rendering 3D engineering results using Blender. It is quite difficult to learn how to work with Blender since it is a complex software with many features and settings. So, initially, it is likely that you will not be fully satisfied with the resulting 3D data visualization.