Skip to content

Lucandia/streamlit_stl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Alt Text

Look at the example for a streamlit Web App:

Streamlit 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)

License: GPL-3.0

About

A Streamlit component to display STL files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published