While preparing for one of my upcoming AU classes, I decided to explore how someone could use VASA - our Voxel-based Architectural Space Analysis toolkit - with Forma. Right now Forma is largely focused on conceptual design - taking into account the surrounding urban context - so this thinking was largely focused on how VASA might be used at the urban scale. This is something we’ve looked at before in the context of FormIt and Dynamo.
While a tighter integration is likely to be possible at some point - I’ll talk a little more about our work on a WebAssembly version in the next post, and there’s some news coming soon that’s likely to be relevant - for now I wanted to focus on a slightly disconnected workflow: exporting geometry from Forma and loading that into a standalone Dynamo graph that uses VASA for pathfinding.
The simplest way I could find to export the currently scene from Forma is via an extension. And the simplest way to build an extension that does this is to use one of the Forma Sample Extensions, which happens to define a very handy Embedded View with a button to export an STL file. Perfect!
To get started you need to clone the GitHub repo containing the sample:
git clone https://github.com/spacemakerai/forma-extensions-samples
(If you don’t want to use the Git command-line tools or desktop app, you can also download a ZIP of the repo.)
Once extracted you need to launch a local web-server that can server up the contents of the analyses/export-stl sub-folder. I use the one recommended in the Forma documentation for the local_testing extension (more on this in a bit):
npx http-server --cors -c-1 --port 8081
The above launches a local HTTP server on port 8081 (which means the page being served will show up on the right of the Forma window) and with a cache timeout of -1 (which means if you do modify the code it’ll get served up straight away).
Once that’s running you can install and run the local_testing extension (as per the above-linked instructions) and you should see the ExportSTL button in the right panel: Clicking the button will cause you to be prompted to choose an STL file for the export.
Loading the STL file in an external viewer - I chose one called STL Master on MacOS - we can see the contents of the scene. What’s nice is that the base plate is included, which will simplify our work in VASA.
Loading the STL file in Dynamo is easy. Here’s a graph that loads an STL file and allows you to use VASA with it for both pathfinding and visibility:
Here’s the graph working with our STL export from Forma. You can see a path in purple and a visibility dome in orange.
Here's a video of it in action:
In the next post we’ll take a look at this same workflow working directly in Forma via an extension that hosts our (currently not published) WebAssembly version of VASA.