Added three more cases for allowing to create a new quad (Fkey), based on
authorTon Roosendaal <ton@blender.org>
Sat, 26 Nov 2005 13:09:25 +0000 (13:09 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 26 Nov 2005 13:09:25 +0000 (13:09 +0000)
inverting the checked triangle diagonal.
Noticed issues while modeling subsurfs yesterday, in that case you can
really be less strict.

source/blender/src/editmesh_add.c

index 13860329cf747ef6c0e827ebfd937778508caed4..6e82e82134e51c4e6bef0fdad8942d6a479388bf 100644 (file)
@@ -633,7 +633,7 @@ void addedgeface_mesh(void)
                                /* if 4 edges exist, we just create the face, convex or not */
                                efa= addface_from_edges();
                                if(efa==NULL) {
-                                       /* the order of vertices can be anything, three cases to check */
+                                       /* the order of vertices can be anything, 6 cases to check */
                                        if( convex(neweve[0]->co, neweve[1]->co, neweve[2]->co, neweve[3]->co) ) {
                                                efa= addfacelist(neweve[0], neweve[1], neweve[2], neweve[3], NULL, NULL);
                                        }
@@ -643,6 +643,16 @@ void addedgeface_mesh(void)
                                        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);
                                        }
+                                       
+                                       else if( convex(neweve[1]->co, neweve[2]->co, neweve[3]->co, neweve[0]->co) ) {
+                                               efa= addfacelist(neweve[1], neweve[2], neweve[3], neweve[0], NULL, NULL);
+                                       }
+                                       else if( convex(neweve[1]->co, neweve[3]->co, neweve[0]->co, neweve[2]->co) ) {
+                                               efa= addfacelist(neweve[1], neweve[3], neweve[0], neweve[2], NULL, NULL);
+                                       }
+                                       else if( convex(neweve[1]->co, neweve[3]->co, neweve[2]->co, neweve[0]->co) ) {
+                                               efa= addfacelist(neweve[1], neweve[3], neweve[2], neweve[0], NULL, NULL);
+                                       }
                                        else error("The selected vertices form a concave quad");
                                }
                        }