New Component: streamlit-stl, a new way to display 3D models!

Hi everyone,
I made a new scrappy component to easily display 3D models from STL files (the program is based on three.js).
It is pip-installable too.
You can find an example web app here: https://st-stl.streamlit.app
The code here: GitHub - Lucandia/streamlit_stl: A Streamlit component to display STL files
Enjoy!
Luca

16 Likes

Very cool!

1 Like

This is awesome! :star_struck:

1 Like

Perhaps you can try displaying 3D model files with multiple colors. As far as I know, glb files can contain color markers. I am using https://unpkg.com/@google/model-viewer@latest to display the model in Streamlit, but this is done through direct HTML embedding rather than wrapping it into a proper component. I believe using three.js might yield better performance. Looking forward to further developments in your project.

1 Like

Amazing, thanks for sharing. Super helpful for one of my projects in particular!

1 Like

TIL about GLB files and those can be read with pyvista and rendered with stpyvista too!

image

STL files are also supported by stpyvista, but if you don’t need the full power of pyvista, @lmonari5’s component looks pretty good.

3 Likes

Yes, for a more complex render, I suggest using pyvista.
I just wanted to use CadQuery for 3d modelling and display in a streamlined way, as you can see here for dual letter illusion or hooks for 3d printing
I faced some troubles with the VTK module requirements from Cadquery vs Pyvista.
Instead, streamlit_stl doesn’t have any particular requirement, so it should be quite stable/reliable for simple use

1 Like

Bringing together 3D printing and Streamlit?! Nice!

Haven’t touched my 3D printer in ages (Lulzbot Taz 6) but this is making me want to dig through STLs and get making again. Thank you

2 Likes

Trop fort ! Un grand merci à toi !
Is it possible to set opacity ?

1 Like

Thank you so much!
No, sorry, I didn’t think about setting the opacity