BMesh: utility function to split off wire edges

This commit is contained in:
Campbell Barton
2015-12-17 05:02:14 +11:00
parent 901b0dea62
commit 8b1b320c9f
2 changed files with 27 additions and 0 deletions

View File

@@ -2499,6 +2499,30 @@ void BM_vert_separate_hflag(
}
}
void BM_vert_separate_wire_hflag(
BMesh *UNUSED(bm), BMVert *v_dst, BMVert *v_src,
const char hflag)
{
LinkNode *edges_hflag = NULL;
BMEdge *e_iter, *e_first;
e_iter = e_first = v_src->e;
do {
if (BM_elem_flag_test(e_iter, hflag)) {
if (BM_edge_is_wire(e_iter)) {
BLI_linklist_prepend_alloca(&edges_hflag, e_iter);
}
}
} while ((e_iter = BM_DISK_EDGE_NEXT(e_iter, v_src)) != e_first);
if (edges_hflag) {
do {
e_iter = edges_hflag->link;
bmesh_disk_vert_replace(e_iter, v_dst, v_src);
} while ((edges_hflag = edges_hflag->next));
}
}
/** \} */

View File

@@ -84,6 +84,9 @@ void BM_vert_separate(
void BM_vert_separate_hflag(
BMesh *bm, BMVert *v, const char hflag, const bool copy_select,
BMVert ***r_vout, int *r_vout_len);
void BM_vert_separate_wire_hflag(
BMesh *bm, BMVert *v_dst, BMVert *v_src,
const char hflag);
/* EULER API - For modifying structure */
BMFace *bmesh_sfme(