Thanks for the answer, very cool, didn't thought about that as I was blocked on just fixing the non-cutted faces and totally forgot that I could split all the faces like this instead of using the edge divide. Anyway, I found a solution to fix this, the code goes into a detail wrangle in a for loop over each bugged face :
int pts[] = findattribval(0, "point", "bugged", 1);
i[]@pts = pts;
int p0_ = pts[0];
int p1_ = pts[1];
int in(int target; int array[])
{
//iterate through list to find if a item is in or not
int found = 0;
foreach(int a; array)
{
if(target == a) found = 1;
else found = 0;
}
return found;
}
void splitFace(int p0_, p1_, prim0)
{
// create neighbours pairs
int p0[] = neighbours(0, p0_);
int p1[] = neighbours(0, p1_);
int x0_ = p0[0];
int y0_ = p0[1];
int x1_ = p1[0];
int y1_ = p1[1];
int x0[] = neighbours(0, x0_);
int y0[] = neighbours(0, y0_);
int x1[] = neighbours(0, x1_);
int y1[] = neighbours(0, y1_);
// create arrays
int array1[], array2[];
//array 1
if(in(x0_, y1) == 1)
{
setcomp(array1, x0_, 0);
setcomp(array1, y1_, 1);
setcomp(array1, p1_, 2);
setcomp(array1, p0_, 3);
}
if(in(x0_, x1) == 1)
{
setcomp(array1, x0_, 0);
setcomp(array1, x1_, 1);
setcomp(array1, p1_, 2);
setcomp(array1, p0_, 3);
}
//array 2
if(in(y1_, y0) == 1)
{
setcomp(array2, p0_, 0);
setcomp(array2, p1_, 1);
setcomp(array2, y1_, 2);
setcomp(array2, y0_, 3);
}
if(in(y0_, x1) == 1)
{
setcomp(array2, p0_, 0);
setcomp(array2, p1_, 1);
setcomp(array2, x1_, 2);
setcomp(array2, y0_, 3);
}
setdetailattrib(0, "a1", array1, "set"); //debug
setdetailattrib(0, "a2", array2, "set"); //debug
// create polys
removeprim(0, prim0, 0);
addprim(0, "poly", reverse(array1));
addprim(0, "poly", reverse(array2));
}
splitFace(p0_, p1_, 0);