A python wrapper around a subset of the ncollide rust library
Project description
========= ncollpyde
.. image:: https://img.shields.io/pypi/pyversions/ncollpyde.svg :target: https://pypi.python.org/pypi/ncollpyde
.. image:: https://img.shields.io/pypi/v/ncollpyde.svg :target: https://pypi.python.org/pypi/ncollpyde
.. image:: https://img.shields.io/travis/clbarnes/ncollpyde.svg :target: https://travis-ci.org/clbarnes/ncollpyde
.. image:: https://readthedocs.org/projects/ncollpyde/badge/?version=latest :target: https://ncollpyde.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/ambv/black
A python wrapper around a subset of the ncollide rust library
- Free software: MIT License
- Documentation: https://ncollpyde.readthedocs.io.
Features
- Checking whether points are inside a volume defined by a triangular mesh
Usage
.. code-block:: python
# get an array of vertices and triangles which refer to those points
import meshio
mesh = meshio.read("tests/teapot.stl")
vertices = mesh.points
triangles = mesh.cells["triangle"]
# use this library
from ncollpyde import Volume
volume = Volume(vertices, triangles)
Containment checks:
.. code-block:: python
# individual points (as 3-length array-likes) can be checked with `in`
assert [-2.3051376, -4.1556454, 1.9047838] in volume
assert [-0.35222054, -0.513299, 7.6191354] not in volume
# many points (as an Nx3 array-like) can be checked with the `contains` method
bools = volume.contains(np.array([
[-2.3051376, -4.1556454, 1.9047838],
[-0.35222054, -0.513299, 7.6191354],
]))
assert np.array_equal(bools, [True, False])
# checks can be parallelised
volume.contains(np.random.random((1000, 3)), threads=4)
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 Distributions
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 ncollpyde-0.4.0.tar.gz.
File metadata
- Download URL: ncollpyde-0.4.0.tar.gz
- Upload date:
- Size: 217.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c172ed3e28eac1e56545a9f31f6d605a59d1db5c60e0f0ff6e432ef1f532a360
|
|
| MD5 |
19628f3e8b94488f5cb1478891d75c8d
|
|
| BLAKE2b-256 |
3122ea4eaf1783a56f07fc7c5bbb392f13a9a1b04313d5ad1e0d594d2c2ed67c
|
File details
Details for the file ncollpyde-0.4.0-cp38-cp38-manylinux1_x86_64.whl.
File metadata
- Download URL: ncollpyde-0.4.0-cp38-cp38-manylinux1_x86_64.whl
- Upload date:
- Size: 201.3 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab364db3ca54d5b621aa40fc1295f497287feaecf7548987dce7523457832efe
|
|
| MD5 |
82418ece3a0f80c36bbaa4396daa5b4a
|
|
| BLAKE2b-256 |
7dc1ba9f38a3d824730eeb363dbd9887463fde5149bbd1191c1b3c0af0caf016
|
File details
Details for the file ncollpyde-0.4.0-cp37-cp37m-manylinux1_x86_64.whl.
File metadata
- Download URL: ncollpyde-0.4.0-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 201.3 kB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b55e936c3d9cb281e02c865f3be929c65f1d30034695cbaecfb9f05de5cd0b7
|
|
| MD5 |
fc208075817bfc4414743d96d7b5fdad
|
|
| BLAKE2b-256 |
7736c964e1ecd88986f682a1330f73ece08c14dc37344478f2898fdf545fe559
|