BMesh: BM_loop_share_edge_check utility func

This commit is contained in:
2015-12-27 22:37:12 +11:00
parent 3fcf535d2e
commit 3afa72b6c7
2 changed files with 11 additions and 0 deletions

View File

@@ -1274,6 +1274,16 @@ bool BM_face_share_vert_check(BMFace *f_a, BMFace *f_b)
return false;
}
/**
* Returns true when 2 loops share an edge (are adjacent in the face-fan)
*/
bool BM_loop_share_edge_check(BMLoop *l_a, BMLoop *l_b)
{
BLI_assert(l_a->v == l_b->v);
return (ELEM(l_a->e, l_b->e, l_b->prev->e) ||
ELEM(l_b->e, l_a->e, l_a->prev->e));
}
/**
* Test if e1 shares any faces with e2
*/

View File

@@ -151,6 +151,7 @@ bool BM_face_share_face_check(BMFace *f_a, BMFace *f_b) ATTR_WARN_UNUSED_RESU
bool BM_face_share_edge_check(BMFace *f_a, BMFace *f_b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
bool BM_face_share_vert_check(BMFace *f_a, BMFace *f_b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
bool BM_loop_share_edge_check(BMLoop *l_a, BMLoop *l_b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
bool BM_edge_share_face_check(BMEdge *e1, BMEdge *e2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
bool BM_edge_share_quad_check(BMEdge *e1, BMEdge *e2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();