This PR is a smorgasbord of updates that probably all should've been separate PRs, but I got carried away hacking on multiple things at once and so they're all in one. The updates here are:
Update the volume exporter to do per-cell opacity based on the layer state's attribute and vmin/vmax. Before we weren't taking these into account, so the exported file didn't necessarily match what was shown in glue.
It seems that pyvista will only let us use per-cell opacity if we're also coloring the mesh via scalars. We don't really want that, since we use a single color for volumetric layers, so we just define a constant scalar array (every value is 0.5) and a "colormap" with a single entry of the layer color, with bounds [0, 1]. Not my favorite solution, but it works.
Rescale the volume export to fit inside a unit cube, which makes the model size much more manageable on mobile.
Support the native aspect ratio flag for volume exports.
If the gltf-pipeline Node package is installed, we allow using that to perform Draco compression on the output files, which shrinks them significantly. This is very useful for e.g. loading them into a web browser. This is a really hacky solution for now - a future PR needs to make this less so.
Some tweaks to the QR dialog and the server/ngrok shutdown
This PR is a smorgasbord of updates that probably all should've been separate PRs, but I got carried away hacking on multiple things at once and so they're all in one. The updates here are:
attribute
andvmin
/vmax
. Before we weren't taking these into account, so the exported file didn't necessarily match what was shown in glue.pyvista
will only let us use per-cell opacity if we're also coloring the mesh via scalars. We don't really want that, since we use a single color for volumetric layers, so we just define a constant scalar array (every value is 0.5) and a "colormap" with a single entry of the layer color, with bounds [0, 1]. Not my favorite solution, but it works.gltf-pipeline
Node package is installed, we allow using that to perform Draco compression on the output files, which shrinks them significantly. This is very useful for e.g. loading them into a web browser. This is a really hacky solution for now - a future PR needs to make this less so.