A Streamlit component to display 3D models in STL format
Project description
Streamlit STL Display Component
A Streamlit component to display STL files.
Installation
This component requires access to write files to the temporary directory.
pip install streamlit_stl
Example
Look at the example for a streamlit Web App:
The original STL file is from Printables.
Usage
Display from file paths
import streamlit as st
from streamlit_stl import stl_from_file
success = stl_from_file(file_path=path_to_conf, # path to the stl file
color='#FF9900', # color of the stl file
material='material', # material of the stl file, either 'material' or 'wireframe'
auto_rotate=True, # auto rotate the stl file
height='500', # height of the viewer frame
key=None) # streamlit component key
Display from file text
import streamlit as st
from streamlit_stl import stl_from_text
file_input = st.file_uploader("Or upload a STL file ", type=["stl"])
success = stl_from_text(text=file_input.getvalue(), # text of te stl file
color='#FF9900', # color of the stl file
material='material', # material of the stl file, either 'material' or 'wireframe'
auto_rotate=True, # auto rotate the stl file
height='500', # height of the viewer frame
key=None) # streamlit component key
The functions return a boolean value indicating if the program was able to write and read the files.
License
Code is licensed under the GNU General Public License v3.0 (GPL-3.0)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
streamlit_stl-0.0.2.tar.gz
(179.7 kB
view details)
Built Distribution
streamlit_stl-0.0.2-py3-none-any.whl
(181.0 kB
view details)
File details
Details for the file streamlit_stl-0.0.2.tar.gz
.
File metadata
- Download URL: streamlit_stl-0.0.2.tar.gz
- Upload date:
- Size: 179.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1189d9e0010ffd8aaed85c64df078715f44fd6371294cddb9aefb25dce4d03d |
|
MD5 | 194c5ba75de125c26c69c45e86af18ef |
|
BLAKE2b-256 | 8e803fd6bfe9922392ead5ef43d31c389dd898fc1406c801bda3e56952f3f8c3 |
File details
Details for the file streamlit_stl-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: streamlit_stl-0.0.2-py3-none-any.whl
- Upload date:
- Size: 181.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68d22dc1acb07ac39a479ec750641923d6c19a1f0b2076cc3fbd6199f728b441 |
|
MD5 | 162e5a0dc162bf46cdbf80708bd8a4a0 |
|
BLAKE2b-256 | 2a946d1d9072472e365fb7a31b2e7426e37b3ad3ddde77ad98c491ee54064696 |