Banner

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

A minimal example looks like:

import panopti
viewer = panopti.connect(server_url="http://localhost:8080", viewer_id="client")

# ... load triangle mesh vertices / faces ...

viewer.add_mesh(vertices=vertices, faces=faces, name="MyMesh")

# Add a UI element w/ Python callback:
def my_button_callback(viewer):
    print('MyButton was pressed!')
viewer.button(callback=my_button_callback, name='MyButton')

# Add a camera event listener:
@viewer.events.camera()
def my_camera_callback(viewer, camera_info):
    print('Camera was updated: ', camera_info)

viewer.hold() # prevent script from terminating