66#define BM_VERT_DIR(v) ((short *)(&(v)->head.index))[0]
67#define BM_VERT_SKIP(v) ((short *)(&(v)->head.index))[1]
68#define BM_VERT_DIST(v) ((v)->no[0])
69#define BM_VERT_SORTVAL(v) ((v)->no[1])
70#define BM_VERT_LOOPINDEX(v) \
71 (*((uint *)(&(v)->no[2])))
99 return ELEM(delta, 1,
uint(f_len_orig - 1));
151 BMesh *
bm,
BMFace *f,
const float plane[4],
const short oflag_center,
const short oflag_new)
158 bool use_dirs[3] = {
false,
false,
false};
162 bool face_has_center_edge =
false;
181 if (face_has_center_edge ==
false) {
183 face_has_center_edge =
true;
188 }
while ((l_iter = l_iter->
next) != l_first);
190 if ((
STACK_SIZE(vert_split_arr) > 1) && (use_dirs[0] && use_dirs[2])) {
201 if (oflag_center | oflag_new) {
216 if (face_has_center_edge) {
222 }
while ((l_iter = l_iter->
next) != l_first);
226 BMLoop *l_first_non_center = l_first;
228 l_first_non_center = l_first_non_center->
next;
231 l_iter = l_first_non_center;
248 l_next = l_next->
next;
255 l_iter = l_prev->
next;
256 while (l_iter != l_next) {
259 l_iter = l_iter->
next;
263 l_iter = l_next->
prev;
264 }
while ((l_iter = l_iter->
next) != l_first_non_center);
281 for (i = 0; i <
STACK_SIZE(vert_split_arr); i++) {
282 if (!
equals_v3v3(vert_split_arr[0]->co, vert_split_arr[i]->co)) {
283 sub_v3_v3v3(sort_dir, vert_split_arr[0]->co, vert_split_arr[i]->co);
296 for (i = 0; i <
STACK_SIZE(vert_split_arr); i++) {
315 for (i = 0; i <
STACK_SIZE(vert_split_arr) - 1; i++) {
316 BMVert *v_a = vert_split_arr[i];
317 BMVert *v_b = vert_split_arr[i + 1];
319 if (face_has_center_edge) {
334 for (j = 0; j <
STACK_SIZE(face_split_arr); j++) {
355 if (oflag_center | oflag_new) {
364 if (f_tmp != face_split_arr[j]) {
379 (void)vert_split_arr;
389 const float plane[4],
390 const bool use_snap_center,
392 const short oflag_center,
393 const short oflag_new,
419 edges_arr[einput_len++] =
e;
461 if (use_snap_center) {
470 for (i = 0; i < einput_len; i++) {
476 if (side[0] && side[1] && (side[0] != side[1])) {
477 const float e_fac = dist[0] / (dist[0] - dist[1]);
482 l_iter = l_first =
e->l;
488 }
while ((l_iter = l_iter->
radial_next) != l_first);
500 if (oflag_new | oflag_center) {
507 else if (side[0] == 0 || side[1] == 0) {
531 if (side[0] == 0 && side[1] == 0) {
#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)
MINLINE float plane_point_side_v3(const float plane[4], const float co[3])
void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[3])
MINLINE bool equals_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float normalize_v3(float n[3])
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_SIZE(stack)
#define STACK_INIT(stack, stack_num)
Read Guarded memory(de)allocation.
BLI_INLINE void vert_is_center_enable(BMVert *v)
static int bm_vert_sortval_cb(const void *v_a_v, const void *v_b_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 face_in_stack_enable(BMFace *f)
static void bm_face_bisect_verts(BMesh *bm, BMFace *f, const float plane[4], const short oflag_center, const short oflag_new)
BLI_INLINE void vert_is_center_disable(BMVert *v)
BLI_INLINE bool edge_is_cut_test(BMEdge *e)
BLI_INLINE bool vert_is_center_test(BMVert *v)
BLI_INLINE void edge_is_cut_disable(BMEdge *e)
#define BM_VERT_LOOPINDEX(v)
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)
#define BM_VERT_SORTVAL(v)
BLI_INLINE void edge_is_cut_enable(BMEdge *e)
BLI_INLINE bool vert_pair_adjacent_in_orig_face(BMVert *v_a, BMVert *v_b, const uint f_len_orig)
BLI_INLINE void face_in_stack_disable(BMFace *f)
#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)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
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.
#define BMO_edge_flag_enable(bm, e, oflag)
#define BMO_vert_flag_enable(bm, e, oflag)
#define BMO_face_flag_enable(bm, e, oflag)
bool BM_face_is_normal_valid(const BMFace *f)
BMLoop * BM_face_vert_share_loop(BMFace *f, BMVert *v)
Return the Loop Shared by Face and Vertex.
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 BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
ATTR_WARN_UNUSED_RESULT const BMVert * v
static bool is_inside(int x, int y, int cols, int rows)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
struct BMLoop * radial_next
ccl_device_inline int abs(int x)