Spaces:
Paused
Paused
File size: 1,023 Bytes
bf6f707 6069c12 bf6f707 6069c12 bf6f707 b9712ee 6069c12 bf6f707 6069c12 bf6f707 6069c12 bf6f707 6069c12 bf6f707 6069c12 bf6f707 7c5bb4c b9712ee 7c5bb4c 6069c12 7c5bb4c afb6ab8 6069c12 7c5bb4c 9ce4eb5 7c5bb4c 52d12eb 7c5bb4c bf6f707 6069c12 ed977b5 bf6f707 6069c12 d86e484 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | import pyvista as pv
import sys
st_mode = '-gui' not in sys.argv
print('Starting it all...')
if st_mode:
import streamlit as st
st.set_page_config(layout="wide")
from stpyvista import stpyvista
from stpyvista.utils import start_xvfb
if "IS_XVFB_RUNNING" not in st.session_state:
start_xvfb()
st.session_state.IS_XVFB_RUNNING = True
## Initialize a plotter object
plotter = pv.Plotter(window_size=[800,600])
print('Reading all the objs...')
mesh = pv.read('a_mouse.obj')
plotter.add_mesh(mesh, smooth_shading=True, color='white')
mesh2 = pv.read('full_mouse.obj')
mesh2.translate((-40,0,0), inplace=True)
plotter.add_mesh(mesh2, smooth_shading=True, color='tan')
print('Read objs...')
plotter.add_axes()
plotter.enable_mesh_picking(show_message=True)
## Final touches
plotter.view_isometric()
#plotter.add_scalar_bar()
plotter.background_color = 'white'
if st_mode:
## Pass a key to avoid re-rendering at each page change
stpyvista(plotter, key="pv_cube")
else:
plotter.show()
|