I am using Geant4 as a computation engine for some 3D web application. I need to export the Geant4 geometry as a text file that can be sent to a modern web front-end for rendering purposes using, e.g., Three.js.
What would be the best export format to do that?
AsciiTree is kind of hard to parse, VRML is deprecated and while an XMLTree format is mentioned here in the docs, I couldn’t find any examples or code snippets for XML generation. Does that driver still exist anyway?
I would be grateful for any advice. For now, my best bet seems to be VRML despite its deprecation.
So I have written a set of python classes to manipulate gdml, where manipulation includes access to all the 3D mesh data and exports to more modern 3D formats. If formats are missing assimp can be used. So it is usually very easy to export gdml from an application.
So the code is pyg4ometry and can be found on bitbucket.
To answer a question you asked previously. The VTK libraryis a scientific 3D rendering library and can export data to lots of modern formats like usd, obj, gltf etc.
I am writing a simulation software that can be used by engineers and sales people who are no experts in particle physics. The front-end will be a React-SPA, the back-end an ASP.NET web service that will start Monte-Carlo simulations in the Microsoft Azure Cloud possibly using Azure Batch. We haven’t started yet, but are still researching technology and prototyping.
Thank you @evc. I’ve only noticed your response about JSROOT now. Something like this image is exactly what I need.
However, I don’t know anything about ROOT. How would I export my Geant4 geometry to some ROOT file that can be loaded by JSROOT? Is there an easy way? Can you point me to some easy-to-understand tutorial?
I am not an expert in ROOT, but I know that ROOT can upload a geometry from GDML. Then, I believe, it can be converted to a ROOT file and uploaded to JSROOT. The best way to check is to contact the JSROOT developers, please see the following conversation at the ROOT forum: