Blender  V2.93
BLI_mesh_boolean.hh
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
23 /* The boolean functions in Blenlib use exact arithmetic, so require GMP. */
24 #ifdef WITH_GMP
25 
26 # include "BLI_mesh_intersect.hh"
27 # include <functional>
28 
29 namespace blender::meshintersect {
30 
34 enum class BoolOpType {
35  None = -1,
36  /* Aligned with #BooleanModifierOp. */
37  Intersect = 0,
38  Union = 1,
39  Difference = 2,
40 };
41 
57 IMesh boolean_mesh(IMesh &imesh,
58  BoolOpType op,
59  int nshapes,
60  std::function<int(int)> shape_fn,
61  bool use_self,
62  bool hole_tolerant,
63  IMesh *imesh_triangulated,
64  IMeshArena *arena);
65 
71 IMesh boolean_trimesh(IMesh &tm_in,
72  BoolOpType op,
73  int nshapes,
74  std::function<int(int)> shape_fn,
75  bool use_self,
76  bool hole_tolerant,
77  IMeshArena *arena);
78 
79 } // namespace blender::meshintersect
80 
81 #endif /* WITH_GMP */
DBVT_INLINE bool Intersect(const btDbvtAabbMm &a, const btDbvtAabbMm &b)
Definition: btDbvt.h:621