Getting started
Installation
Installing from pip
Installing from source
git clone https://github.com/ArmanMaesumi/panopti
# build frontend viewer
cd panopti/frontend
npm install
npm run build
cd ..
# install python package
pip install .
Core dependencies (included in pip install):
Optional dependencies:
pip install matplotlib # for colormap utilities
pip install plotly==5.22.0 # for plotly figure support
Running a Panopti server
The Panopti server runs in an isolated process as your user code, hence you should run it in a separate terminal. You may use the convenience module (recommended):
or manually through your own scriptWarning
You should not run start_server
from your main script. The server is meant to run in its own process, which avoids slowing down your code.
The viewer will then be available at http://http://localhost:8080/?viewer_id=your_client_id
Note: Your application will register its own viewer_id
, which will affect the link above (see below).
Connecting to a Panopti server
Once your server is running, your main application can connect to the instance via:
import panopti
viewer_id = "client" # choose a unique id here
viewer = panopti.connect(server_url="http://localhost:8080", viewer_id=viewer_id)
# now in your browser open: http://localhost:8080/?viewer_id=client
# ... your code here ...
viewer.hold() # prevent the script from terminating
viewer_id
to distinguish between different scripts that may be running concurrently. This argument must be specified even when just one session is active.
Hello World with Panopti
Now let's add a simple mesh to the viewer.
import panopti
import trimesh # only for io
viewer = panopti.connect(server_url="http://localhost:8080", viewer_id='client')
mesh = trimesh.load('demosthenes.obj')
verts, faces = mesh.vertices, mesh.faces
viewer.add_mesh(
vertices=verts,
faces=faces,
name="Statue"
)
viewer.hold() # prevent the script from terminating
Examples
tab, or:
Working remotely (SSH)
Panopti seamlessly integrates into remote work setups. Please refer to the Remote SSH page for details.