|
Blender V4.3
|
#include "MEM_guardedalloc.h"#include "BLI_alloca.h"#include "BLI_math_geom.h"#include "BLI_math_vector.h"#include "BLI_memarena.h"#include "BLI_sort_utils.h"#include "BLI_utildefines.h"#include "BLI_linklist_stack.h"#include "BLI_utildefines_stack.h"#include "BLI_buffer.h"#include "BLI_kdopbvh.h"#include "bmesh.hh"#include "intern/bmesh_private.hh"#include "bmesh_intersect.hh"#include "tools/bmesh_edgesplit.hh"#include "BLI_strict_flags.h"Go to the source code of this file.
Classes | |
| struct | ISectEpsilon |
| struct | ISectState |
| struct | LinkBase |
| struct | vert_sort_t |
| struct | LoopFilterWrap |
| struct | RaycastData |
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 | ISectType { IX_NONE = -1 , IX_EDGE_TRI_EDGE0 , IX_EDGE_TRI_EDGE1 , IX_EDGE_TRI_EDGE2 , IX_EDGE_TRI , IX_TOT } |
Functions | |
| static void | tri_v3_scale (float v1[3], float v2[3], float v3[3], const float t) |
| static BMEdge * | bm_vert_other_edge (BMVert *v, BMEdge *e) |
| static bool | ghash_insert_link (GHash *gh, void *key, void *val, bool use_test, MemArena *mem_arena) |
| static void | edge_verts_sort (const float co[3], LinkBase *v_ls_base) |
| static void | edge_verts_add (ISectState *s, BMEdge *e, BMVert *v, const bool use_test) |
| static void | face_edges_add (ISectState *s, const int f_index, BMEdge *e, const bool use_test) |
| static void | 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 | vert_dissolve_add (ISectState *s, BMVert *v) |
| static enum ISectType | 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 * | 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 | bm_loop_filter_fn (const BMLoop *l, void *user_data) |
| static void | 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 | raycast_callback (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *) |
| static int | isect_bvhtree_point_v3 (BVHTree *tree, const float **looptris, const float co[3]) |
| bool | BM_mesh_intersect (BMesh *bm, const blender::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) |
Cut meshes along intersections.
Boolean-like modeling operation (without calculating inside/outside).
Supported:
Unsupported:
Definition in file bmesh_intersect.cc.
| #define KEY_EDGE_TRI_ORDER | ( | k | ) |
Referenced by bm_isect_edge_tri().
| #define KEY_SET | ( | k, | |
| i0, | |||
| i1, | |||
| i2, | |||
| i3 ) |
Referenced by bm_isect_edge_tri().
| #define STACK_PUSH_TEST_A | ( | ele | ) |
Referenced by bm_isect_tri_tri().
| #define STACK_PUSH_TEST_B | ( | ele | ) |
Referenced by bm_isect_tri_tri().
| #define USE_BVH |
Definition at line 64 of file bmesh_intersect.cc.
| #define USE_DISSOLVE |
Definition at line 57 of file bmesh_intersect.cc.
| #define USE_NET |
Definition at line 53 of file bmesh_intersect.cc.
Referenced by BM_mesh_intersect().
| #define USE_NET_ISLAND_CONNECT |
Definition at line 59 of file bmesh_intersect.cc.
| #define USE_SEPARATE |
Definition at line 55 of file bmesh_intersect.cc.
| #define USE_SPLICE |
Definition at line 51 of file bmesh_intersect.cc.
Referenced by BM_mesh_intersect().
| #define VERT_VISIT_A _FLAG_WALK |
Referenced by bm_isect_tri_tri().
| #define VERT_VISIT_B _FLAG_WALK_ALT |
Referenced by bm_isect_tri_tri().
| enum ISectType |
| Enumerator | |
|---|---|
| IX_NONE | |
| IX_EDGE_TRI_EDGE0 | |
| IX_EDGE_TRI_EDGE1 | |
| IX_EDGE_TRI_EDGE2 | |
| IX_EDGE_TRI | |
| IX_TOT | |
Definition at line 93 of file bmesh_intersect.cc.
|
static |
Definition at line 336 of file bmesh_intersect.cc.
References ARRAY_SIZE, BLI_assert, BLI_ghash_insert(), BLI_ghash_lookup(), BLI_memarena_alloc(), bm, BM_edge_exists(), BM_elem_index_get, BM_vert_create(), BMVert::co, e, edge_verts_add(), intersect_line_tri(), IX_EDGE_TRI, IX_EDGE_TRI_EDGE0, IX_EDGE_TRI_EDGE1, IX_EDGE_TRI_EDGE2, IX_NONE, IX_TOT, KEY_EDGE_TRI_ORDER, KEY_SET, len_squared_v3v3(), printf, UNPACK3, UNPACK3_EX, UNPACK4, and vert_dissolve_add().
Referenced by bm_isect_tri_tri().
|
static |
Return true if we have any intersections.
Definition at line 500 of file bmesh_intersect.cc.
References ARRAY_SIZE, b, BLI_gset_add(), BLI_gset_insert(), BM_edge_create(), BM_edge_exists(), BM_edge_in_face(), BM_ELEM_API_FLAG_DISABLE, BM_ELEM_API_FLAG_TEST, BM_elem_index_get, BM_face_share_edge_check(), bm_isect_edge_tri(), copy_v3_v3(), e, edge_verts_add(), ELEM, face_edges_add(), interp_v3_v3v3(), isect_point_tri_v3(), len_squared_v3v3(), line_point_factor_v3(), normal_tri_v3(), printf, STACK_DECLARE, STACK_INIT, STACK_PUSH_TEST_A, STACK_PUSH_TEST_B, STACK_SIZE, tri_v3_scale(), UNLIKELY, UNPACK2, UNPACK3, UNPACK3_EX, v, VERT_VISIT_A, and VERT_VISIT_B.
Referenced by BM_mesh_intersect().
|
static |
Definition at line 473 of file bmesh_intersect.cc.
References BM_elem_flag_test, BM_ELEM_TAG, BMLoop::e, BMLoop::f, l, BMLoop::radial_next, and UNLIKELY.
Referenced by BM_mesh_intersect().
| bool BM_mesh_intersect | ( | BMesh * | bm, |
| const blender::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 ) |
Definition at line 952 of file bmesh_intersect.cc.
References BLI_assert, BLI_bvhtree_balance(), BLI_bvhtree_free(), BLI_bvhtree_insert(), BLI_bvhtree_new(), BLI_bvhtree_overlap_ex(), BLI_ghash_free(), BLI_ghash_int_new(), BLI_ghash_len(), BLI_ghash_new(), BLI_ghash_ptr_new(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), BLI_ghashutil_inthash_v4_cmp, BLI_ghashutil_inthash_v4_p, BLI_gset_add(), BLI_gset_free(), BLI_gset_haskey(), BLI_gset_insert(), BLI_gset_len(), BLI_gset_ptr_new(), BLI_gset_remove(), BLI_gsetIterator_getKey(), BLI_memarena_clear(), BLI_memarena_free(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, bm, BM_DISK_EDGE_NEXT, BM_EDGE, BM_edge_exists(), BM_edge_kill(), BM_edge_other_vert(), BM_edge_split(), BM_EDGES_OF_MESH, BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_TAG, BM_FACE, BM_face_calc_point_in_face(), BM_face_kill_loose(), BM_face_normal_flip(), bm_isect_tri_tri(), BM_ITER_MESH_MUTABLE, bm_loop_filter_fn(), BM_mesh_calc_face_groups(), BM_mesh_edgesplit(), BM_mesh_elem_hflag_disable_all(), BM_mesh_elem_index_ensure(), BM_mesh_elem_table_ensure(), BM_select_history_clear(), BM_VERT, BM_vert_collapse_edge(), BM_vert_in_edge(), BM_vert_is_edge_pair(), BM_vert_kill(), bm_vert_other_edge(), BM_vert_pair_share_face_check(), BM_vert_splice(), BM_vert_splice_check_double(), BMESH_ISECT_BOOLEAN_DIFFERENCE, BMESH_ISECT_BOOLEAN_ISECT, BMESH_ISECT_BOOLEAN_NONE, BMESH_ISECT_BOOLEAN_UNION, BVH_OVERLAP_RETURN_PAIRS, BVH_OVERLAP_USE_THREADING, clamp_f(), BMVert::co, copy_v3_v3(), cos(), BMVert::e, e, edge_verts_sort(), ELEM, eps, BMLoop::f, face_edges_split(), faces, flag, BMesh::ftable, GHASH_ITER, GSET_ITER, int, isect_bvhtree_point_v3(), BMEdge::l, BMFace::len, len_squared_v3v3(), line_point_factor_v3(), LinkBase::list, LinkBase::list_len, BMFace::mat_nr, MEM_freeN(), MEM_mallocN, LinkNode::next, node, POINTER_AS_INT, printf, BMLoop::radial_next, STACK_DECLARE, STACK_INIT, STACK_PUSH_RET, STACK_SIZE, LoopFilterWrap::test_fn, BMesh::totface, UNLIKELY, UNPACK2, UNPACK3, UNUSED_VARS, UNUSED_VARS_NDEBUG, USE_NET, USE_SPLICE, and v.
Referenced by blender::ed::sculpt_paint::trim::apply_trim(), BMD_mesh_intersection(), edbm_intersect_boolean_exec(), edbm_intersect_exec(), and blender::geometry::boolean::mesh_boolean_float().
Definition at line 81 of file bmesh_intersect.cc.
References BLI_assert, BM_DISK_EDGE_NEXT, BM_vert_in_edge(), BM_vert_is_edge_pair(), BMVert::e, e, and v.
Referenced by BM_mesh_intersect().
|
static |
Definition at line 188 of file bmesh_intersect.cc.
References BLI_assert, BM_EDGE, BM_VERT, e, ghash_insert_link(), BMVert::head, BMHeader::htype, and v.
Referenced by bm_isect_edge_tri(), and bm_isect_tri_tri().
Definition at line 164 of file bmesh_intersect.cc.
References BLI_array_alloca, BLI_assert, BLI_sortutil_cmp_float(), BM_VERT, BMVert::co, BMVert::head, BMHeader::htype, len_squared_v3v3(), LinkBase::list, LinkBase::list_len, node, v, vert_sort_t::v, and vert_sort_t::val.
Referenced by BM_mesh_intersect().
|
static |
Definition at line 195 of file bmesh_intersect.cc.
References BLI_assert, BM_EDGE, BM_edge_in_face(), BM_elem_index_get, e, ghash_insert_link(), BMVert::head, BMHeader::htype, and POINTER_FROM_INT.
Referenced by bm_isect_tri_tri().
|
static |
Definition at line 206 of file bmesh_intersect.cc.
References BLI_array_alloca, BLI_assert, bm, BM_elem_index_get, BM_FACE, BM_face_split_edgenet(), BM_face_split_edgenet_connect_islands(), BMFace::head, BMHeader::htype, LinkBase::list, LinkBase::list_len, node, printf, and UNUSED_VARS.
Referenced by BM_mesh_intersect().
|
static |
Definition at line 130 of file bmesh_intersect.cc.
References BLI_ghash_ensure_p(), BLI_linklist_index(), BLI_memarena_alloc(), LinkNode::link, LinkBase::list, LinkBase::list_len, mem_arena, and LinkNode::next.
Referenced by edge_verts_add(), and face_edges_add().
|
static |
Definition at line 265 of file bmesh_intersect.cc.
References copy_v3_v3(), dot_v3v3(), e, fabsf, interp_v3_v3v3(), isect_line_line_epsilon_v3(), isect_line_segment_tri_epsilon_v3(), IX_EDGE_TRI, IX_EDGE_TRI_EDGE0, IX_NONE, len_squared_v3v3(), line_point_factor_v3(), min_fff(), normalize_v3(), and sub_v3_v3v3().
Referenced by bm_isect_edge_tri().
|
static |
Definition at line 894 of file bmesh_intersect.cc.
References BLI_buffer_declare_static, BLI_buffer_free, BLI_BUFFER_NOP, BLI_bvhtree_ray_cast(), BLI_sortutil_cmp_float(), BVH_RAYCAST_DIST_MAX, eps, BVHTreeRayHit::index, printf, raycast_callback(), and tree.
Referenced by BM_mesh_intersect().
|
static |
Definition at line 854 of file bmesh_intersect.cc.
References BLI_buffer_append, isect_ray_tri_epsilon_v3(), isect_ray_tri_watertight_v3(), RaycastData::looptris, print_v3(), printf, USE_KDOPBVH_WATERTIGHT, v2, and RaycastData::z_buffer.
Referenced by cast_ray_highpoly(), and isect_bvhtree_point_v3().
Definition at line 68 of file bmesh_intersect.cc.
References interp_v3_v3v3(), mid_v3_v3v3v3(), and v2.
Referenced by bm_isect_tri_tri().
|
static |
Definition at line 254 of file bmesh_intersect.cc.
References BLI_assert, BLI_linklist_index(), BLI_linklist_prepend_arena(), BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_TAG, BM_VERT, BMVert::head, BMHeader::htype, and v.
Referenced by bm_isect_edge_tri().