Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_heap_simple.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "bmesh.h"
#include "intern/bmesh_operators_private.h"
#include "BLI_mempool.h"
Go to the source code of this file.
Classes | |
struct | PathContext |
struct | PathLink |
struct | PathLinkState |
struct | MinDistDir |
Macros | |
#define | CONNECT_EPS 0.0001f |
#define | VERT_OUT 1 |
#define | VERT_EXCLUDE 2 |
#define | FACE_EXCLUDE 2 |
#define | ELE_TOUCHED 4 |
#define | FACE_WALK_TEST(f) (CHECK_TYPE_INLINE(f, BMFace *), BMO_face_flag_test(pc->bm_bmoflag, f, FACE_EXCLUDE) == 0) |
#define | VERT_WALK_TEST(v) (CHECK_TYPE_INLINE(v, BMVert *), BMO_vert_flag_test(pc->bm_bmoflag, v, VERT_EXCLUDE) == 0) |
#define | ELE_TOUCH_MARK(e) |
#define | ELE_TOUCH_TEST_VERT(v) BMO_vert_flag_test(pc->bm_bmoflag, v, ELE_TOUCHED) |
#define | ELE_TOUCH_TEST_EDGE(e) BMO_edge_flag_test(pc->bm_bmoflag, e, ELE_TOUCHED) |
Typedefs | |
typedef struct PathContext | PathContext |
typedef struct PathLink | PathLink |
typedef struct PathLinkState | PathLinkState |
Min Dist Dir Util | |
Simply getting the closest intersecting vert/edge is not good enough. see T43792 we need to get the closest in both directions since the absolute closest may be a dead-end. Logic is simple:
| |
#define | MIN_DIST_DIR_INIT |
typedef struct MinDistDir | MinDistDir |
static int | min_dist_dir_test (MinDistDir *mddir, const float dist_dir[3], const float dist_sq) |
static void | min_dist_dir_update (MinDistDir *dist, const float dist_dir[3]) |
Connect vertex pair across multiple faces (splits faces).
Definition in file bmo_connect_pair.c.
#define CONNECT_EPS 0.0001f |
Method for connecting across many faces.
Definition at line 40 of file bmo_connect_pair.c.
Definition at line 60 of file bmo_connect_pair.c.
#define ELE_TOUCH_TEST_EDGE | ( | e | ) | BMO_edge_flag_test(pc->bm_bmoflag, e, ELE_TOUCHED) |
Definition at line 70 of file bmo_connect_pair.c.
#define ELE_TOUCH_TEST_VERT | ( | v | ) | BMO_vert_flag_test(pc->bm_bmoflag, v, ELE_TOUCHED) |
Definition at line 67 of file bmo_connect_pair.c.
#define ELE_TOUCHED 4 |
Definition at line 48 of file bmo_connect_pair.c.
#define FACE_EXCLUDE 2 |
Definition at line 45 of file bmo_connect_pair.c.
#define FACE_WALK_TEST | ( | f | ) | (CHECK_TYPE_INLINE(f, BMFace *), BMO_face_flag_test(pc->bm_bmoflag, f, FACE_EXCLUDE) == 0) |
Definition at line 50 of file bmo_connect_pair.c.
#define MIN_DIST_DIR_INIT |
Definition at line 130 of file bmo_connect_pair.c.
#define VERT_EXCLUDE 2 |
Definition at line 42 of file bmo_connect_pair.c.
#define VERT_OUT 1 |
Definition at line 41 of file bmo_connect_pair.c.
#define VERT_WALK_TEST | ( | v | ) | (CHECK_TYPE_INLINE(v, BMVert *), BMO_vert_flag_test(pc->bm_bmoflag, v, VERT_EXCLUDE) == 0) |
Definition at line 52 of file bmo_connect_pair.c.
typedef struct MinDistDir MinDistDir |
typedef struct PathContext PathContext |
Single linked list where each item contains state and points to previous path item.
typedef struct PathLinkState PathLinkState |
Get a orientation matrix from 2 vertices.
Definition at line 481 of file bmo_connect_pair.c.
References add_v3_v3v3(), BM_ITER_ELEM, BM_LOOPS_OF_VERT, copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), eps, BMLoop::f, invert_m3(), l, negate_v3(), BMFace::no, nor, normalize_v3(), ortho_v3_v3(), project_plane_normalized_v3_v3v3(), sub_v3_v3v3(), unit_m3(), UNLIKELY, and zero_v2().
Referenced by bmo_connect_vert_pair_exec().
void bmo_connect_vert_pair_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 583 of file bmo_connect_pair.c.
References PathContext::axis_sep, BLI_assert, BLI_heapsimple_clear(), BLI_heapsimple_free(), BLI_heapsimple_insert(), BLI_heapsimple_is_empty(), BLI_heapsimple_len(), BLI_heapsimple_new(), BLI_heapsimple_pop_min(), BLI_mempool_create(), BLI_mempool_destroy(), BLI_MEMPOOL_NOP, bm, PathContext::bm_bmoflag, BM_EDGE, BM_edge_split(), BM_elem_index_get, BM_FACE, BM_VERT, bm_vert_pair_to_matrix(), BMO_op_exec(), BMO_op_finish(), BMO_op_initf(), BMO_slot_buffer_flag_enable(), BMO_slot_copy, BMO_slot_get(), BMO_vert_flag_enable, BMVert::co, BMOpSlot::data, dot_m3_v3_row_x(), e, PathLink::ele, FACE_EXCLUDE, BMElem::head, BMHeader::htype, BMOpSlot::len, PathLinkState::link_last, PathContext::link_pool, PathContext::matrix, MEM_callocN, MEM_freeN, PathLink::next, NULL, op_sub(), BMOpSlot::p, BMOperator::slots_in, state, state_calc_co_pair_fac(), state_link_add(), state_step(), PathContext::states, v, PathContext::v_a, PathContext::v_b, VERT_EXCLUDE, and VERT_OUT.
|
static |
Definition at line 137 of file bmo_connect_pair.c.
References MinDistDir::dir, MinDistDir::dist_min, and dot_v3v3().
Referenced by state_step__face_edges(), and state_step__face_verts().
|
static |
Definition at line 157 of file bmo_connect_pair.c.
References copy_v3_v3(), MinDistDir::dir, and MinDistDir::dist_min.
Referenced by state_step__face_edges(), and state_step__face_verts().
|
static |
Definition at line 198 of file bmo_connect_pair.c.
References interp_v3_v3v3(), and state_calc_co_pair_fac().
Referenced by state_link_add(), and state_step__face_edges().
|
static |
Definition at line 186 of file bmo_connect_pair.c.
References PathContext::axis_sep, dot_m3_v3_row_x(), fabsf, and PathContext::matrix.
Referenced by bmo_connect_vert_pair_exec(), and state_calc_co_pair().
|
static |
Definition at line 288 of file bmo_connect_pair.c.
References MEM_mallocN, and state.
Referenced by state_link_add_test().
|
static |
Definition at line 180 of file bmo_connect_pair.c.
References PathContext::axis_sep, CONNECT_EPS, KDL::diff(), dot_m3_v3_row_x(), fabsf, and PathContext::matrix.
Referenced by state_step(), and state_step__face_verts().
|
static |
Definition at line 166 of file bmo_connect_pair.c.
References PathContext::axis_sep, CONNECT_EPS, dot_m3_v3_row_x(), fabsf, and PathContext::matrix.
Referenced by state_step__face_edges().
|
static |
Definition at line 227 of file bmo_connect_pair.c.
References BLI_assert, BLI_mempool_alloc(), BM_EDGE, BM_elem_index_get, BM_FACE, BM_VERT, copy_v3_v3(), PathLink::ele, PathLink::ele_from, ELE_TOUCH_MARK, BMElem::head, BMHeader::htype, len_v3v3(), PathContext::link_pool, PathLink::next, NULL, state, state_calc_co_pair(), state_link_find(), and v1.
Referenced by bmo_connect_vert_pair_exec(), and state_link_add_test().
|
static |
Definition at line 295 of file bmo_connect_pair.c.
References BLI_heapsimple_insert(), PathLinkState::link_last, state, state_dupe_add(), state_link_add(), and PathContext::states.
Referenced by state_step(), state_step__face_edges(), and state_step__face_verts().
|
static |
Ideally we wouldn't need this and for most cases we don't. But when a face has vertices that are on the boundary more than once this becomes tricky.
Definition at line 212 of file bmo_connect_pair.c.
References BLI_assert, BM_EDGE, BM_FACE, BM_VERT, PathLink::ele, ELEM, BMElem::head, BMHeader::htype, PathLink::next, and state.
Referenced by state_link_add().
|
static |
Definition at line 409 of file bmo_connect_pair.c.
References BLI_assert, BM_EDGE, BM_edge_other_vert(), BM_EDGES_OF_VERT, BM_ITER_ELEM, BM_LOOPS_OF_EDGE, BM_LOOPS_OF_VERT, BM_VERT, BMVert::co, e, ELE_TOUCH_TEST_VERT, BMLoop::f, FACE_WALK_TEST, BMElem::head, BMHeader::htype, BMFace::len, PathLinkState::link_last, MIN_DIST_DIR_INIT, BMLoop::next, BMLoop::prev, state, state_isect_co_exact(), state_link_add_test(), state_step__face_edges(), state_step__face_verts(), v, and VERT_WALK_TEST.
Referenced by bmo_connect_vert_pair_exec().
|
static |
Definition at line 317 of file bmo_connect_pair.c.
References BMVert::co, PathLinkState::co_prev, MinDistDir::dist_min, BMLoop::e, ELE_TOUCH_TEST_EDGE, BMLoop::f, FACE_WALK_TEST, len_squared_v3(), min_dist_dir_test(), min_dist_dir_update(), BMLoop::next, NULL, state, state_calc_co_pair(), state_isect_co_pair(), state_link_add_test(), sub_v3_v3v3(), and BMLoop::v.
Referenced by state_step().
|
static |
Definition at line 365 of file bmo_connect_pair.c.
References BMVert::co, PathLinkState::co_prev, MinDistDir::dist_min, ELE_TOUCH_TEST_VERT, BMLoop::f, FACE_WALK_TEST, len_squared_v3(), min_dist_dir_test(), min_dist_dir_update(), BMLoop::next, NULL, state, state_isect_co_exact(), state_link_add_test(), sub_v3_v3v3(), and BMLoop::v.
Referenced by state_step().