However I only managed to do this in a browser, I would like to be able to write a program to convert TGeo geometries in .root files to three.js .json so I can import them into my viewer.
I think the best way would be using node.js, but I couldn’t manage to properly read the geometry of a root file with it, since I have never used node.js before and there are very little examples of jsroot for node.js. Would this be possible? Or perhaps its not because of limitations of three.js in node.js?
I would really appreciate if you could provide me with an example of such a conversion in the easiest way possible so I can integrate it into my program.
Also my goal is to convert GDML to three.js json format, but I don’t think jsroot supports reading directly from GDML, right? My idea was to use the root http server to read the gdml files and convert them into root files, but if there is an easier way to do this, please let me know.
Also I have noticed that the names of the volumes are lost once you export the geometry loaded into three.js into .json, is this the expected behavior? I think it would make much more sense to have the
name field of the json be populated with the name of the node instead of it being empty.
Thank you very much for your work!