glue-ar is a plugin for the glue visualization software which allows exporting views from glue's 3D viewers to augmented reality (AR)-compatible file formats.
Currently glue-ar supports exporting to two industry-standard 3D file formats:
glue-ar supports both the JSON/ASCII (.gltf) and binary (.glb) forms of glTF. Additionally, it supports two compression methods for glTF:
glue-ar supports all three forms of USD files:
glue-ar is installable via pip:
pip install glue-ar
Installation requires Node.js to be installed on your system, as we currently use JavaScript packages for performing Draco and Meshopt glTF compression. (Having Node installed is all that you need - the npm/JS management relevant for the package is all handled by the package build process!).
glue-ar can be used with both major frontends for glue: the Qt desktop application, and the glue-jupyter viewers which can be used in Jupyter notebooks.
In Qt glue, the glue-ar export tool is exposed in the toolbar as sub-tools of the "save" meta-tool, and can be accessed from its dropdown menu.
The glue Jupyter viewers don't yet support subtools, so in these viewers the glue-ar export tool is exposed at the top level of the toolbar.
glue-ar supports exporting from the following viewers:
If glTF is selected as the export file format, glue-ar will also export an HTML file in addition to the glTF. This HTML file provides a display of the exported figure using the model-viewer web component. This model-viewer page provides a THREE.js-powered glTF viewer that, on an AR-capable device (such as an Android or iOS phone) allows viewing the glTF file using the hardware's AR capability. This exported HTML has no additional dependencies and can be served using static file hosting.
A popular option for sharing 3D files in augmented reality is CoSpaces, which allows viewing 3D files on a mobile device via a dedicated app. The CoSpaces app allows viewing figures in AR on a flat surface directly, or using the Merge Cube to allow for a more tangible AR experience.
CoSpaces supports the glTF and glB formats, so it's possible to output from glue-ar and share via CoSpaces directly. It's our goal to eventually allow automatic CoSpaces upload, but for now sharing your AR figures to CoSpaces requires some manual steps (as well as a CoSpaces account).
To create a scene with your newly-exported figure, do the following:
Below are some examples of files generated using glue-ar. Scan the QR codes to see the figures in AR on your phone!
A voxelized rendering of a parsec-scale galactic 3D dustmap from Edenhofer et. al.
A rendering of the Per-Tau Shell, using isosurfaces for dust clouds
An isosurface rendering of the Gum Nebula, with scatter points representing the IRAS Vela Shell. The shell is colored by the density of hydrogen. Thanks to Annie Gao for providing this dataset.
A voxelized rendering of a position-position-velocity data cube for the M83 galaxy. Thanks to Eric Koch for providing this dataset.