|
Blender V5.0
|
#include <cmath>#include "MEM_guardedalloc.h"#include "BLI_math_vector.h"#include "BLI_stack.h"#include "BLI_vector.hh"#include "bmesh.hh"#include "bmesh_tools.hh"#include "intern/bmesh_operators_private.hh"Go to the source code of this file.
Macros | |
| #define | FACE_MARK 1 |
| #define | FACE_ORIG 2 |
| #define | FACE_NEW 4 |
| #define | FACE_TAG 8 |
| #define | EDGE_TAG 2 |
| #define | EDGE_ISGC 8 |
| #define | EDGE_CHAIN 16 |
| #define | VERT_MARK 1 |
| #define | VERT_MARK_PAIR 4 |
| #define | VERT_TAG 2 |
| #define | VERT_ISGC 8 |
| #define | VERT_MARK_TEAR 16 |
Functions | |
Internal Utility API | |
| static bool UNUSED_FUNCTION | check_hole_in_region (BMesh *bm, BMFace *f) |
| static float | bmo_vert_calc_edge_angle_blended (const BMVert *v) |
| static BMEdge * | bm_vert_collapse_edge_and_merge (BMesh *bm, BMVert *v, const bool do_del) |
| static void | bm_face_split (BMesh *bm, const short oflag, bool use_edge_delete) |
Public Execute Functions | |
| #define | EDGE_MARK 1 |
| #define | EDGE_MARK 1 |
| #define | EDGE_COLLAPSE 2 |
| void | bmo_dissolve_faces_exec (BMesh *bm, BMOperator *op) |
| static BMVert * | bmo_find_end_of_chain (BMesh *bm, BMEdge *e, BMVert *v, const short edge_oflag=0) |
| static bool | bmo_vert_touches_unselected_face (BMesh *bm, BMVert *v) |
| static int | bmo_vert_tagged_edges_count_at_most (BMesh *bm, BMVert *v, const short edge_oflag, const int max) |
| void | bmo_dissolve_edges_init (BMOperator *op) |
| void | bmo_dissolve_edges_exec (BMesh *bm, BMOperator *op) |
| void | bmo_dissolve_verts_exec (BMesh *bm, BMOperator *op) |
| void | bmo_dissolve_limit_exec (BMesh *bm, BMOperator *op) |
| static void | bm_mesh_edge_collapse_flagged (BMesh *bm, const int flag, const short oflag) |
| void | bmo_dissolve_degenerate_exec (BMesh *bm, BMOperator *op) |
Removes isolated geometry regions without creating holes in the mesh.
Definition in file bmo_dissolve.cc.
| #define EDGE_CHAIN 16 |
Set when the edge is part of a chain, where at least of it's vertices has exactly one other connected edge.
Definition at line 40 of file bmo_dissolve.cc.
Referenced by bmo_dissolve_edges_exec().
| #define EDGE_COLLAPSE 2 |
Definition at line 822 of file bmo_dissolve.cc.
Referenced by bmo_dissolve_degenerate_exec().
| #define EDGE_ISGC 8 |
Definition at line 35 of file bmo_dissolve.cc.
Referenced by bmo_dissolve_edges_exec(), and bmo_dissolve_verts_exec().
| #define EDGE_MARK 1 |
Definition at line 33 of file bmo_dissolve.cc.
| #define EDGE_MARK 1 |
Definition at line 33 of file bmo_dissolve.cc.
| #define EDGE_TAG 2 |
Definition at line 34 of file bmo_dissolve.cc.
Referenced by bmo_dissolve_edges_exec(), and bmo_vert_touches_unselected_face().
| #define FACE_MARK 1 |
Definition at line 28 of file bmo_dissolve.cc.
| #define FACE_NEW 4 |
Definition at line 30 of file bmo_dissolve.cc.
Referenced by bmo_create_circle_exec(), bmo_create_cone_exec(), bmo_dissolve_faces_exec(), and bmo_dissolve_limit_exec().
| #define FACE_ORIG 2 |
Definition at line 29 of file bmo_dissolve.cc.
Referenced by bmo_dissolve_faces_exec().
| #define FACE_TAG 8 |
Definition at line 31 of file bmo_dissolve.cc.
| #define VERT_ISGC 8 |
Definition at line 45 of file bmo_dissolve.cc.
Referenced by bmo_dissolve_edges_exec(), and bmo_dissolve_verts_exec().
| #define VERT_MARK 1 |
Definition at line 42 of file bmo_dissolve.cc.
Referenced by bmo_create_circle_exec(), bmo_create_cone_exec(), bmo_create_cube_exec(), bmo_create_grid_exec(), bmo_create_icosphere_exec(), bmo_create_monkey_exec(), bmo_create_uvsphere_exec(), bmo_dissolve_edges_exec(), bmo_dissolve_faces_exec(), bmo_dissolve_verts_exec(), bmo_vert_touches_unselected_face(), and calc_solidify_normals().
| #define VERT_MARK_PAIR 4 |
Definition at line 43 of file bmo_dissolve.cc.
Referenced by bmo_dissolve_verts_exec().
| #define VERT_MARK_TEAR 16 |
Definition at line 46 of file bmo_dissolve.cc.
Referenced by bmo_dissolve_verts_exec().
| #define VERT_TAG 2 |
Definition at line 44 of file bmo_dissolve.cc.
Referenced by bmo_dissolve_edges_exec().
|
static |
Definition at line 174 of file bmo_dissolve.cc.
References BLI_stack_free(), BLI_stack_is_empty(), BLI_stack_new, BLI_stack_pop(), BLI_stack_push(), bm, BM_edge_kill(), BM_face_split(), BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_VERT, BM_vert_is_edge_pair(), BM_VERTS_OF_MESH, BMO_vert_flag_test, l, oflag, and v.
Referenced by bmo_dissolve_edges_exec(), and bmo_dissolve_verts_exec().
|
static |
Definition at line 824 of file bmo_dissolve.cc.
References bm, BMO_op_callf(), flag, and oflag.
Referenced by bmo_dissolve_degenerate_exec().
A wrapper for BM_vert_collapse_edge which ensures correct hidden state & merges edge flags.
Definition at line 142 of file bmo_dissolve.cc.
References BLI_assert, bm, BM_edge_select_set_noflush(), BM_elem_flag_enable, BM_elem_flag_merge_ex, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT, BM_vert_collapse_edge(), BM_vert_edge_pair(), UNUSED_VARS_NDEBUG, v, BMEdge::v1, and BMEdge::v2.
Referenced by bmo_dissolve_edges_exec(), bmo_dissolve_faces_exec(), and bmo_dissolve_verts_exec().
| void bmo_dissolve_degenerate_exec | ( | BMesh * | bm, |
| BMOperator * | op ) |
Definition at line 829 of file bmo_dissolve.cc.
References BLI_assert, bm, BM_EDGE, BM_edge_calc_length_squared(), BM_edge_split(), BM_EDGES_OF_MESH, BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_TAG, BM_face_split(), BM_ITER_MESH, bm_mesh_edge_collapse_flagged(), BMO_edge_flag_enable, BMO_edge_flag_test, BMO_slot_buffer_flag_enable(), BMO_slot_float_get(), BMVert::co, BMLoop::e, e, EDGE_COLLAPSE, EDGE_MARK, BMLoop::f, fabsf, BMOperator::flag, BMFace::len, len_v3v3(), min_ff(), BMLoop::next, normalize_v3(), BMLoop::prev, BMLoop::radial_next, reset(), BMOperator::slots_in, sub_v3_v3v3(), and BMLoop::v.
| void bmo_dissolve_edges_exec | ( | BMesh * | bm, |
| BMOperator * | op ) |
Definition at line 453 of file bmo_dissolve.cc.
References bm, BM_EDGE, BM_edge_face_pair(), BM_edge_kill(), BM_edge_loop_pair(), BM_EDGES_OF_MESH, BM_EDGES_OF_VERT, BM_FACE_FIRST_LOOP, bm_face_split(), BM_faces_join_pair(), BM_ITER_ELEM, BM_ITER_MESH, BM_ITER_MESH_MUTABLE, bm_vert_collapse_edge_and_merge(), BM_vert_edge_pair(), BM_vert_is_edge_pair(), BM_vert_kill(), BM_VERTS_OF_MESH, BMO_edge_flag_enable, BMO_edge_flag_test, bmo_find_end_of_chain(), BMO_ITER, BMO_slot_bool_get(), BMO_slot_buffer_flag_enable(), BMO_slot_float_get(), bmo_vert_calc_edge_angle_blended(), BMO_vert_flag_disable, BMO_vert_flag_enable, BMO_vert_flag_test, bmo_vert_tagged_edges_count_at_most(), bmo_vert_touches_unselected_face(), BMLoop::e, e, EDGE_CHAIN, EDGE_ISGC, EDGE_TAG, i, l_b, len, M_PI, BMLoop::next, RAD2DEGF, BMOperator::slots_in, BMLoop::v, v, VERT_ISGC, VERT_MARK, and VERT_TAG.
| void bmo_dissolve_edges_init | ( | BMOperator * | op | ) |
Definition at line 447 of file bmo_dissolve.cc.
References BMO_slot_float_set(), M_PI, and BMOperator::slots_in.
| void bmo_dissolve_faces_exec | ( | BMesh * | bm, |
| BMOperator * | op ) |
Definition at line 224 of file bmo_dissolve.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append_as(), BLI_assert, bm, BM_FACE, BM_face_kill(), BM_faces_join(), BM_ITER_MESH, BM_ITER_MESH_MUTABLE, bm_vert_collapse_edge_and_merge(), BM_vert_is_edge_pair(), BM_VERTS_OF_MESH, BMO_ERROR_FATAL, BMO_error_occurred_at_level(), BMO_face_flag_disable, BMO_face_flag_enable, BMO_face_flag_test, BMO_ITER, BMO_op_callf(), BMO_slot_bool_get(), BMO_slot_buffer_flag_enable(), BMO_slot_buffer_from_enabled_flag(), BMO_vert_flag_set, BMO_vert_flag_test, BMW_begin(), BMW_end(), BMW_FLAG_NOP, BMW_init(), BMW_ISLAND_MANIFOLD, BMW_MASK_NOP, BMW_NIL_LAY, BMW_step(), DEL_FACES, FACE_MARK, FACE_NEW, FACE_ORIG, FACE_TAG, faces, BMOperator::flag, LIKELY, BMOperator::slots_in, BMOperator::slots_out, UNLIKELY, v, and VERT_MARK.
| void bmo_dissolve_limit_exec | ( | BMesh * | bm, |
| BMOperator * | op ) |
Definition at line 799 of file bmo_dissolve.cc.
References bm, BM_FACE, BM_mesh_decimate_dissolve_ex(), BMO_SLOT_AS_BUFFER, BMO_slot_bool_get(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_float_get(), BMO_slot_get(), BMO_slot_int_get(), FACE_NEW, BMOpSlot::len, M_PI_2, min_ff(), BMOperator::slots_in, and BMOperator::slots_out.
| void bmo_dissolve_verts_exec | ( | BMesh * | bm, |
| BMOperator * | op ) |
Definition at line 691 of file bmo_dissolve.cc.
References bm, BM_DISK_EDGE_NEXT, BM_edge_is_boundary(), BM_edge_is_wire(), BM_edge_kill(), BM_edge_loop_pair(), BM_EDGES_OF_MESH, BM_EDGES_OF_VERT, bm_face_split(), BM_faces_join_pair(), BM_ITER_ELEM, BM_ITER_MESH_MUTABLE, BM_LOOPS_OF_VERT, BM_VERT, bm_vert_collapse_edge_and_merge(), BM_vert_is_edge_pair(), BM_vert_kill(), BM_VERTS_OF_MESH, BMO_edge_flag_enable, BMO_edge_flag_test, BMO_ITER, BMO_slot_bool_get(), BMO_vert_flag_enable, BMO_vert_flag_test, BMLoop::e, e, EDGE_ISGC, l_b, BMLoop::next, BMOperator::slots_in, BMLoop::v, v, VERT_ISGC, VERT_MARK, VERT_MARK_PAIR, and VERT_MARK_TEAR.
|
static |
Given an edge, and vert that are part of a chain, finds the vert at the far end of the chain.
If edge_oflag is provided, each edge along the chain is tagged, and walking stops when an edge that is already tagged is found. This avoids repeatedly re-walking the chain.
Returns nullptr if already tagged edges are found, or if the chain loops.
Definition at line 367 of file bmo_dissolve.cc.
References BLI_assert, bm, BM_DISK_EDGE_NEXT, BM_edge_other_vert(), BM_vert_is_edge_pair(), BMO_edge_flag_enable, BMO_edge_flag_test, e, UNLIKELY, and v.
Referenced by bmo_dissolve_edges_exec().
Calculates the angle of an edge pair, from a combination of raw angle and normal angle.
Definition at line 90 of file bmo_dissolve.cc.
References angle(), angle_on_axis_v3v3v3_v3(), angle_v3v3v3(), BLI_assert, BM_edge_face_pair(), BM_edge_other_vert(), BM_face_calc_normal(), BM_vert_edge_pair(), BMVert::co, dot_v3v3(), interpf(), M_PI, UNUSED_VARS_NDEBUG, and v.
Referenced by bmo_dissolve_edges_exec().
|
static |
Counts how many edges touching a vert are tagged with the specified edge_oflag.
Definition at line 428 of file bmo_dissolve.cc.
References bm, BM_EDGES_OF_VERT, BM_ITER_ELEM, BMO_edge_flag_test, e, max, and v.
Referenced by bmo_dissolve_edges_exec().
Determines if a vert touches an unselected face that would be altered if the vert was dissolved. This is sometimes desirable (T-junction) and sometimes not (other cases).
Definition at line 402 of file bmo_dissolve.cc.
References bm, BM_ITER_ELEM, BM_loop_other_edge_loop(), BM_LOOPS_OF_VERT, BMO_edge_flag_test, BMO_vert_flag_test, BMLoop::e, EDGE_TAG, l_b, v, and VERT_MARK.
Referenced by bmo_dissolve_edges_exec().
|
static |
Definition at line 52 of file bmo_dissolve.cc.
References bm, BM_ITER_ELEM, BM_LOOPS_OF_FACE, BMO_edge_flag_test, BMO_face_flag_test, BMW_begin(), BMW_end(), BMW_FLAG_NOP, BMW_init(), BMW_ISLAND, BMW_MASK_NOP, BMW_NIL_LAY, BMW_step(), check_hole_in_region(), BMLoop::e, EDGE_MARK, BMLoop::f, FACE_MARK, and BMLoop::radial_next.
Referenced by check_hole_in_region().