Metadata-Version: 2.4
Name: panopti
Version: 0.1.0
Summary: Panopti: a Python package for interactive 3D visualization.
Author: Arman Maesumi
Author-email: arman.maesumi@gmail.com
Keywords: 3D,visualization,geometry,interactive,web
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: numpy
Requires-Dist: requests
Requires-Dist: flask
Requires-Dist: flask-socketio
Requires-Dist: eventlet
Requires-Dist: python-socketio[client]
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary


# Panopti
![Logo](./docs/assets/images/panopti_logo.jpg)

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

# Simple example
First start a Panopti server in a separate terminal:
```bash
python -m panopti.run_server --host localhost --port 8080
```

Then you can easily define your scene, for example:
```python
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
verts = np.ascontiguousarray(verts, dtype=np.float32)
faces = np.ascontiguousarray(faces, dtype=np.int32)

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

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

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

viewer.hold() # prevent script from terminating
```

## Installation

To install from source:
```bash
git clone https://github.com/ArmanMaesumi/panopti
cd panopti
pip install .
```

To install from PIP:
```bash
pip install panopti
```

### Dependencies

Core dependencies:
```bash
pip install numpy eventlet requests flask flask-socketio
```

Optional dependencies:
```bash
pip install trimesh         # for exporting meshes
pip install matplotlib      # for colormap utilities
pip install plotly==5.22.0  # for plotly figure support
```

Doc-related dependencies:
```bash
pip install mkdocs mkdocs-material mkdocstrings mkdocstrings-python
```
