QVector<unsignedint>ib_combined=ib_regular+ib_irregular;//DO NOT swap regular and irregular! iteration over ib_combined starting from index in ib_regular
intcount3=0;//counts other triangles with this vertex
intcount6=0;
intcount7=0;
for(intj=0;j<ib_combined.length();j++){
if(j!=i&&j!=i+1&&j!=i+2){
//for debugging // checking if patch is regular.
if(vb[ib_combined[j]].samePos(v3))count3++;
if(vb[ib_combined[j]].samePos(v6))count6++;
if(vb[ib_combined[j]].samePos(v7))count7++;
}
}
if(count3!=5||count6!=5||count7!=5){
qCWarning(log_subdiv)<<"Counts wrong! 3: "<<count3<<", 6: "<<count6<<", 7: "<<count7<<".\nEither this patch is not regular, or you didn't pass all neighboring triangles.";
}
}
}
Trianglet367(&vb,i3,i6,i7);
QVector<unsignedint>patch;
patch.resize(12);
for(intj=i+3;j<ib_combined.length()-2;j+=3){
QVectorIterator<Triangle>it(triangles);
unsignedintj0=ib_combined[j];
while(it.hasNext()){
unsignedintj1=ib_combined[j+1];
Triangletriangle=it.next();
unsignedintj2=ib_combined[j+2];
Triangletj(&vb,j0,j1,j2);
// These three vertices come from the triangle we're looking at
patch[3]=triangle.u_idx();
patch[6]=triangle.v_idx();
patch[7]=triangle.w_idx();
if(t367.hasSharedEdge(tj)){
// These three vertices are those completing the three neighboring triangles