Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Bantle <hairbat@yahoo.com>2008-06-01 05:56:35 +0400
committerGeoffrey Bantle <hairbat@yahoo.com>2008-06-01 05:56:35 +0400
commit26cb5fa0db6f43a44358f8adc1529ebe58d41d3a (patch)
tree34f623c59613f6fb1337b40485ced2e6d6d7bc81 /source/blender/blenkernel
parentedd2b6ca7374c475cbd6fe0c8a15d6bcce6f1e8c (diff)
-Fix for bug #13067
Bevel tool was hanging on certain geometry where the edge to be beveled was shared by two faces that had more than one edge in common and caller was not checking return status of Bmesh eulers. Fixed.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/BME_tools.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c
index 90fa9793644..7ce967d1d22 100644
--- a/source/blender/blenkernel/intern/BME_tools.c
+++ b/source/blender/blenkernel/intern/BME_tools.c
@@ -811,7 +811,18 @@ static float BME_bevel_get_angle(BME_Mesh *bm, BME_Edge *e, BME_Vert *v) {
return Inpf(vec3,vec4);
}
-
+static int BME_face_sharededges(BME_Poly *f1, BME_Poly *f2){
+ BME_Loop *l;
+ int count = 0;
+
+ l = f1->loopbase;
+ do{
+ if(BME_radial_find_face(l->e,f2)) count++;
+ l = l->next;
+ }while(l != f1->loopbase);
+
+ return count;
+}
/**
* BME_bevel_initialize
*
@@ -990,6 +1001,17 @@ static BME_Mesh *BME_bevel_initialize(BME_Mesh *bm, int options, int defgrp_inde
/* face pass */
for (f=bm->polys.first; f; f=f->next) f->tflag1 = BME_BEVEL_ORIG;
+ /*clean up edges with 2 faces that share more than one edge*/
+ for (e=bm->edges.first; e; e=e->next){
+ if(e->tflag1 & BME_BEVEL_BEVEL){
+ int count = 0;
+ count = BME_face_sharededges(e->loop->f, ((BME_Loop*)e->loop->radial.next->data)->f);
+ if(count > 1){
+ e->tflag1 &= ~BME_BEVEL_BEVEL;
+ }
+ }
+ }
+
return bm;
}
@@ -1075,7 +1097,7 @@ static BME_Mesh *BME_bevel_mesh(BME_Mesh *bm, float value, int res, int options,
v = BME_bevel_wire(bm, v, value, res, options, td);
}
else if (res && ((v->tflag1 & BME_BEVEL_BEVEL) && (v->tflag1 & BME_BEVEL_ORIG))) {
-
+ int count = 0;
/* first, make sure we're not sitting on an edge to be removed */
oe = v->edge;
e = BME_disk_nextedge(oe,v);
@@ -1089,6 +1111,7 @@ static BME_Mesh *BME_bevel_mesh(BME_Mesh *bm, float value, int res, int options,
/* look for original edges, and remove them */
oe = e;
while ( (e = BME_disk_next_edgeflag(oe, v, 0, BME_BEVEL_ORIG | BME_BEVEL_BEVEL)) ) {
+ count++;
/* join the faces (we'll split them later) */
f = BME_JFKE_safe(bm,e->loop->f,((BME_Loop*)e->loop->radial.next->data)->f,e);
if (!f){
@@ -1096,6 +1119,9 @@ static BME_Mesh *BME_bevel_mesh(BME_Mesh *bm, float value, int res, int options,
}
}
+ /*need to do double check *before* you bevel to make sure that manifold edges are for two faces that share only *one* edge to make sure it doesnt hang here!*/
+
+
/* all original edges marked to be beveled have been removed;
* now we need to link up the edges for this "corner" */
len = BME_cycle_length(BME_disk_getpointer(v->edge, v));