Blender V4.3
bmesh_boolean.hh File Reference

Go to the source code of this file.

Functions

bool BM_mesh_boolean (BMesh *bm, blender::Span< std::array< BMLoop *, 3 > > looptris, int(*test_fn)(BMFace *f, void *user_data), void *user_data, int nshapes, bool use_self, bool keep_hidden, bool hole_tolerant, int boolean_mode)
 
bool BM_mesh_boolean_knife (BMesh *bm, blender::Span< std::array< BMLoop *, 3 > > looptris, int(*test_fn)(BMFace *f, void *user_data), void *user_data, int nshapes, bool use_self, bool use_separate_all, bool hole_tolerant, bool keep_hidden)
 

Function Documentation

◆ BM_mesh_boolean()

bool BM_mesh_boolean ( BMesh * bm,
blender::Span< std::array< BMLoop *, 3 > > looptris,
int(* test_fn )(BMFace *, void *),
void * user_data,
const int nshapes,
const bool use_self,
const bool keep_hidden,
const bool hole_tolerant,
const int boolean_mode )

Perform the boolean operation specified by boolean_mode on the mesh bm. The inputs to the boolean operation are either one sub-mesh (if use_self is true), or two sub-meshes. The sub-meshes are specified by providing a test_fn which takes a face and the supplied user_data and says with 'side' of the boolean operation that face is for: 0 for the first side (side A), 1 for the second side (side B), and -1 if the face is to be ignored completely in the boolean operation.

If use_self is true, all operations do the same: the sub-mesh is self-intersected and all pieces inside that result are removed. Otherwise, the operations can be one of BMESH_ISECT_BOOLEAN_ISECT, BMESH_ISECT_BOOLEAN_UNION, or BMESH_ISECT_BOOLEAN_DIFFERENCE.

(The actual library function called to do the boolean is internally capable of handling n-ary operands, so maybe in the future we can expose that functionality to users.)

Definition at line 465 of file bmesh_boolean.cc.

References UNUSED_VARS.

Referenced by blender::ed::sculpt_paint::trim::apply_trim(), and edbm_intersect_boolean_exec().

◆ BM_mesh_boolean_knife()

bool BM_mesh_boolean_knife ( BMesh * bm,
blender::Span< std::array< BMLoop *, 3 > > looptris,
int(* test_fn )(BMFace *, void *),
void * user_data,
const int nshapes,
const bool use_self,
const bool use_separate_all,
const bool hole_tolerant,
const bool keep_hidden )

Perform a Knife Intersection operation on the mesh bm. There are either one or two operands, the same as described above for BM_mesh_boolean().

Parameters
use_separate_allWhen true, each edge that is created from the intersection should be used to separate all its incident faces. TODO: implement that.

TODO: need to ensure that "selected/non-selected" flag of original faces gets propagated to the intersection result faces.

Perform a Knife Intersection operation on the mesh bm. There are either one or two operands, the same as described above for BM_mesh_boolean(). If use_separate_all is true, each edge that is created from the intersection should be used to separate all its incident faces. TODO: implement that. TODO: need to ensure that "selected/non-selected" flag of original faces gets propagated to the intersection result faces.

Definition at line 487 of file bmesh_boolean.cc.

References UNUSED_VARS.

Referenced by edbm_intersect_exec().