Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_heap.h"
#include "BLI_math.h"
#include "BKE_customdata.h"
#include "bmesh.h"
#include "bmesh_decimate.h"
Go to the source code of this file.
Classes | |
struct | DelimitData |
Macros | |
#define | USE_DEGENERATE_CHECK |
#define | COST_INVALID FLT_MAX |
#define | UNIT_TO_ANGLE DEG2RADF(90.0f) |
#define | ANGLE_TO_UNIT (1.0f / UNIT_TO_ANGLE) |
Functions | |
static bool | bm_edge_is_delimiter (const BMEdge *e, const BMO_Delimit delimit, const struct DelimitData *delimit_data) |
static bool | bm_vert_is_delimiter (const BMVert *v, const BMO_Delimit delimit, const struct DelimitData *delimit_data) |
static float | bm_vert_edge_face_angle (BMVert *v, const BMO_Delimit delimit, const struct DelimitData *delimit_data) |
static bool | bm_edge_is_contiguous_loop_cd_all (const BMEdge *e, const struct DelimitData *delimit_data) |
static float | bm_edge_calc_dissolve_error (const BMEdge *e, const BMO_Delimit delimit, const struct DelimitData *delimit_data) |
static void | mul_v2_m3v3_center (float r[2], const float m[3][3], const float a[3], const float center[3]) |
static bool | bm_loop_collapse_is_degenerate (BMLoop *l_ear) |
static bool | bm_vert_collapse_is_degenerate (BMVert *v) |
void | BM_mesh_decimate_dissolve_ex (BMesh *bm, const float angle_limit, const bool do_dissolve_boundaries, BMO_Delimit delimit, BMVert **vinput_arr, const int vinput_len, BMEdge **einput_arr, const int einput_len, const short oflag_out) |
void | BM_mesh_decimate_dissolve (BMesh *bm, const float angle_limit, const bool do_dissolve_boundaries, const BMO_Delimit delimit) |
BMesh decimator that dissolves flat areas into polygons (ngons).
Definition in file bmesh_decimate_dissolve.c.
#define ANGLE_TO_UNIT (1.0f / UNIT_TO_ANGLE) |
#define COST_INVALID FLT_MAX |
Definition at line 22 of file bmesh_decimate_dissolve.c.
#define USE_DEGENERATE_CHECK |
Definition at line 20 of file bmesh_decimate_dissolve.c.
|
static |
Definition at line 143 of file bmesh_decimate_dissolve.c.
References BM_edge_is_contiguous(), bm_edge_is_delimiter(), BM_edge_is_manifold(), COST_INVALID, dot_v3v3(), e, and BMVert::no.
Referenced by BM_mesh_decimate_dissolve_ex().
|
static |
Definition at line 70 of file bmesh_decimate_dissolve.c.
References BM_edge_is_contiguous_loop_cd(), DelimitData::cd_loop_offset, DelimitData::cd_loop_size, DelimitData::cd_loop_type, and e.
Referenced by bm_edge_is_delimiter().
|
static |
Definition at line 85 of file bmesh_decimate_dissolve.c.
References BLI_assert, BM_edge_is_contiguous(), bm_edge_is_contiguous_loop_cd_all(), BM_edge_is_manifold(), BM_elem_flag_test, BM_ELEM_SEAM, BM_ELEM_SMOOTH, BMO_DELIM_MATERIAL, BMO_DELIM_NORMAL, BMO_DELIM_SEAM, BMO_DELIM_SHARP, BMO_DELIM_UV, and e.
Referenced by bm_edge_calc_dissolve_error(), and bm_vert_is_delimiter().
Definition at line 175 of file bmesh_decimate_dissolve.c.
References axis_dominant_v3_to_m3(), BM_vert_is_edge_pair(), center, BMVert::co, cross_tri_v2(), BMLoop::f, isect_point_tri_v2_cw(), mul_v2_m3v3_center(), BMLoop::next, BMFace::no, BMLoop::prev, signum_i(), swap_v2_v2(), UNPACK3, BMLoop::v, and zero_v2().
Referenced by bm_vert_collapse_is_degenerate().
void BM_mesh_decimate_dissolve | ( | BMesh * | bm, |
const float | angle_limit, | ||
const bool | do_dissolve_boundaries, | ||
const BMO_Delimit | delimit | ||
) |
Definition at line 531 of file bmesh_decimate_dissolve.c.
References bm, BM_EDGES_OF_MESH, BM_iter_as_arrayN(), BM_mesh_decimate_dissolve_ex(), BM_VERTS_OF_MESH, MEM_freeN, and NULL.
Referenced by modifyMesh().
void BM_mesh_decimate_dissolve_ex | ( | BMesh * | bm, |
const float | angle_limit, | ||
const bool | do_dissolve_boundaries, | ||
BMO_Delimit | delimit, | ||
BMVert ** | vinput_arr, | ||
const int | vinput_len, | ||
BMEdge ** | einput_arr, | ||
const int | einput_len, | ||
const short | oflag_out | ||
) |
Definition at line 274 of file bmesh_decimate_dissolve.c.
References BLI_heap_free(), BLI_heap_insert(), BLI_heap_is_empty(), BLI_heap_new_ex(), BLI_heap_node_ptr(), BLI_heap_node_value(), BLI_heap_node_value_update(), BLI_heap_remove(), BLI_heap_top(), bm, BM_EDGE, bm_edge_calc_dissolve_error(), BM_edge_is_manifold(), BM_edge_is_wire(), BM_edge_kill(), BM_EDGES_OF_MESH, BM_elem_flag_set, BM_elem_flag_test, BM_elem_index_get, BM_elem_index_set, BM_ELEM_TAG, BM_FACE_FIRST_LOOP, BM_face_normal_update(), BM_faces_join_pair(), BM_ITER_ELEM, BM_ITER_MESH, BM_ITER_MESH_INDEX, BM_mesh_elem_index_ensure(), BM_VERT, BM_vert_collapse_edge(), bm_vert_collapse_is_degenerate(), bm_vert_edge_face_angle(), BM_vert_is_edge_pair(), BM_vert_kill(), BM_VERTS_OF_EDGE, BM_VERTS_OF_MESH, BMO_DELIM_UV, BMO_face_flag_enable, DelimitData::cd_loop_offset, DelimitData::cd_loop_offset_end, DelimitData::cd_loop_size, DelimitData::cd_loop_type, CD_MLOOPUV, copy_vn_i(), cosf, COST_INVALID, CustomData_get_n_offset(), CustomData_number_of_layers(), CustomData_sizeof(), BMVert::e, BMLoop::e, e, BMesh::elem_index_dirty, BMLoop::f, BMEdge::l, BMesh::ldata, LIKELY, max_ii(), MEM_freeN, MEM_mallocN, BMLoop::next, NULL, BMLoop::prev, BMLoop::radial_next, BMesh::totedge, BMesh::totvert, UNLIKELY, USE_DEGENERATE_CHECK, BMLoop::v, v, BMEdge::v1, v1, BMEdge::v2, and v2.
Referenced by BM_mesh_decimate_dissolve(), and bmo_dissolve_limit_exec().
Definition at line 240 of file bmesh_decimate_dissolve.c.
References BLI_assert, BM_edge_is_wire(), BM_edge_other_vert(), bm_loop_collapse_is_degenerate(), BM_vert_edge_pair(), BMVert::co, cos_v3v3v3(), BMLoop::f, fabsf, BMEdge::l, BMFace::len, BMLoop::next, BMLoop::radial_next, BMLoop::v, and v.
Referenced by BM_mesh_decimate_dissolve_ex().
|
static |
Definition at line 36 of file bmesh_decimate_dissolve.c.
References angle(), ANGLE_TO_UNIT, BM_edge_calc_face_angle(), BM_edge_is_manifold(), BM_vert_calc_edge_angle(), bm_vert_is_delimiter(), BMVert::e, UNIT_TO_ANGLE, and v.
Referenced by BM_mesh_decimate_dissolve_ex().
|
static |
Definition at line 123 of file bmesh_decimate_dissolve.c.
References BLI_assert, BM_DISK_EDGE_NEXT, bm_edge_is_delimiter(), BM_edge_is_manifold(), BMVert::e, e, NULL, and v.
Referenced by bm_vert_edge_face_angle().
|
static |
Definition at line 160 of file bmesh_decimate_dissolve.c.
References Freestyle::a, BLI_assert, center, r, and sub_v3_v3v3().
Referenced by bm_loop_collapse_is_degenerate().