As promised last week, Autodesk Research has now posted v0.2 of our Space Analysis package to the Dynamo Package Manager. This version contains nodes for pathfinding as well as for visibility analysis. Both implementations work via a common SpaceLattice object – basically a 2D grid with diagonal connections – that can be used to drive both algorithms. In reality you may end up having multiple lattices – as pathfinding may be working with “barriers” that don’t affect visibility – but the node you need to use is the same.
We had posted a previous version with just pathfinding, but as we introduced visibility we realised we had to move and rename some nodes to make a release that should be more stable in the long-term (in terms of API compatibility). Here are the release notes for the various changes in the 0.2 release:
Changed
- Renamed PathLattice to SpaceLattice, and moved it from Pathfinding into Core namespace.
- Renamed PathLattice.Create to SpaceLattice.ByBoundingBoxAndLines.
- Renamed PathField.Create to PathField.BySpaceLatticeAndEndPoint.
- Moved PathLattice.FindRoute and PathField.FindRoute to be constructors of Route object: Route.ByPathField and Route.BySpaceLattice.
Added
- Added PathField.BySpaceLatticeAndStartPoint constructor.
- Added SpaceLattice.Surface method, that returns a bounding surface of the lattice, useful for visualization heatmaps of the data.
- Added Visibility functionality with ViewField and VisibilityGrid classes.
One thing that has been absolutely fantastic since starting talking about this work is that we’ve become aware of at least three other projects around pathfinding and visibility analysis. Our intention is definitely not to reinvent the wheel with this effort – we have requirements related to our own research work that have led us to build the library… it seemed a shame not also to make it available externally, too – and we’re definitely keen to coordinate with the other projects exploring solutions in this space: at the very least we can learn from each other, but there may be opportunities to pool our efforts in a more coordinated manner (whether consuming each others’ work or contributing to a common Open Source project). So do expect some manner of rationalization over the coming months regarding all this stuff.
Anyway, back to the Space Analysis package. The package comes with a few different sample files that explore ways you can use them. Here are the visibility-related examples, showing how the Isovist-like capability can work.
Beyond that we’ve also created a more complex sample that demonstrates how both pathfinding and visibility can be used to implement a Generative Design workflow in the urban design space. We’ve chosen the example of adding a new plaza to an existing campus layout (as we’ll be using this example for a tutorial soon at Carleton University in Ottawa, Canada).
The geometry system is driven by a number of inputs that specify the location and dimensions of the plaza, as well as the positions of the transversal access roads. The plaza and the roads are used to generate blocks for buildings, and we create very simple building shells by offsetting the boundaries of the blocks inwards and extruding them to a height relative to their area. Entrances are then positioned at a certain parameter length along each of the buildings’ outline curves, with the paths and the plaza getting removed from the geometry representing the buildings’ forecourts.
So how are we using the Space Analysis package? Well, beyond the “standard” metrics such as cost, profit, the areas of the plaza, the buildings and their forecourts, (oh, and the percentage of the existing trees that can be saved, as they’re not beneath a building… a metric that I think is really interesting), we’re using pathfinding to test how close each of the building entrances is from a number of “destination” points of interest: the centre of the plaza and three of the boundary corners. We don’t need to display the paths to generate the metric during optimization runs, but it is fun to turn them on from time to time:
We’re using visibility testing to determine which building entrances are visible from the centre of the plaza: the idea being that when entrances are hidden there may be issues with campus security. This visibility could, of course, be tested from more locations, if needed, but for now we’ve kept it simple. The various building entrances are coloured to indicate the relative visibility from the centre of the plaza: green for highly visible, red for ones that are obscured in some way.
Here’s the campus layout Dynamo graph ready to be used with Refinery. It only depends on the Space Analysis package, so no other packages should need installation for it to work properly. A quick word of caution: the Space Analysis package has been developed and tested for Dynamo 2.0.2. I’ve just found out that Refinery v0.4.44 (which was released this week) uses the Dynamo 2.1 (or 2.2?) runtime, so it may not give meaningful results: if you see the graphics stop generating and the Design List stop showing outputs, you should try downgrading Refinery to v0.4.26 (on top of Dynamo 2.0.2), which I know for sure works. I’ll post an update as soon as we have Space Analysis working for Dynamo 2.1+ and therefore Refinery v0.4.44+. (See update below.)
Finally, I’d like to give a giant shout out to Rhys Goldstein and Simon Breslav, who really have done the bulk of the work for this project: Rhys developed the low-level C++ library that does both pathfinding and visibility analyses, while Simon has done the wrapping work for Dynamo as well as creating the various graphs that show off how the Space Analysis package works. I’ve done some work on the campus layout graph, but most was done by Simon.
Please give this example – and the others contained in the package – a try and let us know your thoughts! The examples should make clear how things work, but please do post any questions, as well as requests for additional capabilities. We already have a list of things we’d like to add, such as a SpaceLattice method that returns the closest point on the lattice to the geometry you specify. We’d be very happy to add items to this list and start to flesh out the capabilities of this tool for your use. Especially in the area of Generative Design, of course.
I’ll try to dig a little deeper into the aspects of how the package works in a post over the coming days: I’ll be taking this example for a proper spin at a workshop in Stockholm on Thursday. I’m planning to try and post some more information from there.
Update:
With help from members of the Dynamo and Refinery teams (thanks, Neal, Craig and Varvara!), we were able to update to the graph to work properly with Dynamo 2.2 (the version that Refinery v0.4.44 uses on the server side of things). It turns out there were just a few minor tweaks to make to the graph: the problem was not (after all) with the Space Analysis package. Which is good news: you should be able to use the version of Refinery that you wish to. I’ll be following up with a post on the benefits of using v0.4.44: it’s really getting a lot snappier both in terms of UI and optimization performance.