Some of you may already have seen Augusto’s tweet showing the “Visual Clusters" Forge viewer extension that has been developed by the BIM 360 Design team.
It really is super-cool: the extension takes the content of the model loaded in the Forge viewer and clusters it spatially based on the value of the various items’ category property. The extension was first published in v7.6 of the Forge viewer, so it’s been around a little while. If you don’t have a Forge viewer application to test it out with, fear not! Petr Broz has added the capability to load extensions into his awesome Visual Code extension that hosts the Forge viewer. That seems to be an easy way to test out the extension’s capabilities with your own derivatives. There really isn’t any code needed beyond loading the “Autodesk.VisualClusters” extension in your custom viewer session: this leads to the extension’s button being added to the standard toolbar next to the Explode button.
Anyway, I figured I’d give the extension a try, to see what value it might bring to Dasher 360. The first major hurdle I hit was that the extension, when loaded, wouldn’t actually do anything with the models we use inside Dasher (most notably the NEST and 210 King Street East models we’ve been using to demo Dasher 360’s capabilities). From digging into the issue, I found something interesting: our leaf content doesn’t have a category property directly on it; this is something that is found in their parent nodes. I haven’t looked into why this might be – it could be because we’re exporting our models to NWC before loading them into Dasher – but it was interesting to realise there was a difference in the way the data was structured.
As I work for Autodesk, it was a relatively simple task to get hold of the code for the Forge viewer and build a custom version of the extension that works for Dasher 360 models.
The default approach the extension takes is the following: it takes the dbIds that have geometry fragments associated with them, then queries for their category properties (this is just the default, by the way, as the code has been generalised to cluster based on other properties even if this feature isn’t currently exposed), which it uses as the basis for the clustering process.
My updated version gives the option to search all dbIds (not just leaf nodes associated with geometry) for the chosen property, and then clusters the geometric children of these nodes. Hopefully this approach (or one like it), will get added to a future version of the viewer: in the meantime I can only share videos and images showing it working.
I did have to jump through some hoops to turn off ground shadows and reflections before transitioning the view: be warned that the extension currently doesn’t do this for you, so it may look a bit strange if you’re using either effect.
The overall layout is pretty huge, but really cool to search through. Here’s a zoomed out view of it all:
Here’s one close-up showing some of the content. Check out the stack of ceilings on the right, and the flex ducts in the foreground.
Here’s another view, showing the rooves, floors and walls. Such fun!
If you end up implementing this extension in your application and need something additional (such as clustering on a property other than category or needing to turns off ground shadows/reflections) then do let me (or the Forge team) know: this extension is still in its infancy, and the development team are definitely looking for feedback on possible directions for this extension.
In the meantime, happy clustering!