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.1.tar.gz
(176.3 kB
view details)
Built Distribution
streamlit_stl-0.0.1-py3-none-any.whl
(177.4 kB
view details)
File details
Details for the file streamlit_stl-0.0.1.tar.gz
.
File metadata
- Download URL: streamlit_stl-0.0.1.tar.gz
- Upload date:
- Size: 176.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7478546284ea73f70fa5840c0e8cf491b518d813e82fb7432da85b6faac4aca3 |
|
MD5 | bcf92b43849c9e06352f157da3d35ae5 |
|
BLAKE2b-256 | 91bb3d5e4aecdb43992e16628b655661b3c30a383a172787b41cbc2d46c68e40 |
File details
Details for the file streamlit_stl-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: streamlit_stl-0.0.1-py3-none-any.whl
- Upload date:
- Size: 177.4 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 | 760df113a06bef9121007737fef5b16fee19e95325e928fc7999e7b8a54e453a |
|
MD5 | 5bbfafc60210967786412968613d60a8 |
|
BLAKE2b-256 | 729d4632168e182ba87442c3831ec22d46487767f08c675a5f80c3f06dd0c8fc |