69#define BM_VERT_DIR(v) ((short *)(&(v)->head.index))[0]
70#define BM_VERT_SKIP(v) ((short *)(&(v)->head.index))[1]
71#define BM_VERT_DIST(v) ((v)->no[0])
72#define BM_VERT_SORTVAL(v) ((v)->no[1])
73#define BM_VERT_LOOPINDEX(v) \
74 (*((uint *)(&(v)->no[2])))
102 return ELEM(delta, 1,
uint(f_len_orig - 1));
140 BMesh *
bm,
BMFace *f,
const float plane[4],
const short oflag_center,
const short oflag_new)
145 BMVert **vert_split_arr = vert_split_arr_buf.
data();
148 bool use_dirs[3] = {
false,
false,
false};
149 bool is_inside =
false;
152 bool face_has_center_edge =
false;
171 if (face_has_center_edge ==
false) {
173 face_has_center_edge =
true;
178 }
while ((l_iter = l_iter->
next) != l_first);
180 if ((
STACK_SIZE(vert_split_arr) > 1) && (use_dirs[0] && use_dirs[2])) {
181 if (
STACK_SIZE(vert_split_arr) == 2) [[likely]] {
191 if (oflag_center | oflag_new) {
206 if (face_has_center_edge) {
212 }
while ((l_iter = l_iter->
next) != l_first);
216 BMLoop *l_first_non_center = l_first;
218 l_first_non_center = l_first_non_center->
next;
221 l_iter = l_first_non_center;
238 l_next = l_next->
next;
245 l_iter = l_prev->
next;
246 while (l_iter != l_next) {
249 l_iter = l_iter->
next;
253 l_iter = l_next->
prev;
254 }
while ((l_iter = l_iter->
next) != l_first_non_center);
258 BMFace **face_split_arr = face_split_arr_buf.
data();
272 for (i = 0; i <
STACK_SIZE(vert_split_arr); i++) {
273 if (!
equals_v3v3(vert_split_arr[0]->co, vert_split_arr[i]->co)) {
274 sub_v3_v3v3(sort_dir, vert_split_arr[0]->co, vert_split_arr[i]->co);
278 if (i ==
STACK_SIZE(vert_split_arr)) [[unlikely]] {
287 for (i = 0; i <
STACK_SIZE(vert_split_arr); i++) {
308 for (i = 0; i <
STACK_SIZE(vert_split_arr) - 1; i++) {
309 BMVert *v_a = vert_split_arr[i];
310 BMVert *v_b = vert_split_arr[i + 1];
312 if (face_has_center_edge) {
319 is_inside = !is_inside;
327 for (j = 0; j <
STACK_SIZE(face_split_arr); j++) {
348 if (oflag_center | oflag_new) {
357 if (f_tmp != face_split_arr[j]) {
372 (void)vert_split_arr;
382 const float plane[4],
383 const bool use_snap_center,
385 const short oflag_center,
386 const short oflag_new,
412 edges_arr[einput_len++] =
e;
454 if (use_snap_center) {
461 faces_deferred_normal_update.
add(f);
468 for (
BMFace *f_iter : faces_deferred_normal_update) {
475 for (i = 0; i < einput_len; i++) {
481 if (side[0] && side[1] && (side[0] != side[1])) {
482 const float e_fac = dist[0] / (dist[0] - dist[1]);
487 l_iter = l_first =
e->l;
493 }
while ((l_iter = l_iter->
radial_next) != l_first);
505 if (oflag_new | oflag_center) {
512 else if (side[0] == 0 || side[1] == 0) {
536 if (side[0] == 0 && side[1] == 0) {
543 MEM_delete(edges_arr);
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)
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_SIZE(stack)
#define STACK_INIT(stack, stack_num)
Read Blender memory allocation and freeing.
#define BM_VERT_LOOPINDEX(v)
#define BM_VERT_SORTVAL(v)
#define BM_FACE_FIRST_LOOP(p)
#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_INDEX(ele, iter, bm, itype, indexvar)
#define BM_ITER_ELEM_INDEX(ele, iter, data, itype, indexvar)
#define BMO_edge_flag_enable(bm, e, oflag)
#define BMO_vert_flag_enable(bm, e, oflag)
#define BMO_face_flag_enable(bm, e, oflag)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[3])
BLI_INLINE void face_in_stack_disable(BMFace *f)
BLI_INLINE bool BM_loop_is_adjacent(const BMLoop *l_a, const BMLoop *l_b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
MINLINE void copy_v3_v3(float r[3], const float a[3])
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
static short plane_point_test_v3(const float plane[4], const float co[3], const float eps, float *r_depth)
BLI_INLINE bool face_in_stack_test(BMFace *f)
BLI_INLINE void edge_is_cut_enable(BMEdge *e)
BLI_INLINE bool vert_is_center_test(BMVert *v)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void BM_mesh_bisect_plane(BMesh *bm, const float plane[4], const bool use_snap_center, const bool use_tag, const short oflag_center, const short oflag_new, const float eps)
BLI_INLINE void vert_is_center_enable(BMVert *v)
MINLINE bool equals_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
void BM_face_normal_update(BMFace *f)
BLI_INLINE bool vert_pair_adjacent_in_orig_face(BMVert *v_a, BMVert *v_b, const uint f_len_orig)
BLI_INLINE void vert_is_center_disable(BMVert *v)
BLI_INLINE bool edge_is_cut_test(BMEdge *e)
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
MINLINE float plane_point_side_v3(const float plane[4], const float co[3])
BLI_INLINE void edge_is_cut_disable(BMEdge *e)
static void bm_face_bisect_verts(BMesh *bm, BMFace *f, const float plane[4], const short oflag_center, const short oflag_new)
MINLINE float normalize_v3(float n[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
BMVert * BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float fac)
Edge Split.
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.
BLI_INLINE void face_in_stack_enable(BMFace *f)
BMLoop * BM_face_vert_share_loop(BMFace *f, BMVert *v)
Return the Loop Shared by Face and Vertex.
bool BM_face_is_normal_valid(const BMFace *f)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
struct BMLoop * radial_next