diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-12-27 14:37:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-12-27 14:39:22 +0300 |
commit | 3afa72b6c714d7e1f9e0414481c41c4bebcff179 (patch) | |
tree | 4568781990852532e1ace3439b6427be3a2c80a7 /source | |
parent | 3fcf535d2e003ad939fa1f1c7aa4d5da1b38aef7 (diff) |
BMesh: BM_loop_share_edge_check utility func
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries.c | 10 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index 253fa950c73..30f4dc5cb2a 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -1275,6 +1275,16 @@ bool BM_face_share_vert_check(BMFace *f_a, BMFace *f_b) } /** + * 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 */ bool BM_edge_share_face_check(BMEdge *e1, BMEdge *e2) diff --git a/source/blender/bmesh/intern/bmesh_queries.h b/source/blender/bmesh/intern/bmesh_queries.h index a1322360729..10e4b9a15aa 100644 --- a/source/blender/bmesh/intern/bmesh_queries.h +++ b/source/blender/bmesh/intern/bmesh_queries.h @@ -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(); |