WGPU-based 3d viewer
Project description
Octarine is the eighth color of the Discworld's spectrum, which is described as the color of magic itself. Only wizards and cats can see it.
Octarine
A minimalist, easy-to-use, high-performance 3D viewer. Octarine is build on top of the excellent
pygfx WGPU rendering engine which does most of the heavy lifting - we're simply
abstracting away some of the boiler plate code for you.
Rationale :thought_balloon:
Why another 3D viewer? There are plenty options out there:
vedo, ipygany, polyscope, napari, fury, plotly or pyvista to name but a few. All of these are great in their own right but I wanted something (a) without heavy dependencies (i.e. no VTK), (b) that lets me interactively explore my data in both REPL and Jupyter and (c) is very performant. None of the existing solutions ticked all those boxes for me.
Octarine tries to fill that gap:
- Lightweight with very few direct or indirect dependencies.
- Works in both Jupyter and REPL.
- High performance: a mesh with 15M faces renders with 80 fps at 1080p on a 2023 MacBook Pro.
Installation :rocket:
pip install "octarine3d[all]"
This will install the minimal requirements plus PySide6 and jupyter_rfb as window managers for IPython/shell
and Jupyter, respectively. Check out the Install Instructions
for details.
Quickstart :fire:
# Create a Viewer instance
from octarine import Viewer
v = Viewer()
# Add random points as scatter
import numpy as np
points = np.random.rand(10, 3) # 10 random points
v.add(points)
# Clear scene
v.clear()
# Add a mesh (see also `Viewer.add_mesh`)
import pygfx as gfx
m = gfx.geometries.mobius_strip_geometry()
v.add(m, color='b')
# Close the viewer
v.close()
[!NOTE] The above example will work in interactive environments such as IPython and Jupyter. When using from the standard REPL or when running as a script you will have to additionally start the event loop. Please see corresponding the section in the Introduction.
Want to learn more?
Head over to the Documentation!
Want to contribute?
We welcome all kinds of contributions. For example:
- reports of bugs, broken examples, etc.
- feature requests
- pull requests with bug fixes or new features
If you already know what needs doing, feel free to open a pull request right away. When in doubt please open an issue so we can discuss the best way to address the issue.
Development :dash:
Tests
We're currently running only a very limited test suite. What's there can be run with:
pytest -v
Docs
To generate the documentation:
pip install -e .[docs]
mkdocs build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file octarine3d-0.4.0.tar.gz.
File metadata
- Download URL: octarine3d-0.4.0.tar.gz
- Upload date:
- Size: 52.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6adf7a8776b12061b00b7f110d7fa673dbd9bb1b5637efecbc3677c22053f338
|
|
| MD5 |
406c4d2f106c8c34b166379ee27bb590
|
|
| BLAKE2b-256 |
d93d2d659146bd5907670f1d6a1e8ed9b74fab733187ee0a52536043ff2095f0
|
File details
Details for the file octarine3d-0.4.0-py3-none-any.whl.
File metadata
- Download URL: octarine3d-0.4.0-py3-none-any.whl
- Upload date:
- Size: 54.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
313d833ff0cdde4bb4c7b3ddd040f7947a406cc089c6ef396584c8a27d741925
|
|
| MD5 |
3eb64e197688c28f47bd94742db47fc9
|
|
| BLAKE2b-256 |
ca8a5d992c68412961c116145f61f22d18e7ca97f682f6bdaa38df0f8660d4bb
|