glue-ar

  • What is it?
  • Supported file formats
  • Installation
  • Examples
  • Usage Guide
  • CoSpaces

What is it?

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.


Supported file formats

Currently glue-ar supports exporting to two industry-standard 3D file formats:

GL Transmission Format (glTF)

glue-ar supports both the JSON/ASCII (.gltf) and binary (.glb) forms of glTF. Additionally, via the glTF Transform JavaScript package, it supports two compression methods for glTF:

  • Draco
  • Meshopt

Universal Scene Description (USD)

glue-ar supports all three forms of USD files:

  • ASCII-encoded (.usda)
  • Binary-encoded (.usdc)
  • Package file format (.usdz)

Installation

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!).


Examples

Below are some examples of files generated using glue-ar. Scan the QR codes to see the figures in AR on your phone! We provide three types of interactives for most of our examples:

  • model-viewer: These use Google's model-viewer web component to allow you to view figures in tabletop AR directly from your phone. No app required!
  • CoSpaces - tabletop: These allow viewing the model in AR using CoSpaces in a tabletop format. This method requires installing the CoSpaces app.
  • CoSpaces - MERGE: These also use CoSpaces, but allow holding the model in your hand via the MERGE Cube. To use these, you can either buy a MERGE Cube, or create your own paper MERGE Cube. This method requires installing the CoSpaces app.

A rendering of the Per-Tau Shell, using isosurfaces for dust clouds

model-viewer
CoSpaces - tabletop
CoSpaces - MERGE

A static rendering of the Radcliffe Wave, an enormous wavelike structure in the Sun's neighborhood.

model-viewer
CoSpaces - tabletop
CoSpaces - MERGE

A 3D model of the Moon.

model-viewer
CoSpaces - tabletop
CoSpaces - MERGE

A 3D model of Jupiter.

model-viewer
CoSpaces - tabletop
CoSpaces - MERGE

A 3D model of the Local Bubble's magnetic field together with the Gum Nebula.

model-viewer
CoSpaces - tabletop
CoSpaces - MERGE

A voxelized rendering of a position-position-velocity data cube for the M83 galaxy. Thanks to Eric Koch for providing this dataset.

model-viewer
CoSpaces - tabletop
CoSpaces - MERGE

A rendering of the Gum Nebula, with points representing the IRAS Vela Shell. The shell is colored by hydrogen density. Thanks to Annie Gao for providing this dataset.

model-viewer
CoSpaces - tabletop
CoSpaces - MERGE

An animated rendering of the Radcliffe Wave, showing the motion of the wave over time.

model-viewer
CoSpaces - tabletop
CoSpaces - MERGE

The figure that started it all! This figure, created in collaboration with Delightex, was the first AR figure to appear in a major astronomical journal.

CoSpaces - tabletop
CoSpaces - MERGE

A rendering of several different data sets of structures within the Milky Way, including the Radcliffe Wave, Local Bubble, and IRAS Vela Shell.

model-viewer
CoSpaces - tabletop
CoSpaces - MERGE

Where can I use it?

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.

Qt desktop application

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.

Jupyter

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.

Supported viewers

glue-ar supports exporting from the following viewers:

  • Volume and scatter viewers from the glue-vispy-viewers package (available in both Qt and Jupyter)
  • Volume and scatter viewers powered by ipyvolume from the glue-jupyter package (Jupyter only)

How do I use it?

Once you've got a view that you want to export, you can simply use the AR export tool to turn it into a 3D figure. While we try to make the export process as simple as possible, we also provide some options to allow optimizing the output file for the environment where you want to share it. For a description of these options and our user interface, see our export options guide.


CoSpaces

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:

  1. Go to the CoSpaces website and log in to your account
  2. On the left side menu, navigate to "CoSpaces"
  3. Create the "Create CoSpace" button
  4. Select the environment you want:
    • 3D environment > Empty scene, for tabletop AR
    • MERGE Cube > Empty scene, to use the Merge Cube (note that creating a Merge Cube requires a plan addon)
  5. In the bottom left corner, select Upload > 3D models, then press the Upload button to the right
  6. Select your 3D mode
    • Note that CoSpaces currently does not support the extensions needed for Draco or Meshopt compression
  7. Done!