|
Blender V4.3
|
#include "MEM_guardedalloc.h"#include "BLI_math_geom.h"#include "BLI_math_vector.h"#include "BLI_sort.h"#include "BLI_stack.h"#include "BLI_vector.hh"#include "BKE_bvhutils.hh"#include "atomic_ops.h"#include "bmesh.hh"#include "bmesh_intersect_edges.hh"Go to the source code of this file.
Classes | |
| struct | EDBMSplitBestFaceData |
| struct | EDBMSplitElem |
| struct | EDBMSplitData |
Macros | |
| #define | KDOP_TREE_TYPE 4 |
| #define | KDOP_AXIS_LEN 14 |
| #define | BLI_STACK_PAIR_LEN (2 * KDOP_TREE_TYPE) |
| #define | EDGE_ACT_TO_TEST 1 |
| #define | EDGE_REMAIN_TO_TEST 2 |
Functions | |
Weld Linked Wire Edges into Linked Faces | |
Used with the merge vertices option. | |
| static bool | bm_vert_pair_share_best_splittable_face_cb (BMFace *f, BMLoop *l_a, BMLoop *l_b, void *userdata) |
| static bool | bm_vert_pair_share_splittable_face_cb (BMFace *, BMLoop *l_a, BMLoop *l_b, void *userdata) |
| static BMFace * | bm_vert_pair_best_face_get (BMVert *v_a, BMVert *v_b, BMEdge **edgenet, const int edgenet_len, const float epsilon) |
Auto-Merge & Split Selection | |
Used after transform operations. | |
| #define | INTERSECT_EDGES |
| static void | bm_vert_pair_elem_setup_ex (BMVert *v, EDBMSplitElem *r_pair_elem) |
| static void | bm_edge_pair_elem_setup (BMEdge *e, float lambda, int *r_data_cut_edges_len, EDBMSplitElem *r_pair_elem) |
| static bool | bm_edgexvert_isect_impl (BMVert *v, BMEdge *e, const float co[3], const float dir[3], float lambda, float data_dist_sq, int *data_cut_edges_len, EDBMSplitElem r_pair[2]) |
| static bool | bm_vertxvert_isect_cb (void *userdata, int index_a, int index_b, int thread) |
| static bool | bm_vertxvert_self_isect_cb (void *userdata, int index_a, int index_b, int thread) |
| static bool | bm_edgexvert_isect_cb (void *userdata, int index_a, int index_b, int thread) |
| static bool | bm_edgexedge_isect_impl (EDBMSplitData *data, BMEdge *e_a, BMEdge *e_b, const float co_a[3], const float dir_a[3], const float co_b[3], const float dir_b[3], float lambda_a, float lambda_b, EDBMSplitElem r_pair[2]) |
| static bool | bm_edgexedge_isect_cb (void *userdata, int index_a, int index_b, int thread) |
| static bool | bm_edgexedge_self_isect_cb (void *userdata, int index_a, int index_b, int thread) |
| static void | bm_elemxelem_bvhtree_overlap (const BVHTree *tree1, const BVHTree *tree2, BVHTree_OverlapCallback callback, EDBMSplitData *data, BLI_Stack **pair_stack) |
| static int | sort_cmp_by_lambda_cb (const void *index1_v, const void *index2_v, void *keys_v) |
| bool | BM_mesh_intersect_edges (BMesh *bm, const char hflag, const float dist, const bool split_faces, GHash *r_targetmap) |
| #define BLI_STACK_PAIR_LEN (2 * KDOP_TREE_TYPE) |
Definition at line 29 of file bmesh_intersect_edges.cc.
Referenced by BM_mesh_intersect_edges().
| #define EDGE_ACT_TO_TEST 1 |
Referenced by BM_mesh_intersect_edges().
| #define EDGE_REMAIN_TO_TEST 2 |
Referenced by BM_mesh_intersect_edges().
| #define INTERSECT_EDGES |
Definition at line 473 of file bmesh_intersect_edges.cc.
| #define KDOP_AXIS_LEN 14 |
Definition at line 28 of file bmesh_intersect_edges.cc.
Referenced by BM_mesh_intersect_edges().
| #define KDOP_TREE_TYPE 4 |
Definition at line 27 of file bmesh_intersect_edges.cc.
Referenced by BM_mesh_intersect_edges().
|
static |
Definition at line 215 of file bmesh_intersect_edges.cc.
References atomic_fetch_and_add_int32(), e, EDBMSplitElem::edge, BMVert::head, BMHeader::index, and EDBMSplitElem::lambda.
Referenced by bm_edgexedge_isect_impl(), and bm_edgexvert_isect_impl().
Definition at line 392 of file bmesh_intersect_edges.cc.
References BLI_stack_push_r(), BM_edge_at_index(), BM_edge_share_vert_check(), bm_edgexedge_isect_impl(), BMVert::co, copy_v3_v3(), isect_ray_ray_epsilon_v3(), sub_v3_v3v3(), BMEdge::v1, and BMEdge::v2.
Referenced by bm_edgexedge_self_isect_cb(), and BM_mesh_intersect_edges().
|
static |
Definition at line 333 of file bmesh_intersect_edges.cc.
References bm_edge_pair_elem_setup(), IN_RANGE_INCL, len_squared_v3(), len_squared_v3v3(), madd_v3_v3v3fl(), square_f(), BMEdge::v1, and BMEdge::v2.
Referenced by bm_edgexedge_isect_cb().
|
static |
Definition at line 428 of file bmesh_intersect_edges.cc.
References bm_edgexedge_isect_cb().
Referenced by BM_mesh_intersect_edges().
Definition at line 307 of file bmesh_intersect_edges.cc.
References BLI_stack_push_r(), BM_edge_at_index(), bm_edgexvert_isect_impl(), BM_vert_at_index(), BMVert::co, copy_v3_v3(), e, ray_point_factor_v3_ex(), sub_v3_v3v3(), and v.
Referenced by BM_mesh_intersect_edges().
|
static |
Definition at line 234 of file bmesh_intersect_edges.cc.
References bm_edge_pair_elem_setup(), bm_vert_pair_elem_setup_ex(), BMVert::co, e, IN_RANGE_INCL, len_squared_v3(), len_squared_v3v3(), madd_v3_v3v3fl(), square_f(), and v.
Referenced by bm_edgexvert_isect_cb().
|
static |
Definition at line 439 of file bmesh_intersect_edges.cc.
References BLI_bvhtree_overlap_ex(), BLI_bvhtree_overlap_thread_num(), BLI_stack_new, BVH_OVERLAP_USE_THREADING, and callback.
Referenced by BM_mesh_intersect_edges().
| bool BM_mesh_intersect_edges | ( | BMesh * | bm, |
| const char | hflag, | ||
| const float | dist, | ||
| const bool | split_faces, | ||
| GHash * | r_targetmap ) |
The weld_verts operator works best when all keys in the same group of collapsed vertices point to the same vertex. That is, if the pairs of vertices are: [1, 2], [2, 3] and [3, 4], They are better adjusted to: [1, 4], [2, 4] and [3, 4].
va---vb---
/
va_dest
---v---v_other
\
v_other_dest
Definition at line 475 of file bmesh_intersect_edges.cc.
References as_int(), BLI_assert, BLI_bvhtree_balance(), BLI_bvhtree_free(), BLI_bvhtree_insert(), BLI_bvhtree_new(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_lookup_p(), BLI_qsort_r(), BLI_stack_count(), BLI_stack_free(), BLI_STACK_PAIR_LEN, BLI_stack_pop_n_reverse(), bm, EDBMSplitData::bm, BM_CREATE_NOP, BM_DISK_EDGE_NEXT, BM_EDGE, BM_edge_create(), BM_edge_exists(), BM_edge_is_wire(), BM_edge_other_vert(), BM_edge_split(), BM_EDGES_OF_MESH, bm_edgexedge_isect_cb(), bm_edgexedge_self_isect_cb(), bm_edgexvert_isect_cb(), BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_elem_index_get, BM_elem_index_set, BM_ELEM_TAG, bm_elemxelem_bvhtree_overlap(), BM_face_normal_update(), BM_face_split_edgenet(), BM_ITER_MESH, BM_ITER_MESH_INDEX, BM_mesh_elem_table_ensure(), BM_VERT, bm_vert_pair_best_face_get(), BM_vert_pair_share_face_check(), BM_VERTS_OF_MESH, bm_vertxvert_isect_cb(), bm_vertxvert_self_isect_cb(), BMVert::co, copy_v3_v3(), count, e, EDBMSplitElem::edge, EDGE_ACT_TO_TEST, EDGE_REMAIN_TO_TEST, EDBMSplitElem::elem, BMesh::elem_index_dirty, BMElem::head, BMVert::head, BMHeader::htype, BMHeader::index, KDOP_AXIS_LEN, KDOP_TREE_TYPE, EDBMSplitElem::lambda, len_squared_v3v3(), MEM_freeN(), MEM_mallocN, MEM_reallocN, sort_cmp_by_lambda_cb(), square_f(), v, BMEdge::v1, BMEdge::v2, and EDBMSplitElem::vert.
Referenced by EDBM_automerge_and_split().
|
static |
Definition at line 126 of file bmesh_intersect_edges.cc.
References BLI_assert, BM_edge_in_face(), BM_ITER_ELEM, bm_vert_pair_share_best_splittable_face_cb(), bm_vert_pair_share_splittable_face_cb(), BM_vert_pair_shared_face_cb(), BM_VERTS_OF_FACE, BMVert::co, copy_v3_v3(), dot(), dot_v3v3(), EDBMSplitBestFaceData::edgenet, FLT_MAX, min, and sub_v3_v3v3().
Referenced by BM_mesh_intersect_edges().
|
static |
Definition at line 210 of file bmesh_intersect_edges.cc.
References v, and EDBMSplitElem::vert.
Referenced by bm_edgexvert_isect_impl(), and bm_vertxvert_isect_cb().
|
static |
Definition at line 51 of file bmesh_intersect_edges.cc.
References BLI_assert, BM_edge_other_vert(), BM_face_point_inside_test(), BMVert::co, copy_v3_v3(), dot(), dot_v3v3(), ELEM, l_b, min, BMFace::no, BMLoop::v, BMEdge::v1, and BMEdge::v2.
Referenced by bm_vert_pair_best_face_get().
|
static |
Definition at line 96 of file bmesh_intersect_edges.cc.
References BMVert::co, copy_v3_v3(), float, IN_RANGE, isect_ray_ray_v3(), l_b, BMLoop::next, BMLoop::prev, sub_v3_v3v3(), and BMLoop::v.
Referenced by bm_vert_pair_best_face_get().
Definition at line 283 of file bmesh_intersect_edges.cc.
References BLI_stack_push_r(), BM_vert_at_index(), and bm_vert_pair_elem_setup_ex().
Referenced by BM_mesh_intersect_edges(), and bm_vertxvert_self_isect_cb().
|
static |
Definition at line 297 of file bmesh_intersect_edges.cc.
References bm_vertxvert_isect_cb().
Referenced by BM_mesh_intersect_edges().
|
static |
Definition at line 458 of file bmesh_intersect_edges.cc.
Referenced by BM_mesh_intersect_edges().