Grmble... and now the feature ALT+J 'join triangles' broke. :)
Also found out the Fkey option didn't work anymore on 2 triangles (makes 1
quad too). Luckily we got people testing eh!
This commit is contained in:
Ton Roosendaal 2005-09-24 15:46:08 +00:00
parent e5b9f62c6e
commit 843bc28d37
2 changed files with 24 additions and 3 deletions

@ -315,6 +315,26 @@ static EditFace *addface_from_edges(void)
return NULL;
}
/* checks for existance, and for tria overlapping inside quad */
static EditFace *exist_face_overlaps(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4)
{
EditMesh *em = G.editMesh;
EditFace *efa, efatest;
efatest.v1= v1;
efatest.v2= v2;
efatest.v3= v3;
efatest.v4= v4;
efa= em->faces.first;
while(efa) {
if(compareface(&efatest, efa, 3)) return efa;
efa= efa->next;
}
return NULL;
}
void addedgeface_mesh(void)
{
EditMesh *em = G.editMesh;
@ -360,7 +380,8 @@ void addedgeface_mesh(void)
efa= NULL; // check later
if(amount==3) {
if(exist_face(neweve[0], neweve[1], neweve[2], 0)==0) {
if(exist_face_overlaps(neweve[0], neweve[1], neweve[2], NULL)==0) {
efa= addfacelist(neweve[0], neweve[1], neweve[2], 0, NULL, NULL);
EM_select_face(efa, 1);

@ -1394,7 +1394,7 @@ int compareface(EditFace *vl1, EditFace *vl2, int test)
return 1;
}
/* this also prevents triangles being made in quads */
/* checks for existance, not tria overlapping inside quad */
EditFace *exist_face(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4)
{
EditMesh *em = G.editMesh;
@ -1407,7 +1407,7 @@ EditFace *exist_face(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4)
efa= em->faces.first;
while(efa) {
if(compareface(&efatest, efa, 3)) return efa;
if(compareface(&efatest, efa, 4)) return efa;
efa= efa->next;
}
return NULL;