Ray queries on triangular meshes.
Project description
python-embree
This library is a thin wrapper around Embree 3.
As much as possible, it tries to emulate the C API usage. The main point of this is to avoid creating a new API which would obfuscate the usage of the C API. Ideally, it should be easy to read the Embree documentation or examples, and translate things straightforwardly to equivalent Python code.
A secondary goal is to provide easy interoperability with numpy.
NOTE: very little of the library is wrapped so far, but this library is being developed in a way that should make it as easy as possible to wrap more functionality as necessary. If you find that a function that you'd like to use isn't wrapped, please create an issue or feel free to wrap it on your own and submit a pull request.
Installation
Windows
If you install Embree using the MSI from Embree's website, the Embree
binaries, headers, and libraries will all be installed to C:\Program Files\Intel\Embree3
by default.
As an example, to compile using MSYS2 from the MinGW 64-bit console,
after cd
ing to the root directory of this repository, it should be
possible to run:
$ python setup.py build_ext -I/c/Program\ Files/Intel/Embree3/include -L /c/Program\ Files/Intel/Embree3/lib
$ python setup.py install
to successfully compile and install python-embree.
Tips and tricks
Retain and release
The underlying Embree library uses reference counting to properly
clean up resources used by the different types it provides
(RTCDevice
, RTCScene
, etc.). This means that each type exposes a
pair of "retain" and "release" functions: e.g., rtcRetainDevice
, and
rtcReleaseDevice
. How to use these correctly is spelled out in the
Embree API docs and the many
Embree tutorials. Please
consult these when using
python-embree. The
classes providing a lightweight object-oriented wrapper around
Embree's types do not call any retain or release functions behind the
scenes: this is the user's responsibility.
Parallelism
Using multiprocessing for concurrency in Python requires objects that are put into queues to be serialized using pickle. Unfortunately, it is not currently possible to serialize the Embree data structures (see the Embree repository's issues #137 and #238), and there do not appear to be plans to support this feature. The rationale for not supporting this feature is that building the Embree BVH from scratch is usually faster than reading the equivalent amount of data from disk.
This means that you will not be able to use any of the extensions
classes exported by
embree.pyx
(such as embree.Device
, embree.Scene
, etc.) with multiprocessing
directly. To get around this problem, a simple fix is to wrap a bit
of Embree functionality in a Python class with its own __reduce__
method. For an example, see the implementation of TrimeshShapeModel
here.
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 Distributions
Built Distributions
File details
Details for the file embree-0.0.4-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: embree-0.0.4-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 16.6 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d3c240f6530c54b35a7ebe6b5cfad3f38ef265ec6876ea8a308b8ff679b2576 |
|
MD5 | 65a4649ddf8dbdb7d0c79e6dd9332d0c |
|
BLAKE2b-256 | 6149f852808a18999641700768ce6cb607c67a81d0f41130d7272567ca9f5fd0 |
File details
Details for the file embree-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: embree-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 18.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a31a0236f8576e6faa85bc09101ef0399da0abc9e1fa53256ff99777c2ed5ee |
|
MD5 | 5d23d7e27f317942fff8bd3e94334b3b |
|
BLAKE2b-256 | abfbcb1ef9e6d7b8adeafc51b20f0ba8602d0c0c84452859c37d367dcbc2e846 |
File details
Details for the file embree-0.0.4-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: embree-0.0.4-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 16.6 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c64ecc845310fbded3906a64130c7e71b72f74fb71b1eb0095ce264bbf6a937 |
|
MD5 | 5614f91c12e4255761e10eb755e85411 |
|
BLAKE2b-256 | 2291d557900f09abcc5a870b306334952cf1725f3cc43295fa9e3b6760c7974e |
File details
Details for the file embree-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: embree-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 18.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | add79338f2bfb9542778b3463492073eb85ec93c8fecc294e4f19726284c8062 |
|
MD5 | 697f6f9d30a2e93b159ca5efff69f26b |
|
BLAKE2b-256 | dc99a6360180dca1d7d75aa992cd245c72c7ef352c0386442b5e6d82c86c7fd2 |
File details
Details for the file embree-0.0.4-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: embree-0.0.4-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 16.6 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 821db8619440b638f017941a804f707001c588f19348f717ad0b2182d7100441 |
|
MD5 | 47df92f10d4759371af4003408a9a017 |
|
BLAKE2b-256 | 9244c7d4f192354d37117361cfe2e1e0e4c6ce36e8ecba00970280edc1273eaa |
File details
Details for the file embree-0.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: embree-0.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 18.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24095e8c5441adec31d29fc4ac1f8e0a9edde7ce608f283356d934af7774cd78 |
|
MD5 | 4763e6a873f8d4e3e5a23314e5d05fe5 |
|
BLAKE2b-256 | cf8e56b98718448052c5bb21e7ba8b589f33fe849dda87622ae1ec740935517a |
File details
Details for the file embree-0.0.4-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: embree-0.0.4-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 16.6 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bea3936a3a49414c899559aa4aff104672f722a1018b5571a1ad7e93354bd349 |
|
MD5 | 7582471af091e67136188e53c399e94a |
|
BLAKE2b-256 | 62dc8520d690157a7f40015eede078f831c5a0561e4b2eeb559cb7de754af060 |
File details
Details for the file embree-0.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: embree-0.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 18.9 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | baa2316fc87262b19421742c760b0a79a8d463a8b0c524ae3957bd5368bd537b |
|
MD5 | 0a10372a25b86e436dd0e9f13e9ae224 |
|
BLAKE2b-256 | 77bb02293ec86d58e40a8f13ac6ad7c1f2b2b03cdd13fea6ce70043bfefdb825 |
File details
Details for the file embree-0.0.4-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: embree-0.0.4-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 16.6 MB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7289e89f9b3f706b50c2f0b270e9e2f2ac442b0c00b7ea09783da2d2c0a42cd5 |
|
MD5 | 0c1dc7123f372e2f2d0ef91f9e97cd75 |
|
BLAKE2b-256 | 488893fbb5ab806cc0231a5bc6bde8b20846dfc262ebc4be5a159d3d977809b0 |
File details
Details for the file embree-0.0.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: embree-0.0.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 18.9 MB
- Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c58beec0bc2baf6bff94c28586b82ac4815500638d335194a8a41523e402012c |
|
MD5 | 2ba76b36e3fffc4aec8c2913f59db397 |
|
BLAKE2b-256 | 7feede69797b20f93dd48126289f64f1d4c0528b6f016dbf6136520609110e08 |