K3D Jupyter
K3D lets you create 3D plots backed by WebGL with high-level API (surfaces, isosurfaces, voxels, mesh, point clouds, vtk objects, volume renderer, colormaps, etc). The primary aim of K3D-jupyter is to be easy to use as a standalone package like matplotlib, but also to allow interoperation with existing libraries as VTK. K3D can be run as:
- Jupyter Notebook / JupyterLab widget (anywidget) 🚀
- Google Colab widget 🎉
- VS Code notebooks 🧩
- Standalone HTML/JS 📑
Since 3.0.0 a plot also chooses how it is lit, through plot.renderer: simple (the
default rasteriser), advanced (image-based lighting with ambient occlusion) or cinematic
(progressive path tracing). cinematic is experimental — it needs WebGL2 with renderable
float textures, does not cover every object (volume_slice is not drawn, volumes stay
outside the light simulation), and its API and output may still change; simple and
advanced are the stable choices. See
Renderers.
Documentation: https://k3d-jupyter.org
Showcase:
Two frames from the renderers 3.0.0 added, both produced by the code in this repository — click either one for how it works.
advanced: image-based lighting and ambient occlusion. A million analytic sphere impostors,
with the occlusion in the crevices between strands doing the sculpting.
cinematic: progressive path tracing. 871k triangles read through VTK, 512 samples, lit only
by an environment map — the shadow under the belly and the light the floor throws back into
the flank are consequences of the simulation, not effects.
YouTube:
Click to watch at YouTube:
Try it Now!
Watch: Interactive showcase gallery
Installation
PyPI
To install from PyPI use pip:
$ pip install k3d
Conda/Anaconda
To install from conda-forge use:
$ conda install -c conda-forge k3d
Google Colab
Since 3.0.0 (the anywidget migration) no extra steps are needed:
!pip install k3d
import k3d and plot - custom widget activation and the text protocol
are no longer required.
Installing directly from GitHub
To install directly from this repository (requires git and node.js + npm to build):
$ pip install git+https://github.com/K3D-tools/K3D-jupyter
This also makes possible installing the most up-to-date development version (same requirements):
$ pip install git+https://github.com/K3D-tools/K3D-jupyter@devel
To install any historical version, replace devel above with any tag or commit hash.
Source
For a development installation (requires npm and node.js),
$ git clone https://github.com/K3D-tools/K3D-jupyter.git
$ cd K3D-jupyter
$ pip install -e .
No separate JupyterLab extension step is needed - the widget ships its own frontend module (anywidget).
Code of Conduct
K3D-jupyter follows the Python Software Foundation Code of Conduct in everything we do.
Kudos
- Jupyter is my ❤️
- OpenDreamKit is 🚀
- Three.js is 🥇
Acknowledgments
|
|
Research Infrastructure project This package was created as part of the Horizon 2020 European OpenDreamKit (grant agreement #676541). |
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 k3d-3.0.0.tar.gz.
File metadata
- Download URL: k3d-3.0.0.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ca0a6f4a34749317f910bafbff508f1f4eac3e008f8c0891893e6b0541c0406
|
|
| MD5 |
aa12486ce72ea33823f011e73b1b1ae4
|
|
| BLAKE2b-256 |
e9f62c4ed3f9f8e29b4ecd6a107c55b087cb78161c3171d577aacf69dcfc1f7d
|
File details
Details for the file k3d-3.0.0-py3-none-any.whl.
File metadata
- Download URL: k3d-3.0.0-py3-none-any.whl
- Upload date:
- Size: 7.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2e864574d192dfa116e0a9046b8a81e5aeb0a10ee94e11267ee3a8c95ac0863
|
|
| MD5 |
41501d70f90b34d0917c22112a24b65c
|
|
| BLAKE2b-256 |
8a3f40b3f02cac9e76683394c11feb0e44a20e8050f7d139d05983d98b0ae0df
|