Skip to main content

Panopti: Interactive 3D visualization in Python.

Project description

Panopti:
Interactive 3D Visualization in Python

Logo

[ Documentation ] - [ PyPI ]

Panopti is a Python package for interactive 3D visualization that seamlessly supports remote development setups (e.g. through SSH). It pairs a Flask server with a React+ThreeJS frontend and is designed such that users only need to write Python code, making it painless to setup interactive experiments and scenes. All code examples and demos throughout the documentation are achieved purely using Panopti in Python -- no JavaScript required!.

Panopti supports various geometric data structures (e.g. meshes, point clouds), UI control elements (e.g. buttons, sliders, color pickers, interactive plots) that are programmable in Python, and global event callbacks (e.g. for camera movement, clicking on geometry).

Install from pip:

pip install panopti

Simple example

First start a Panopti server in a separate terminal:

python -m panopti.run_server --host localhost --port 8080

Then you can easily define your scene, for example:

import panopti
import trimesh # just for io

# create panopti client that connects to server:
viewer = panopti.connect(server_url="http://localhost:8080", viewer_id='client') 
# viewer at: http://localhost:8080/?viewer_id=client

mesh = trimesh.load('./examples/demosthenes.obj')
verts, faces = mesh.vertices, mesh.faces

# add a mesh to the scene:
viewer.add_mesh(
    vertices=verts,
    faces=faces,
    name="Statue"
)

def callback_button(viewer):
    # Update the mesh's vertices
    statue = viewer.get('Statue')
    new_verts = statue.vertices * 2.0
    statue.update(vertices=new_verts)

viewer.button(callback=callback_button, name='Click Me!')

viewer.hold() # prevent script from terminating

For more examples see Documentation or /examples

Installation

To install from pip:

pip install panopti

To install 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 .

Dependencies

Core dependencies:

pip install numpy eventlet requests flask flask-socketio python-socketio[client] tomli msgpack trimesh

Optional dependencies:

pip install matplotlib      # for colormap utilities
pip install plotly==5.22.0  # for plotly figure support

Doc-related dependencies:

pip install mkdocs mkdocs-material mkdocstrings mkdocstrings-python

Development

Details for running the local development workflow can be found in: /frontend/README.md

Cite as

@misc{panopti,
  title = {Panopti},
  author = {Arman Maesumi},
  note = {https://github.com/ArmanMaesumi/panopti},
  year = {2025}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panopti-0.2.1.tar.gz (8.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

panopti-0.2.1-py3-none-any.whl (8.4 MB view details)

Uploaded Python 3

File details

Details for the file panopti-0.2.1.tar.gz.

File metadata

  • Download URL: panopti-0.2.1.tar.gz
  • Upload date:
  • Size: 8.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for panopti-0.2.1.tar.gz
Algorithm Hash digest
SHA256 03a09bad2301b6d0e4ea9118e6f2f4fb2578e1fb38d04505ff869329d4c80af4
MD5 92269c440945a6a718436e4d852516de
BLAKE2b-256 03422b758b72b9948f853b1db7e54f4c9cd22d047569f6dcd09e03868f198a6c

See more details on using hashes here.

File details

Details for the file panopti-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: panopti-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for panopti-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d19d6c51be8091b0cd80936b88de34535b213a824edc6fd0eb034f5a3fa28ca4
MD5 574146fb22ba9c81b8bf1d8596e9d2c6
BLAKE2b-256 a1b716d5ee58cd9df0dec4b777542c9b7cb2c9b312413a145fdaa70baeb99559

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page