Inspiration

I wanted to be able to improve the structural analysis in Grasshopper and to organise the parametric data received about cross sections, utilisation, steel material in a tabular form.

What it does

Transport the commit from Streamlit to Grasshopper, perform the structural calculations with Karamba3D, then send it back to Streamlit and display the updated utilization table with the new values.

How we built it

Using functions in a Python script: get_latest_commit_id send_data_to_speckle fetch_data_from_speckle parse_dimensions_from_commit parse_data_from_commit add_materials_data commit2viewer transform_keys_to_integers extract_combined_data display_combined_table

Challenges we ran into

  • I had to enable embedding for the viewer from the Speckle stream, otherwise I was getting an error 404 in Streamlit
  • Authentications and permissions: get the speckle_token as environment variable. I wanted to have less hardcoded things and to not expose sensitive info
  • Dealing with scenarios where expected data is not found.
  • Correctly fetching the stream and commit data from the Speckle server without overwriting the commits.
  • Handling and parsing complex nested data structures returned by the Speckle API
  • Correctly capturing and processing user input, such as dimensions and Speckle token
  • I had to use getattr(), instead of get() for the Base objects

What we learned

I've learned a lot of new things, since I'm new also to programming. But I was curious to see how this process could work in Speckle.

What's next for Utilization of Steel Profiles - Speckle to Streamlit

Better structure of the 'Material' list when committing once from streamlit and from Grasshopper. The code has to be better organized. Maybe add a little bit of machine learning optimisation of the profiles later on.

Built With

  • grasshopper
  • karamba3d
  • python
  • speckle
  • streamlit
Share this project:

Updates