Constructing a virtual Synchrotron X-ray beamline

Authors: Jonas Ahlstedt, Emanuel Larsson

InfraVis Collaborators

Kim Nygård (MAX IV)

InfraVis Application Expert

Jonas Ahlstedt (LU)

InfraVis Node Coordinator

Emanuel Larsson (LU)

Tools & Skills

Blender, Unreal Engine

Keywords

Virtual Reality

Introduction

In this project we are developing techniques to turn computer-aided design (CAD) drawings into virtual environments that are both interactive and immersive. The challenges include optimization of large and complex geometries and displaying them in virtual reality without relying on the power of a standalone computer desktop. These environments could be used for education, training and conducing virtual experiments, before going to a real Synchrotron X-ray Beamline, e.g., at ForMAX at MAX IV, Lund, Sweden.

Background

A virtual beamline, lab, or similar environments opens the possibility for individuals who otherwise would not have access to such facilities to visit and to interact. It can be used for both communication and educational purposes. An interactive environment could also be an opportunity for visiting beamline users to familiarize themselves with the equipment and routines before beamtime starts. In the future, these environments could be used to perform virtual experiments.

Building a beamline from scratch with clean topology would be extremely time consuming. If one could process the original CAD files into mesh files suitable for automated or semi-automated methods of UV-unwrapping, texturing, shading, and rigging (for interaction and animation), it would take considerably less time and resources to create environments such as these.

Fig 1. Overview of the mesh geometry (edit mode) directly imported as a FBX into Blender. 
Fig 2. Close up of the imported geometry – the complexity of the mesh makes manual adjustments challenging.

Workflow development

The primary tools used in this project are Fusion 360 (Autodesk, California, U.S.), Blender (Blender foundation, Amsterdam, Netherlands) and Unreal Engine 5 (Epic games, North Carolina, U.S.). A direct export of all groups from Fusion 360 creates a very complex mesh. A pipeline of stacked modifiers in blender creates a pseudo-automatic workflow for mesh clean up and re-topology; merging nearby vertices, eliminating N-gons, adjusting normal vectors, and deleting interior faces and other hidden topology is completely taken care of in this pipeline and done completely in blender. This also ensures that UV-mapping, shading and materials are suitable and prepped for Unreal Engine 5.

Fig 3. From beamline to sample visualization of a mouse lung (right)! This version was not based on any CAD drawings.
Fig 4. Visualization work-in-progress of the ForMAX Beamline, based on actual CAD drawing, converted into a mesh with procedurally improved topology, textures, and materials. 
Fig 5. Early shader tests inside Unreal Engine 5.

Future

A remaining challenge is the sheer amount of topology required to display necessary components; to display the entire beamline in wireless headsets such as the Meta Quest 3, the number of faces (polygons) must be reduced significantly. Possibilities such as culling and occlusion are being investigated.