18 #define EDGE_OUT (1 << 0)
19 #define FACE_OUT (1 << 1)
39 delta_z +=
fabsf(z_curr - z_prev);
41 }
while ((l_iter = l_iter->
next) != l_term);
55 float err_best = FLT_MAX;
56 float angle_best_cos = -FLT_MAX;
61 l_arr[i_a++] = l_iter;
62 }
while ((l_iter = l_iter->
next) != l_first);
65 for (i_a = 0; i_a < f_len; i_a++) {
67 for (i_b = i_a + 2; i_b < f_len; i_b++) {
73 float no_a[3], no_b[3];
79 const float err_test = err_a + err_b;
81 if (err_test < err_best) {
90 angle_best_cos =
dot_v3v3(no_a, no_b);
99 *r_angle_cos = angle_best_cos;
107 const float angle_limit_cos)
135 bool changed =
false;
152 for (j = 0; j < 2; j++) {
154 if (f_pair[j]->
len > 3) {
#define BLI_array_alloca(arr, realsize)
BLI_LINKSTACK_*** wrapper macros for using a LinkNode to store a stack of pointers,...
#define BLI_LINKSTACK_PUSH(var, ptr)
#define BLI_LINKSTACK_DECLARE(var, type)
#define BLI_LINKSTACK_FREE(var)
#define BLI_LINKSTACK_INIT(var)
#define BLI_LINKSTACK_POP(var)
void axis_dominant_v3_to_m3(float r_mat[3][3], const float normal[3])
Normal to x,y matrix.
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_m3_v3_row_z(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
#define BM_FACE_FIRST_LOOP(p)
ATTR_WARN_UNUSED_RESULT BMesh * bm
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.
#define BMO_edge_flag_enable(bm, e, oflag)
float BMO_slot_float_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
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)
void BM_face_splits_check_legal(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
void BM_face_normal_update(BMFace *f)
float BM_face_calc_normal_subset(const BMLoop *l_first, const BMLoop *l_last, float r_no[3])
BLI_INLINE bool BM_loop_is_adjacent(const BMLoop *l_a, const BMLoop *l_b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
static bool bm_face_split_find(BMesh *bm, BMFace *f, BMLoop *l_pair[2], float *r_angle_cos)
void bmo_connect_verts_nonplanar_exec(BMesh *bm, BMOperator *op)
static float bm_face_subset_calc_planar(BMLoop *l_first, BMLoop *l_last, const float no[3])
static bool bm_face_split_by_angle(BMesh *bm, BMFace *f, BMFace *r_f_pair[2], const float angle_limit_cos)
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]