Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-07-29 14:16:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-07-29 14:24:12 +0300
commit18af73e461f9a943ae606fcc1401297f4afad20f (patch)
treedeb37b1cada483388b7f246c6d50b3e4332b5d31 /source/blender/python/mathutils/mathutils.c
parentba32d9d4cd2ad256722a4405d2b1909ec8d4d811 (diff)
Add mathutils.bvhtree API
Originally D966 by @lukastoenne, with own additions - trees can be initialized from Object's, BMesh, or passed in as vert+polygon arrays. - original indices of ngons/faces are used. (instead of tessellated indices). - ray_cast, find_nearest methods - find overlapping faces between 2 trees
Diffstat (limited to 'source/blender/python/mathutils/mathutils.c')
-rw-r--r--source/blender/python/mathutils/mathutils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c
index ba7f351996a..ec249e823e4 100644
--- a/source/blender/python/mathutils/mathutils.c
+++ b/source/blender/python/mathutils/mathutils.c
@@ -600,6 +600,7 @@ static struct PyModuleDef M_Mathutils_module_def = {
#include "mathutils_geometry.h"
#include "mathutils_interpolate.h"
#ifndef MATH_STANDALONE
+# include "mathutils_bvhtree.h"
# include "mathutils_kdtree.h"
# include "mathutils_noise.h"
#endif
@@ -653,6 +654,11 @@ PyMODINIT_FUNC PyInit_mathutils(void)
PyDict_SetItemString(sys_modules, PyModule_GetName(submodule), submodule);
Py_INCREF(submodule);
+ /* BVHTree submodule */
+ PyModule_AddObject(mod, "bvhtree", (submodule = PyInit_mathutils_bvhtree()));
+ PyDict_SetItemString(sys_modules, PyModule_GetName(submodule), submodule);
+ Py_INCREF(submodule);
+
/* KDTree submodule */
PyModule_AddObject(mod, "kdtree", (submodule = PyInit_mathutils_kdtree()));
PyDict_SetItemString(sys_modules, PyModule_GetName(submodule), submodule);