Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_mempool.h"
#include "BLI_stack.h"
#include "BLI_utildefines_iter.h"
#include "bmesh.h"
#include "bmesh_edgeloop.h"
Go to the source code of this file.
Classes | |
struct | BMEdgeLoopStore |
struct | VertStep |
Macros | |
#define | BM_EDGELOOP_IS_CLOSED (1 << 0) |
#define | EDGELOOP_EPS 1e-10f |
#define | NODE_AS_V(n) ((BMVert *)((LinkData *)n)->data) |
#define | NODE_AS_CO(n) ((BMVert *)((LinkData *)n)->data)->co |
#define | EDGE_SPLIT(node_copy, node_other) |
Typedefs | |
typedef struct BMEdgeLoopStore | BMEdgeLoopStore |
Generic utility functions for getting edge loops from a mesh.
Definition in file bmesh_edgeloop.c.
#define BM_EDGELOOP_IS_CLOSED (1 << 0) |
Definition at line 31 of file bmesh_edgeloop.c.
#define EDGE_SPLIT | ( | node_copy, | |
node_other | |||
) |
Definition at line 34 of file bmesh_edgeloop.c.
Definition at line 546 of file bmesh_edgeloop.c.
Definition at line 545 of file bmesh_edgeloop.c.
typedef struct BMEdgeLoopStore BMEdgeLoopStore |
void BM_edgeloop_calc_center | ( | BMesh * | UNUSEDbm, |
BMEdgeLoopStore * | el_store | ||
) |
Definition at line 564 of file bmesh_edgeloop.c.
References BMEdgeLoopStore::co, ListBase::first, ListBase::last, len_v3v3(), madd_v3_v3fl(), mul_v3_fl(), LinkData::next, NODE_AS_CO, NULL, LinkData::prev, BMEdgeLoopStore::verts, w(), and zero_v3().
Referenced by bm_edgering_pair_interpolate(), and BM_mesh_edgeloops_calc_center().
bool BM_edgeloop_calc_normal | ( | BMesh * | UNUSEDbm, |
BMEdgeLoopStore * | el_store | ||
) |
Definition at line 605 of file bmesh_edgeloop.c.
References add_newell_cross_v3_v3v3(), EDGELOOP_EPS, ListBase::first, ListBase::last, LinkData::next, BMEdgeLoopStore::no, NODE_AS_CO, normalize_v3(), UNLIKELY, BMEdgeLoopStore::verts, and zero_v3().
Referenced by bm_edgering_pair_interpolate(), BM_mesh_edgeloops_calc_normal(), and bridge_loop_pair().
bool BM_edgeloop_calc_normal_aligned | ( | BMesh * | UNUSEDbm, |
BMEdgeLoopStore * | el_store, | ||
const float | no_align[3] | ||
) |
Definition at line 633 of file bmesh_edgeloop.c.
References add_v3_v3(), blender::math::cross(), cross_v3_v3v3(), EDGELOOP_EPS, ListBase::first, ListBase::last, LinkData::next, BMEdgeLoopStore::no, NODE_AS_CO, normalize_v3(), sub_v3_v3v3(), UNLIKELY, BMEdgeLoopStore::verts, and zero_v3().
Referenced by bm_edgering_pair_interpolate(), BM_mesh_edgeloops_calc_normal_aligned(), and bridge_loop_pair().
const float* BM_edgeloop_center_get | ( | struct BMEdgeLoopStore * | el_store | ) |
Definition at line 540 of file bmesh_edgeloop.c.
References BMEdgeLoopStore::co.
Referenced by bm_edgering_pair_interpolate(), and bridge_loop_pair().
BMEdgeLoopStore* BM_edgeloop_copy | ( | struct BMEdgeLoopStore * | el_store | ) |
Copy a single edge-loop.
Definition at line 490 of file bmesh_edgeloop.c.
References BLI_duplicatelist(), MEM_mallocN, and BMEdgeLoopStore::verts.
Referenced by bridge_loop_pair().
void BM_edgeloop_edges_get | ( | struct BMEdgeLoopStore * | el_store, |
BMEdge ** | e_arr | ||
) |
Edges are assigned to one vert -> the next.
Definition at line 548 of file bmesh_edgeloop.c.
References BLI_assert, BM_edge_exists(), BM_EDGELOOP_IS_CLOSED, ListBase::first, BMEdgeLoopStore::flag, ListBase::last, BMEdgeLoopStore::len, node, NODE_AS_V, NULL, and BMEdgeLoopStore::verts.
Referenced by bm_edgering_pair_store_create(), and edbm_fill_grid_prepare().
void BM_edgeloop_expand | ( | BMesh * | bm, |
BMEdgeLoopStore * | el_store, | ||
int | el_store_len, | ||
bool | split, | ||
GSet * | split_edges | ||
) |
Definition at line 673 of file bmesh_edgeloop.c.
References BLI_assert, BLI_FOREACH_SPARSE_RANGE, BLI_insertlinkafter(), BLI_insertlinkbefore(), BM_EDGELOOP_IS_CLOSED, EDGE_SPLIT, ListBase::first, BMEdgeLoopStore::flag, BMEdgeLoopStore::len, MEM_dupallocN, LinkData::next, LinkData::prev, blender::io::alembic::split(), and BMEdgeLoopStore::verts.
Referenced by bmo_grid_fill_exec(), and bridge_loop_pair().
void BM_edgeloop_flip | ( | BMesh * | UNUSEDbm, |
BMEdgeLoopStore * | el_store | ||
) |
Definition at line 667 of file bmesh_edgeloop.c.
References BLI_listbase_reverse(), negate_v3(), BMEdgeLoopStore::no, and BMEdgeLoopStore::verts.
Referenced by bm_edge_subdiv_as_loop(), bm_edgering_pair_order(), bmo_grid_fill_exec(), and bridge_loop_pair().
void BM_edgeloop_free | ( | BMEdgeLoopStore * | el_store | ) |
Definition at line 514 of file bmesh_edgeloop.c.
References BLI_freelistN(), MEM_freeN, and BMEdgeLoopStore::verts.
Referenced by BM_mesh_edgeloops_find(), BM_mesh_edgeloops_free(), and bridge_loop_pair().
BMEdgeLoopStore* BM_edgeloop_from_verts | ( | BMVert ** | v_arr, |
const int | v_arr_tot, | ||
bool | is_closed | ||
) |
Definition at line 498 of file bmesh_edgeloop.c.
References BLI_addtail(), BM_EDGELOOP_IS_CLOSED, BMEdgeLoopStore::flag, BMEdgeLoopStore::len, MEM_callocN, node, and BMEdgeLoopStore::verts.
Referenced by bm_edge_subdiv_as_loop().
bool BM_edgeloop_is_closed | ( | BMEdgeLoopStore * | el_store | ) |
Definition at line 520 of file bmesh_edgeloop.c.
References BM_EDGELOOP_IS_CLOSED, and BMEdgeLoopStore::flag.
Referenced by bm_edgering_pair_order(), bm_edgering_pair_store_create(), bmo_grid_fill_exec(), bridge_loop_pair(), and edbm_fill_grid_prepare().
int BM_edgeloop_length_get | ( | BMEdgeLoopStore * | el_store | ) |
Definition at line 530 of file bmesh_edgeloop.c.
References BMEdgeLoopStore::len.
Referenced by bm_edgering_pair_store_create(), bm_edgering_pair_subdiv(), bm_grid_fill(), bmo_bridge_loops_exec(), bmo_grid_fill_exec(), bridge_loop_pair(), and edbm_fill_grid_prepare().
const float* BM_edgeloop_normal_get | ( | struct BMEdgeLoopStore * | el_store | ) |
Definition at line 535 of file bmesh_edgeloop.c.
References BMEdgeLoopStore::no.
Referenced by bm_edgering_pair_interpolate(), and bridge_loop_pair().
bool BM_edgeloop_overlap_check | ( | struct BMEdgeLoopStore * | el_store_a, |
struct BMEdgeLoopStore * | el_store_b | ||
) |
Definition at line 760 of file bmesh_edgeloop.c.
References BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_INTERNAL_TAG, ListBase::first, BMEdgeLoopStore::len, node, SWAP, and BMEdgeLoopStore::verts.
Referenced by bmo_grid_fill_exec().
ListBase* BM_edgeloop_verts_get | ( | BMEdgeLoopStore * | el_store | ) |
Definition at line 525 of file bmesh_edgeloop.c.
References BMEdgeLoopStore::verts.
Referenced by bm_bridge_best_rotation(), bm_edgeloop_check_overlap_all(), bm_edgeloop_flag_set(), bm_edgeloop_vert_tag(), bm_edgering_pair_calc(), bm_edgering_pair_interpolate(), bm_edgering_pair_order(), bm_edgering_pair_order_is_flipped(), bm_edgering_pair_store_create(), bm_edgering_pair_subdiv(), bm_grid_fill(), bmo_edgeloop_vert_tag(), bmo_grid_fill_exec(), bridge_loop_pair(), and edbm_fill_grid_prepare().
|
static |
Definition at line 62 of file bmesh_edgeloop.c.
References blender::math::abs(), BLI_addhead(), BLI_addtail(), BLI_assert, BM_edge_other_vert(), BM_EDGELOOP_IS_CLOSED, BM_elem_flag_disable, BM_elem_flag_test, BM_ELEM_INTERNAL_TAG, bm_vert_other_tag(), count, BMEdgeLoopStore::flag, BMEdgeLoopStore::len, MEM_callocN, node, NULL, UNLIKELY, v, BMEdgeLoopStore::verts, and void.
Referenced by BM_mesh_edgeloops_find().
|
static |
Definition at line 200 of file bmesh_edgeloop.c.
References blender::math::abs(), BLI_assert, BLI_listbase_is_empty(), BLI_mempool_free(), BM_edge_other_vert(), BM_EDGES_OF_VERT, BM_elem_flag_disable, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_INTERNAL_TAG, BM_ITER_ELEM, e, ListBase::first, VertStep::next, NULL, VertStep::v, and vs_add().
Referenced by BM_mesh_edgeloops_find_path().
Definition at line 396 of file bmesh_edgeloop.c.
References bm, BM_edgeloop_calc_center(), ListBase::first, and BMEdgeLoopStore::next.
Referenced by bmo_bridge_loops_exec().
Definition at line 404 of file bmesh_edgeloop.c.
References bm, BM_edgeloop_calc_normal(), ListBase::first, and BMEdgeLoopStore::next.
Referenced by bmo_bridge_loops_exec().
void BM_mesh_edgeloops_calc_normal_aligned | ( | BMesh * | bm, |
ListBase * | eloops, | ||
const float | no_align[3] | ||
) |
Definition at line 412 of file bmesh_edgeloop.c.
References bm, BM_edgeloop_calc_normal_aligned(), ListBase::first, and BMEdgeLoopStore::next.
Definition at line 420 of file bmesh_edgeloop.c.
References add_v3_v3(), BLI_addtail(), BLI_ASSERT_UNIT_V3, BLI_remlink(), BMEdgeLoopStore::co, dot_v3v3(), fabsf, ListBase::first, ListBase::last, len_squared_v3v3(), mul_v3_fl(), BMEdgeLoopStore::next, BMEdgeLoopStore::no, normalize_v3(), NULL, sub_v3_v3v3(), and zero_v3().
Referenced by bmo_bridge_loops_exec().
int BM_mesh_edgeloops_find | ( | BMesh * | bm, |
struct ListBase * | r_eloops, | ||
bool(*)(BMEdge *, void *user_data) | test_fn, | ||
void * | user_data | ||
) |
Definition at line 108 of file bmesh_edgeloop.c.
References BLI_addtail(), BLI_assert, BLI_stack_count(), BLI_stack_free(), BLI_stack_new, BLI_stack_pop_n_reverse(), BLI_stack_push(), bm, BM_edgeloop_free(), BM_EDGES_OF_MESH, BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_INTERNAL_TAG, BM_ITER_MESH, bm_loop_build(), BM_VERTS_OF_MESH, count, e, BMEdgeLoopStore::len, MEM_callocN, MEM_freeN, MEM_mallocN, user_data, and v.
Referenced by bmo_bridge_loops_exec(), bmo_grid_fill_exec(), bmo_subdivide_edgering_exec(), and edbm_fill_grid_prepare().
bool BM_mesh_edgeloops_find_path | ( | BMesh * | bm, |
ListBase * | r_eloops, | ||
bool(*)(BMEdge *, void *user_data) | test_fn, | ||
void * | user_data, | ||
BMVert * | v_src, | ||
BMVert * | v_dst | ||
) |
Definition at line 259 of file bmesh_edgeloop.c.
References BLI_addhead(), BLI_addtail(), BLI_assert, BLI_mempool_create(), BLI_mempool_destroy(), BLI_MEMPOOL_NOP, BLI_stack_count(), BLI_stack_free(), BLI_stack_new, BLI_stack_pop_n_reverse(), BLI_stack_push(), bm, BM_edge_other_vert(), BM_EDGES_OF_MESH, BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_index_set, BM_ELEM_INTERNAL_TAG, BM_ITER_MESH, BM_ITER_MESH_INDEX, bm_loop_path_build_step(), BM_VERT, BM_VERTS_OF_MESH, BMVert::e, e, BMesh::elem_index_dirty, BMEdgeLoopStore::len, MEM_callocN, MEM_freeN, MEM_mallocN, node, NULL, BMesh::totedge, user_data, v, BMEdgeLoopStore::verts, and vs_add().
Referenced by bmo_grid_fill_exec().
Definition at line 388 of file bmesh_edgeloop.c.
References BLI_pophead(), and BM_edgeloop_free().
Referenced by bm_edgering_pair_ringsubd(), bmo_bridge_loops_exec(), bmo_grid_fill_exec(), bmo_subdivide_edgering_exec(), and edbm_fill_grid_prepare().
Definition at line 39 of file bmesh_edgeloop.c.
References BM_edge_other_vert(), BM_EDGES_OF_VERT, BM_elem_flag_test, BM_ELEM_INTERNAL_TAG, BM_ITER_ELEM, count, e, NULL, and v.
Referenced by bm_loop_build().
|
static |
Definition at line 182 of file bmesh_edgeloop.c.
References BLI_addtail(), BLI_assert, BLI_mempool_alloc(), BM_elem_index_set, BM_vert_in_edge(), BMVert::e, VertStep::v, and v.
Referenced by bm_loop_path_build_step(), and BM_mesh_edgeloops_find_path().