55 BMEdge *
e, *keepedge =
nullptr, *baseedge =
nullptr;
78 if (keepedge ==
nullptr &&
len == 3) {
101 "Doubled face detected at " AT ". Resulting mesh may be corrupt.");
109 if (keepedge ==
nullptr &&
len == 2) {
118 if (
e->l !=
e->l->radial_next) {
127 "Doubled face detected at " AT ". Resulting mesh may be corrupt.");
154 "Doubled face detected at " AT ". Resulting mesh may be corrupt.");
175 if (
e->l !=
e->l->radial_next) {
185 "Doubled face detected at " AT ". Resulting mesh may be corrupt.");
198 if (l_a->
v ==
l_b->v) {
213 const bool no_double)
231 if (cd_loop_mdisp_offset != -1) {
235#ifdef USE_BMESH_HOLES
243 if (cd_loop_mdisp_offset != -1) {
244 float f_dst_center[3];
245 float f_src_center[3];
254 bm, f_new, f_tmp, f_dst_center, f_src_center, cd_loop_mdisp_offset);
264 if (cd_loop_mdisp_offset != -1) {
302#ifdef USE_BMESH_HOLES
313 for (
i = 0;
i < n;
i++) {
321 for (j = 0; j < 2; j++) {
322 BMEdge *e_iter = (j == 0) ?
e : e_new;
325 if (l_iter->
v == v_new) {
349 const bool join_faces,
350 const bool kill_degenerate_faces,
351 const bool kill_duplicate_faces)
366 const float w[2] = {1.0f - fac, fac};
370 if (l_iter->
v == tv && l_iter->
next->
v == v_kill) {
397 if (
faces.size() >= 2) {
404 "Doubled face detected at " AT ". Resulting mesh may be corrupt.");
424 bm, e_kill, v_kill, do_del,
true, kill_degenerate_faces, kill_duplicate_faces);
436 const bool kill_degenerate_faces,
437 const bool kill_duplicate_faces)
456 bm, e_kill, v_kill, do_del,
true, kill_degenerate_faces);
466 bm, e_kill, v_kill, 1.0f, do_del,
false, kill_degenerate_faces, kill_duplicate_faces);
473 BMesh *
bm,
BMEdge *e_kill,
BMVert *v_kill,
const bool do_del,
const bool kill_degenerate_faces)
491 if (cd_loop_mdisp_offset != -1) {
508 if (r_e !=
nullptr) {
526 if (cd_loop_mdisp_offset != -1) {
528 for (
BMFace *oldface : oldfaces) {
529 float f_center_old[3];
533 for (
int j = 0; j < 2; j++) {
549 bm,
l->f, oldface, f_center, f_center_old, cd_loop_mdisp_offset);
552 }
while (
l != e1->
l);
557 for (
BMFace *oldface : oldfaces) {
563 for (
int j = 0; j < 2; j++) {
576 }
while (
l != e1->
l);
590 for (
i = 0;
i < numcuts;
i++) {
591 percent = 1.0f /
float(numcuts + 1 -
i);
595 r_varr[numcuts -
i - 1] = v_new;
603 std::swap(
e->v1,
e->v2);
604 std::swap(
e->v1_disk_link,
e->v2_disk_link);
645 if (la->
v == lb->
v) {
653 if (la->
v == lb->
v) {
668 float ed_dir_new_flip[3];
670 float ed_dir_v1_old[3];
671 float ed_dir_v2_old[3];
673 float ed_dir_v1_new[3];
674 float ed_dir_v2_new[3];
729 if (
dot_v3v3(cross_old, cross_new) < 0.0f) {
734 if (
dot_v3v3(cross_old, cross_new) < 0.0f) {
741 if ((
dot_v3v3(ed_dir_new, ed_dir_v1_new) > 0.999f) ||
742 (
dot_v3v3(ed_dir_new_flip, ed_dir_v2_new) > 0.999f))
764 char f_active_prev = 0;
815 if (
bm->act_face == l1->
f) {
818 else if (
bm->act_face == l2->
f) {
832 "Doubled face detected at " AT ". Resulting mesh may be corrupt.");
850 fb->head.hflag = f_hflag_prev_2;
852 if (f_active_prev == 1) {
855 else if (f_active_prev == 2) {
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
void CustomData_bmesh_interp(CustomData *data, const void **src_blocks, const float *weights, int count, void *dst_block)
#define BLI_assert_msg(a, msg)
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[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 void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE float normalize_v3(float n[3])
void BM_elem_attrs_copy(BMesh *bm, const BMCustomDataCopyMap &map, const BMVert *src, BMVert *dst)
BMVert * bmesh_kernel_unglue_region_make_vert_multi_isolated(BMesh *bm, BMLoop *l_sep)
BMVert * bmesh_kernel_split_edge_make_vert(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
Split Edge Make Vert (SEMV).
void BM_face_verts_kill(BMesh *bm, BMFace *f)
BMFace * BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del, BMFace **r_double)
Join Connected Faces.
void BM_vert_kill(BMesh *bm, BMVert *v)
void BM_face_kill(BMesh *bm, BMFace *f)
BMEdge * bmesh_kernel_join_edge_kill_vert(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool check_edge_exists, const bool kill_degenerate_faces, const bool kill_duplicate_faces)
Join Edge Kill Vert (JEKV).
BMVert * bmesh_kernel_unglue_region_make_vert_multi(BMesh *bm, BMLoop **larr, int larr_len)
BMVert * bmesh_kernel_unglue_region_make_vert(BMesh *bm, BMLoop *l_sep)
Un-glue Region Make Vert (URMV).
BMFace * BM_face_copy(BMesh *bm_dst, const BMCustomDataCopyMap &cd_face_map, const BMCustomDataCopyMap &cd_loop_map, BMFace *f, const bool copy_verts, const bool copy_edges)
BMVert * bmesh_kernel_join_vert_kill_edge(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool check_edge_exists, const bool kill_degenerate_faces)
Join Vert Kill Edge (JVKE).
void bmesh_kernel_loop_reverse(BMesh *bm, BMFace *f, const int cd_loop_mdisp_offset, const bool use_loop_mdisp_flip)
Loop Reverse.
BMFace * bmesh_kernel_split_face_make_edge(BMesh *bm, BMFace *f, BMLoop *l_v1, BMLoop *l_v2, BMLoop **r_l, BMEdge *e_example, const bool no_double)
Split Face Make Edge (SFME).
BMEdge * BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *e_example, const eBMCreateFlag create_flag)
Main function for creating a new edge.
void BM_face_interp_multires_ex(BMesh *bm, BMFace *f_dst, const BMFace *f_src, const float f_dst_center[3], const float f_src_center[3], const int cd_loop_mdisp_offset)
void BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f)
void BM_loop_interp_from_face(BMesh *bm, BMLoop *l_dst, const BMFace *f_src, const bool do_vertex, const bool do_multires)
void BM_data_interp_face_vert_edge(BMesh *bm, const BMVert *v_src_1, const BMVert *, BMVert *v, BMEdge *e, const float fac)
Data Face-Vert Edge Interpolate.
void BM_data_interp_from_verts(BMesh *bm, const BMVert *v_src_1, const BMVert *v_src_2, BMVert *v_dst, const float fac)
Data, Interpolate From Verts.
#define BM_ITER_ELEM(ele, iter, data, itype)
BMFace * BM_face_split_n(BMesh *bm, BMFace *f, BMLoop *l_a, BMLoop *l_b, float cos[][3], int n, BMLoop **r_l, BMEdge *example)
Face Split with intermediate points.
BMVert * BM_face_loop_separate(BMesh *bm, BMLoop *l_sep)
Rip a single face from a vertex fan.
void BM_edge_calc_rotate(BMEdge *e, const bool ccw, BMLoop **r_l1, BMLoop **r_l2)
BMVert * BM_face_loop_separate_multi(BMesh *bm, BMLoop **larr, int larr_len)
bool BM_disk_dissolve(BMesh *bm, BMVert *v)
BMEdge * BM_vert_collapse_faces(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, float fac, const bool do_del, const bool join_faces, const bool kill_degenerate_faces, const bool kill_duplicate_faces)
Vert Collapse Faces.
bool BM_edge_rotate_check_degenerate(BMEdge *e, BMLoop *l1, BMLoop *l2)
Check if Edge Rotate Gives Degenerate Faces.
bool BM_vert_dissolve(BMesh *bm, BMVert *v)
Dissolve Vert.
bool BM_edge_rotate_check_beauty(BMEdge *e, BMLoop *l1, BMLoop *l2)
BMVert * BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float fac)
Edge Split.
BMFace * BM_faces_join_pair(BMesh *bm, BMLoop *l_a, BMLoop *l_b, const bool do_del, BMFace **r_double)
Faces Join Pair.
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.
bool BM_edge_rotate_check(BMEdge *e)
Check if Rotate Edge is OK.
BMEdge * BM_edge_rotate(BMesh *bm, BMEdge *e, const bool ccw, const short check_flag)
Rotate Edge.
void BM_edge_verts_swap(BMEdge *e)
BMVert * BM_face_loop_separate_multi_isolated(BMesh *bm, BMLoop *l_sep)
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.
BMVert * BM_edge_collapse(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool kill_degenerate_faces)
BMVert * BM_edge_split_n(BMesh *bm, BMEdge *e, int numcuts, BMVert **r_varr)
Split an edge multiple times evenly.
@ BM_EDGEROT_CHECK_EXISTS
@ BM_EDGEROT_CHECK_BEAUTY
@ BM_EDGEROT_CHECK_SPLICE
@ BM_EDGEROT_CHECK_DEGENERATE
void BM_face_normal_flip(BMesh *bm, BMFace *f)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
#define BM_ELEM_API_FLAG_DISABLE(element, f)
#define BM_ELEM_API_FLAG_TEST(element, f)
#define BM_ELEM_API_FLAG_ENABLE(element, f)
int bmesh_disk_count(const BMVert *v)
void BM_edge_ordered_verts(const BMEdge *edge, BMVert **r_v1, BMVert **r_v2)
int BM_vert_edge_count_at_most(const BMVert *v, const int count_max)
bool BM_vert_is_manifold(const BMVert *v)
bool BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb)
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
BMLoop * BM_face_other_vert_loop(BMFace *f, BMVert *v_prev, BMVert *v)
Other Loop in Face Sharing a Vertex.
bool BM_edge_share_face_check(BMEdge *e1, BMEdge *e2)
BMLoop * BM_face_edge_share_loop(BMFace *f, BMEdge *e)
Return the Loop Shared by Face and Edge.
BMLoop * BM_face_vert_share_loop(BMFace *f, BMVert *v)
Return the Loop Shared by Face and Vertex.
BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_loop_is_adjacent(const BMLoop *l_a, const BMLoop *l_b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define BM_vert_face_count_is_equal(v, n)
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_vert_in_edge(const BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert * v2
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
BLI_INLINE BMEdge * bmesh_disk_edge_next(const BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void append(const T &value)
BLI_INLINE float fb(float length, float L)
struct BMLoop * radial_next