Octree structure containing 3D triangular mesh model
Octree structure containing a 3D triangular mesh model. To be used for ray tracing / shadow casting.
Written in C++ for speed, but exposed to Python using Cython.
Pyoctree uses an adaptive structure, so it will automatically divide branches to ensure that there are no more than 200 objects per leaf.
Intersection testing uses parallel processing via OpenMP. To use more than a single processor, set value of environment variable OMP_NUM_THREADS to number of desired processors.
Note that a compiler is not required if installing using the provided Python wheel.
In a command prompt, browse to the base directory containing the setup.py file and type:
python setup.py install
Download the python wheel from releases i.e. pyoctree-0.2.2-cp27-cp27m-win_amd64.whl for Python 2.7 on Windows 64-bit. Then, open a command prompt, browse to the download directory and type:
pip install pyoctree-0.2.2-cp27-cp27m-win_amd64.whl
from pyoctree import pyoctree as ot tree = ot.PyOctree(pointCoords,connectivity)
The octree can be used to quickly find intersections between the object and a ray. For example:
import numpy as np startPoint = [0.0,0.0,0.0] endPoint = [0.0,0.0,1.0] rayList = np.array([[startPoint,endPoint]],dtype=np.float32) intersectionFound = tree.rayIntersection(rayList)
Some Jupyter notebooks are provided in the Examples directory on how to use pyoctree.
If help is required, please create an issue on Github.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|pyoctree-0.2.2-cp27-cp27m-win_amd64.whl (2.3 MB) Copy SHA256 Checksum SHA256||cp27||Wheel||May 27, 2017|
|pyoctree-0.2.2-cp36-cp36m-win_amd64.whl (2.3 MB) Copy SHA256 Checksum SHA256||cp36||Wheel||May 27, 2017|
|pyoctree-0.2.2.tar.gz (2.2 MB) Copy SHA256 Checksum SHA256||–||Source||May 27, 2017|