diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-29 14:16:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-29 14:24:12 +0300 |
commit | 18af73e461f9a943ae606fcc1401297f4afad20f (patch) | |
tree | deb37b1cada483388b7f246c6d50b3e4332b5d31 /source/blender/python/mathutils/mathutils_bvhtree.h | |
parent | ba32d9d4cd2ad256722a4405d2b1909ec8d4d811 (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_bvhtree.h')
-rw-r--r-- | source/blender/python/mathutils/mathutils_bvhtree.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/python/mathutils/mathutils_bvhtree.h b/source/blender/python/mathutils/mathutils_bvhtree.h new file mode 100644 index 00000000000..634556d68f7 --- /dev/null +++ b/source/blender/python/mathutils/mathutils_bvhtree.h @@ -0,0 +1,36 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + + +/** \file blender/python/mathutils/mathutils_bvhtree.h + * \ingroup mathutils + */ + +#ifndef __MATHUTILS_BVHTREE_H__ +#define __MATHUTILS_BVHTREE_H__ + +PyMODINIT_FUNC PyInit_mathutils_bvhtree(void); + +extern PyTypeObject PyBVHTree_Type; + +#define PyBVHTree_Check(_v) PyObject_TypeCheck((_v), &PyBVHTree_Type) +#define PyBVHTree_CheckExact(v) (Py_TYPE(v) == &PyBVHTree_Type) + +#endif /* __MATHUTILS_BVHTREE_H__ */ |