FireDynamics / fdsreader

Python reader for FDS data
GNU General Public License v3.0
44 stars 18 forks source link

Get RGBA-Value of obstruction from Surf_Id #77

Open ToniNabrotzky opened 4 months ago

ToniNabrotzky commented 4 months ago

Hi there,

I hope this place is the right spot for my question :)

I am currently developing an blender-addon for VR-Visualization of FDS-Simulations in blender. For this purpose, I would like to implement a function that extracts and imports the obstructions from an FDS simulation. Additionally, I need to check whether the components have been assigned a COLOR value or a Surf_Id with a RGB and Transparency value.

If obstructions have been directly assigned a Color value, the RGBA can be easily queried via fds.sim.obstructions[n].rgba.

But does fdsreader also have a function to query which Surf_Id has been assigned to the obstruction and how to extract the RGB and Transparency values from it?

JanVogelsang commented 4 months ago

Hi Toni, thanks for reaching out to us. First of all, I would like to also introduce you to a past project of mine, where I wrote a VR visualization tool for FDS data (including slices, obstructions, and 3D data/smoke) using the Unreal Engine: https://github.com/FireDynamics/VRSmokeVis In case you are just starting your project on VR visualizations, it might make sense to check out my work first, to not reinvent the wheel. Unfortunately, I had to put that project on hold as I went to pursue a PhD in a different field, but the first version of the tool was pretty much finished at the time I left.

Regarding your question about extracting surface information, you are the first person to ask for that feature so far, so it's not very mature at this point. All information FDS provides about surfaces is actually extracted in the fdsreader as well and should be available via SubObstruction.side_surfaces. I have never actually tested that after implementing it and am not aware of anyone using that feature, so please make sure to check for correctness before using those values. If you have any suggestions on how to make the surface information more accessible, those could very well be implemented as well. I would also be happy to review any pull requests on that topic, in case you want to improve the fdsreader yourself, which would be very welcome!

ToniNabrotzky commented 3 months ago

Hi Jan,

thank you for your quick response! :) I already know about your tool and analyzed it in my master thesis. Your work laid the foundation for my Blender add-on for FDS visualization.

Your response provided the precise information I required. I was able to understand how SubObstructions work for FDS and to implement my new feature. After testing, I can confirm that fdsreader functions correctly! :) I found querying information about SubObstructions via fds.sim.obstruction[n][0-5] slightly confusing. I had expected it to be structured more like obst[n].SubObstruction[0-5]. Perhaps enabling both methods would be helpful, although I don't consider this request a priority. The way it works at the moment is still satisfactory for me after I figured it out :)