Skip to main content

WGPU-based 3d viewer

Project description

octarine banner

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.

docs

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:

  1. Lightweight with very few direct or indirect dependencies.
  2. Works in both Jupyter and REPL.
  3. 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.

demo gif

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


Download files

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

Source Distribution

octarine3d-0.4.1.tar.gz (52.8 kB view details)

Uploaded Source

Built Distribution

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

octarine3d-0.4.1-py3-none-any.whl (54.1 kB view details)

Uploaded Python 3

File details

Details for the file octarine3d-0.4.1.tar.gz.

File metadata

  • Download URL: octarine3d-0.4.1.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

Hashes for octarine3d-0.4.1.tar.gz
Algorithm Hash digest
SHA256 768b93480455d01f75d96cd4b51eadb9b052d55fe7a43804dd22ef2d7e7a770d
MD5 89a1d9f2c51cbd9b978163e3065aeb1e
BLAKE2b-256 131251a7fbe2fd5ce9da085bc05f97f0a1716d0467f3e25d01269a7f35fba9b8

See more details on using hashes here.

File details

Details for the file octarine3d-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: octarine3d-0.4.1-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

Hashes for octarine3d-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d26ba888ee02e75a3117fee5c143f1721d738d047ef495631e10bd6b7b709dc5
MD5 667d5ce08f65cd9e3fc36293e3345a8e
BLAKE2b-256 29cd2e38efe06f0d150c90f30b96d32c0272756b4b2f68a789f3c5a585a2cf10

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