diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-18 10:36:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-18 10:36:47 +0400 |
commit | 27696ddae19a2a58da407b4d1a2453ec0de60841 (patch) | |
tree | 42199b7ba39327771702dcaf7367fe6ff5fde1f7 /source/blender/bmesh | |
parent | 6389301eb573625abefc20f93fb83efa64d2600d (diff) |
fix error in last commit. Misunderstood BM_vert_is_manifold(), added some comments.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries.c | 27 | ||||
-rw-r--r-- | source/blender/bmesh/tools/BME_bevel.c | 8 |
2 files changed, 21 insertions, 14 deletions
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index f85105651d4..92d26c0fc5a 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -470,10 +470,10 @@ int BM_edge_is_wire(BMEdge *e) /** * A vertex is non-manifold if it meets the following conditions: - * 1: Loose - (has no edges/faces incident upon it) - * 2: Joins two distinct regions - (two pyramids joined at the tip) - * 3: Is part of a non-manifold edge (edge with more than 2 faces) - * 4: Is part of a wire edge + * 1: Loose - (has no edges/faces incident upon it). + * 2: Joins two distinct regions - (two pyramids joined at the tip). + * 3: Is part of a an edge with more than 2 faces. + * 4: Is part of a wire edge. */ int BM_vert_is_manifold(BMVert *v) { @@ -487,18 +487,17 @@ int BM_vert_is_manifold(BMVert *v) } /* count edges while looking for non-manifold edges */ - oe = v->e; - for (len = 0, e = v->e; e != oe || (e == oe && len == 0); len++, e = bmesh_disk_edge_next(e, v)) { - if (e->l == NULL) { - /* loose edge */ - return FALSE; - } - - if (bmesh_radial_length(e->l) > 2) { - /* edge shared by more than two faces */ + len = 0; + oe = e = v->e; + do { + /* loose edge or edge shared by more than two faces, + * edges with 1 face user are OK, otherwise we could + * use BM_edge_is_manifold() here */ + if (e->l == NULL || bmesh_radial_length(e->l) > 2) { return FALSE; } - } + len++; + } while((e = bmesh_disk_edge_next(e, v)) != oe); count = 1; flag = 1; diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c index 59a35abfd63..5ef70f9cc2b 100644 --- a/source/blender/bmesh/tools/BME_bevel.c +++ b/source/blender/bmesh/tools/BME_bevel.c @@ -148,6 +148,7 @@ float *BME_new_transdata_float(BME_TransData_Head *td) * The drawback, though, is that this code doesn't merge customdata. */ static int BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v) { + BMIter iter; BMEdge *e, *elast; BMLoop *l1, *l2; @@ -155,6 +156,13 @@ static int BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v) return 0; } + /* hrmf, we could have a version of BM_vert_is_manifold() which checks for this case */ + BM_ITER(e, &iter, bm, BM_EDGES_OF_VERT, v) { + if (BM_edge_face_count(e) != 2) { + return 0; + } + } + if (BM_vert_edge_count(v) > 2) { while (BM_vert_edge_count(v) > 2) { e = v->e; |