2 Dec 2023

Simple Implementation of fader application using Data Visualization

APS: DataViz Fader

The fader application from forge-rcdb is a bit complex due to shader coding and custom mesh, We can leverage Data Visualization API and make it easy to implement the same. This sample does exactly that, complexity is reduced hugely, source code is relatively less, easy to understand and reuse.

Demo: https://aps-dataviz-fader.autodesk.io

Source code: https://github.com/autodesk-platform-services/aps-dataviz-fader

Steps to reuse the code in your model:

Step 1: Figure out the bounding box of the floor and plan the sensor grid. To generate evenly distributed heatmap points, you need to plan the number of points based on the dimension of the floor.

Step 2: Use Advanced Planar Heatmap Options to add the heatmap options.

Step 3: On hover, use raycasting and get the intersections. 

Step 4: Update Sensor values using intersections and attenuation variables.

Step 5: Finally, update the surface shading on hover or click event.

 

Note: The important point here is the dual use of sensor positions for both heatmap and target points in raycasting.

This sample uses Revit rooms to generate the shading data, which is a big room that covers the whole floor, so please make sure your model has a valid Revit Room, room geometry can be complex, but there shouldn't be an enclosed area within the room when designing the seed file, keep a small opening like an opening space for a door, this way those small rooms will come under one big room and not as a separate room, which is required in this case.

 

Related Article