diff options
author | Ton Roosendaal <ton@blender.org> | 2004-11-07 03:10:10 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-11-07 03:10:10 +0300 |
commit | f07126a9a33834b12837e1cd1aef449e03184154 (patch) | |
tree | ebf95757b5c43bfed6a8c120e57ae2700132553c /source | |
parent | 82cae482e934888b9d99374201cdea0325c04f25 (diff) |
Found one other problem in convec() call... cannot use calcnormfloat4()
there, since the calcnormfloat of course requires a regular quad!
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/editmesh_lib.c | 20 | ||||
-rw-r--r-- | source/blender/src/editmesh_tools.c | 2 |
2 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c index 16bc0aabd09..1a69820c97b 100644 --- a/source/blender/src/editmesh_lib.c +++ b/source/blender/src/editmesh_lib.c @@ -1509,20 +1509,22 @@ EditFace *exist_face(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4) /* evaluate if entire quad is a proper convex quad */ int convex(float *v1, float *v2, float *v3, float *v4) { - float nor[3], vec[4][2]; - - /* define projection */ - CalcNormFloat4(v1, v2, v3, v4, nor); - nor[0]= ABS(nor[0]); - nor[1]= ABS(nor[1]); - nor[2]= ABS(nor[2]); - if(nor[2] >= nor[0] && nor[2]>= nor[1]) { + float nor[3], nor1[3], nor2[3], vec[4][2]; + + /* define projection, do both trias apart, quad is undefined! */ + CalcNormFloat(v1, v2, v3, nor1); + CalcNormFloat(v1, v3, v4, nor2); + nor[0]= ABS(nor1[0]) + ABS(nor2[0]); + nor[1]= ABS(nor1[1]) + ABS(nor2[1]); + nor[2]= ABS(nor1[2]) + ABS(nor2[2]); + + if(nor[2] > nor[0] && nor[2] > nor[1]) { vec[0][0]= v1[0]; vec[0][1]= v1[1]; vec[1][0]= v2[0]; vec[1][1]= v2[1]; vec[2][0]= v3[0]; vec[2][1]= v3[1]; vec[3][0]= v4[0]; vec[3][1]= v4[1]; } - else if(nor[1] >= nor[0] && nor[1]>= nor[2]) { + else if(nor[1] > nor[0] && nor[1]> nor[2]) { vec[0][0]= v1[0]; vec[0][1]= v1[2]; vec[1][0]= v2[0]; vec[1][1]= v2[2]; vec[2][0]= v3[0]; vec[2][1]= v3[2]; diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index 9cc334f59bf..46934bcbe46 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -3312,7 +3312,7 @@ void bevel_mesh(float bsize, int allfaces) else if( convex(neweve[0]->co, neweve[2]->co, neweve[3]->co, neweve[1]->co) ) { efa= addfacelist(neweve[0], neweve[2], neweve[3], neweve[1], NULL, NULL); } - else { + else if( convex(neweve[0]->co, neweve[2]->co, neweve[1]->co, neweve[3]->co) ) { efa= addfacelist(neweve[0], neweve[2], neweve[1], neweve[3], NULL, NULL); } } |