Our resident spatial-analyst-in-chief, Rhys Goldstein, has gone and done it again. After his very well-received Medium post explaining grid-based pathfinding was published in Towards Data Science, Rhys has now had a follow-up post published that explains our work on visibility. And it’s fantastic!
Assessing visibility and pathfinding in 2D and 3D spaces are really cornerstones of our work to assess how occupant-centric prospective building designs are likely to be. This is a critical capability for us in our day-to-day work, but it's also very interesting from an algorithmic perspective and Rhys's article helps create awareness of these techniques with people working in adjacent areas.
In his post Rhys explains the novel, grid-based approach to testing visibility that was implemented in our Space Analysis Dynamo package – something that is very different from the more traditional ray casting/Isovist technique that’s common in our industry – and shows how the technique can be replicated using a few lines of Python code or even by copying a formula into Excel.
I went ahead and followed Rhys’s instructions, and sure enough in less than 2 minutes had grid-based visibility working in an Excel spreadsheet. Such fun!
Complete instructions on how to do this yourself are included in Rhys’s post. This method uses interpolation between the grid cells to calculate visibility values.
One of the core techniques used in Space Analysis relates to “path counting”, especially in the context of pathfinding through a grid. We're also able to use path counting for visibility: it’s very interesting that this approach has so many potential applications, and all therefore inspired by Pascal's Triangle.
To grossly summarise the approach, I’ve borrowed some of Rhys’s animations that explain the process in three steps. (Just as in the above example, visibility is being calculated from the top left of the grid.)
1) Count the grid paths from the top left corner.
2) Count the grid paths again but ignoring obstacles.
3) Divide the first numbers by the second to get the visibility level.
I hope this post motivates you to head on over to Rhys's excellent article to learn more. Grid-based techniques such as this are underused in our industry, and I fully expect them to become more popular as people become aware of their potential.