Blender V5.3
bmesh_intersect.cc File Reference
#include <algorithm>
#include "MEM_guardedalloc.h"
#include "BLI_linklist.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_memarena.hh"
#include "BLI_set.hh"
#include "BLI_utildefines.hh"
#include "BLI_vector.hh"
#include "BLI_utildefines_stack.hh"
#include "BLI_kdopbvh.hh"
#include "bmesh.hh"
#include "intern/bmesh_private.hh"
#include "bmesh_intersect.hh"
#include "tools/bmesh_edgesplit.hh"
#include "BLI_strict_flags.hh"

Go to the source code of this file.

Classes

struct  blender::ISectEpsilon
struct  blender::ISectState
struct  blender::LinkBase
struct  blender::VertSort
struct  blender::LoopFilterWrap
struct  blender::RaycastData

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define USE_SPLICE
#define USE_NET
#define USE_SEPARATE
#define USE_DISSOLVE
#define USE_NET_ISLAND_CONNECT
#define USE_BVH
#define KEY_SET(k, i0, i1, i2, i3)
#define KEY_EDGE_TRI_ORDER(k)
#define VERT_VISIT_A   _FLAG_WALK
#define VERT_VISIT_B   _FLAG_WALK_ALT
#define STACK_PUSH_TEST_A(ele)
#define STACK_PUSH_TEST_B(ele)

Enumerations

enum  blender::ISectType {
  blender::IX_NONE = -1 , blender::IX_EDGE_TRI_EDGE0 , blender::IX_EDGE_TRI_EDGE1 , blender::IX_EDGE_TRI_EDGE2 ,
  blender::IX_EDGE_TRI , blender::IX_TOT
}

Functions

static void blender::tri_v3_scale (float v1[3], float v2[3], float v3[3], const float t)
static BMEdge * blender::bm_vert_other_edge (BMVert *v, BMEdge *e)
static bool blender::ghash_insert_link (GHash *gh, void *key, void *val, bool use_test, MemArena *mem_arena)
static void blender::edge_verts_sort (const float co[3], LinkBase *v_ls_base)
static void blender::edge_verts_add (ISectState *s, BMEdge *e, BMVert *v, const bool use_test)
static void blender::face_edges_add (ISectState *s, const int f_index, BMEdge *e, const bool use_test)
static void blender::face_edges_split (BMesh *bm, BMFace *f, LinkBase *e_ls_base, bool use_island_connect, bool use_partial_connect, MemArena *mem_arena_edgenet)
static void blender::vert_dissolve_add (ISectState *s, BMVert *v)
static enum ISectType blender::intersect_line_tri (const float p0[3], const float p1[3], const float *t_cos[3], const float t_nor[3], float r_ix[3], const ISectEpsilon *e)
static BMVert * blender::bm_isect_edge_tri (ISectState *s, BMVert *e_v0, BMVert *e_v1, BMVert *t[3], const int t_index, const float *t_cos[3], const float t_nor[3], enum ISectType *r_side)
static bool blender::bm_loop_filter_fn (const BMLoop *l, void *user_data)
static void blender::bm_isect_tri_tri (ISectState *s, int a_index, int b_index, const std::array< BMLoop *, 3 > &a, const std::array< BMLoop *, 3 > &b, bool no_shared)
static void blender::raycast_callback (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *)
static int blender::isect_bvhtree_point_v3 (BVHTree *tree, const float **looptris, const float co[3])
bool blender::BM_mesh_intersect (BMesh *bm, const Span< std::array< BMLoop *, 3 > > looptris, int(*test_fn)(BMFace *f, void *user_data), void *user_data, const bool use_self, const bool use_separate, const bool use_dissolve, const bool use_island_connect, const bool use_partial_connect, const bool use_edge_tag, const int boolean_mode, const float eps)

Detailed Description

Cut meshes along intersections.

Boolean-like modeling operation (without calculating inside/outside).

Supported:

  • Concave faces.
  • Non-planar faces.
  • Custom-data (UVs etc).

Unsupported:

  • Intersecting between different meshes.
  • No support for holes (cutting a hole into a single face).

Definition in file bmesh_intersect.cc.

Macro Definition Documentation

◆ KEY_EDGE_TRI_ORDER

#define KEY_EDGE_TRI_ORDER ( k)
Value:
{ \
if (k[2] > k[3]) { \
std::swap(k[2], k[3]); \
} \
if (k[0] > k[2]) { \
std::swap(k[0], k[2]); \
std::swap(k[1], k[3]); \
} \
} \
(void)0

Referenced by blender::bm_isect_edge_tri().

◆ KEY_SET

#define KEY_SET ( k,
i0,
i1,
i2,
i3 )
Value:
{ \
(k)[0] = i0; \
(k)[1] = i1; \
(k)[2] = i2; \
(k)[3] = i3; \
} \
(void)0

Referenced by blender::bm_isect_edge_tri().

◆ STACK_PUSH_TEST_A

#define STACK_PUSH_TEST_A ( ele)
Value:
BM_ELEM_API_FLAG_ENABLE(ele, VERT_VISIT_A); \
STACK_PUSH(iv_ls_a, ele); \
} \
((void)0)
#define VERT_VISIT_A
#define BM_ELEM_API_FLAG_TEST(element, f)

Referenced by blender::bm_isect_tri_tri().

◆ STACK_PUSH_TEST_B

#define STACK_PUSH_TEST_B ( ele)
Value:
BM_ELEM_API_FLAG_ENABLE(ele, VERT_VISIT_B); \
STACK_PUSH(iv_ls_b, ele); \
} \
((void)0)
#define VERT_VISIT_B

Referenced by blender::bm_isect_tri_tri().

◆ USE_BVH

#define USE_BVH

Definition at line 67 of file bmesh_intersect.cc.

◆ USE_DISSOLVE

#define USE_DISSOLVE

Definition at line 60 of file bmesh_intersect.cc.

◆ USE_NET

#define USE_NET

Definition at line 56 of file bmesh_intersect.cc.

Referenced by blender::BM_mesh_intersect().

◆ USE_NET_ISLAND_CONNECT

#define USE_NET_ISLAND_CONNECT

Definition at line 62 of file bmesh_intersect.cc.

◆ USE_SEPARATE

#define USE_SEPARATE

Definition at line 58 of file bmesh_intersect.cc.

◆ USE_SPLICE

#define USE_SPLICE

Definition at line 54 of file bmesh_intersect.cc.

Referenced by blender::BM_mesh_intersect().

◆ VERT_VISIT_A

#define VERT_VISIT_A   _FLAG_WALK

◆ VERT_VISIT_B

#define VERT_VISIT_B   _FLAG_WALK_ALT