32 #define VERT_MARK_PAIR 4
35 #define VERT_MARK_TEAR 16
76 if (use_edge_delete) {
94 if (use_edge_delete) {
101 if (use_edge_delete) {
121 } *regions =
NULL, *region;
163 if ((faces_init[0] =
BMW_begin(®walker, f)) && (faces_init[1] =
BMW_step(®walker))) {
170 while ((f_iter =
BMW_step(®walker))) {
181 region->faces =
faces;
196 region = ®ions[i];
198 const int faces_len = region->faces_len;
199 faces = region->faces;
207 totface_target -= faces_len - 1;
222 for (
int j = 0; j < faces_len; j++) {
270 if (use_face_split) {
283 if (untag_count <= 2) {
302 for (j = 0; j < 2; j++) {
308 }
while ((l_iter = l_iter->
next) != l_first);
374 if (use_face_split) {
378 if (use_boundary_tear) {
403 }
while ((l_iter = l_iter->
next) != l_first);
405 e_first = l_first->
e;
416 }
while ((
e = e_next) != e_first);
481 const float angle_max =
M_PI_2;
488 do_dissolve_boundaries,
500 #define EDGE_COLLAPSE 2
510 const float dist_sq = dist * dist;
531 l_iter = l_first =
e->l;
534 }
while ((l_iter = l_iter->
radial_next) != l_first);
547 l_iter = l_first =
e->l;
561 float dir_prev[3], len_prev;
562 float dir_next[3], len_next;
570 if ((
len_v3v3(dir_prev, dir_next) *
min_ff(len_prev, len_next)) <= dist) {
573 if (
fabsf(len_prev - len_next) <= dist) {
575 if (l_iter->
f->
len == 3) {
591 else if (len_prev < len_next) {
605 else if (len_next < len_prev) {
626 }
while ((l_iter = l_iter->
radial_next) != l_first);
A (mainly) macro array library.
#define BLI_array_append(arr, item)
#define BLI_array_append_ret(arr)
#define BLI_array_declare(arr)
#define BLI_array_len(arr)
#define BLI_array_clear(arr)
#define BLI_array_free(arr)
MINLINE float min_ff(float a, float b)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void BLI_stack_pop(BLI_Stack *stack, void *dst) ATTR_NONNULL()
void BLI_stack_push(BLI_Stack *stack, const void *src) ATTR_NONNULL()
bool BLI_stack_is_empty(const BLI_Stack *stack) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_stack_free(BLI_Stack *stack) ATTR_NONNULL()
#define BLI_stack_new(esize, descr)
#define UNUSED_FUNCTION(x)
Read Guarded memory(de)allocation.
#define BM_DISK_EDGE_NEXT(e, v)
#define BM_FACE_FIRST_LOOP(p)
BMFace * BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del)
Join Connected Faces.
void BM_vert_kill(BMesh *bm, BMVert *v)
void BM_face_kill(BMesh *bm, BMFace *f)
void BM_edge_kill(BMesh *bm, BMEdge *e)
void BM_mesh_decimate_dissolve_ex(BMesh *bm, float angle_limit, bool do_dissolve_boundaries, BMO_Delimit delimit, BMVert **vinput_arr, int vinput_len, BMEdge **einput_arr, int einput_len, short oflag_out)
bool BMO_error_occurred_at_level(BMesh *bm, eBMOpErrorLevel level)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_MESH_MUTABLE(ele, ele_next, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
BMFace * BM_faces_join_pair(BMesh *bm, BMLoop *l_a, BMLoop *l_b, const bool do_del)
Faces Join Pair.
BMVert * BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float fac)
Edge Split.
BMEdge * BM_vert_collapse_edge(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool kill_degenerate_faces, const bool kill_duplicate_faces)
Vert Collapse Faces.
BMFace * BM_face_split(BMesh *bm, BMFace *f, BMLoop *l_a, BMLoop *l_b, BMLoop **r_l, BMEdge *example, const bool no_double)
Face Split.
void BMO_slot_buffer_flag_enable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
BMO_FLAG_BUFFER.
#define BMO_edge_flag_test(bm, e, oflag)
#define BMO_edge_flag_enable(bm, e, oflag)
float BMO_slot_float_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
#define BMO_vert_flag_enable(bm, e, oflag)
#define BMO_vert_flag_set(bm, e, oflag, val)
#define BMO_SLOT_AS_BUFFER(slot)
void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
#define BMO_face_flag_enable(bm, e, oflag)
#define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag)
#define BMO_vert_flag_test(bm, e, oflag)
int BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
bool BMO_op_callf(BMesh *bm, int flag, const char *fmt,...)
BMOpSlot * BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK GET SLOT.
#define BMO_face_flag_disable(bm, e, oflag)
#define BMO_face_flag_test(bm, e, oflag)
bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
ATTR_WARN_UNUSED_RESULT const BMFlagLayer const short oflag
BMFace * BM_face_find_double(BMFace *f)
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
float BM_edge_calc_length_squared(const BMEdge *e)
bool BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb)
bool BM_vert_is_edge_pair(const BMVert *v)
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
ATTR_WARN_UNUSED_RESULT const BMVert * v
void BMW_init(BMWalker *walker, BMesh *bm, int type, short mask_vert, short mask_edge, short mask_face, BMWFlag flag, int layer)
Init Walker.
void BMW_end(BMWalker *walker)
End Walker.
void * BMW_begin(BMWalker *walker, void *start)
void * BMW_step(BMWalker *walker)
Step Walker.
void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
static bool UNUSED_FUNCTION() check_hole_in_region(BMesh *bm, BMFace *f)
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_verts_exec(BMesh *bm, BMOperator *op)
void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op)
void bmo_dissolve_degenerate_exec(BMesh *bm, BMOperator *op)
static void bm_face_split(BMesh *bm, const short oflag, bool use_edge_delete)
SyclQueue void void size_t num_bytes void
ccl_gpu_kernel_postfix ccl_global float int int int int float bool reset
clear internal cached data and reset random seed
void(* MEM_freeN)(void *vmemh)
struct BMLoop * radial_next
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]