diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-10 11:52:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-10 11:52:10 +0400 |
commit | 5dbe17cc125bf7d9e96b45c02bdfbd00b6103bdf (patch) | |
tree | 869a2065615d4a5eee145704abb1a28411fd87af /source/blender/blenlib/BLI_convexhull2d.h | |
parent | 46db99e7fdec050ffeef49faa05e6d34103217c4 (diff) |
add 2d convex hull utility function, BLI_convexhull_2d(), and python api mathutils.geometry.convex_hull_2d()
uses Andrew's monotone chain 2D convex hull algorithm.
Diffstat (limited to 'source/blender/blenlib/BLI_convexhull2d.h')
-rw-r--r-- | source/blender/blenlib/BLI_convexhull2d.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_convexhull2d.h b/source/blender/blenlib/BLI_convexhull2d.h new file mode 100644 index 00000000000..30de786eb96 --- /dev/null +++ b/source/blender/blenlib/BLI_convexhull2d.h @@ -0,0 +1,31 @@ +/* + * ***** 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 ***** + */ + +#ifndef __BLI_CONVEXHULL2D__ +#define __BLI_CONVEXHULL2D__ + +/** \file BLI_convexhull2d.h + * \ingroup bli + */ + +int BLI_convexhull_2d_presorted(const float (*points)[2], const int n, int r_points[]); +int BLI_convexhull_2d(const float (*points)[2], const int n, int r_points[]); + +#endif /* __BLI_CONVEXHULL2D__ */ |