From 91a429ba25b6e47327be8f8e5f880e817f599b87 Mon Sep 17 00:00:00 2001 From: nicolalandro Date: Sun, 21 Nov 2021 14:10:22 +0100 Subject: [PATCH] create release --- pipy_readme.rst | 16 ++++++++++++++++ setup.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pipy_readme.rst b/pipy_readme.rst index 8391ca1..13f662f 100644 --- a/pipy_readme.rst +++ b/pipy_readme.rst @@ -24,6 +24,22 @@ Use in a Jupyter notebook to display a .obj 3D file: obj2html('model.obj', 'index.html') display(HTML('index.html')) +Use in streamlit app to display a .obj 3D file and create download button: + +.. code-block:: python + + import streamlit as st + import streamlit.components.v1 as components + from obj2html import obj2html + + html_string = obj2html("model.obj", html_elements_only=True) + components.html(html_string) + with open("model.obj") as f: + st.download_button('Download model.obj', f, file_name="download_name.obj") + +.. image:: https://gitlab.com/nicolalandro/obj2html/-/raw/main/imgs/streamlit_example.png + :alt: Streamlit example + It is also possible to set the scale factor, light and camera options: .. code-block:: python diff --git a/setup.py b/setup.py index 4360ba4..ec7a8e9 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'pipy_readme. setup( name = 'obj2html', packages = ['obj2html'], - version = '0.13', + version = '0.14', license='MIT', description = 'Create an html with three.js that contains the given .obj file.', long_description = long_des,