314 |
void __createNotIn2(const TriangleCut& K,const Cell* cell, |
void __createNotIn2(const TriangleCut& K,const Cell* cell, |
315 |
std::vector<Triangle>& triangleListIntersectionNew); |
std::vector<Triangle>& triangleListIntersectionNew); |
316 |
|
|
317 |
|
void __3pointsintersection(const TriangleCut& K,const Cell* cell, |
318 |
|
std::vector<Triangle>& triangleListIntersectionNew); |
319 |
|
|
320 |
template <typename booleanTest> |
template <typename booleanTest> |
321 |
void __createTrianglesIntersection(const size_t numobject, |
void __createTrianglesIntersection(const size_t numobject, |
322 |
const ObjectToTreat& O1, |
const ObjectToTreat& O1, |
581 |
hexaList2.begin(), hexaList2.end(), |
hexaList2.begin(), hexaList2.end(), |
582 |
inserter(toTreatHexahedra, toTreatHexahedra.begin())); |
inserter(toTreatHexahedra, toTreatHexahedra.begin())); |
583 |
|
|
584 |
ffout(4)<<"nb hexa to treat "<<toTreatHexahedra.size()<<"\n"; |
ffout(3)<<"nb hexa to treat "<<toTreatHexahedra.size()<<"\n"; |
585 |
|
|
586 |
__calculateIntersection<booleanTest>(O0,O1,O2, toTreatHexahedra); |
__calculateIntersection<booleanTest>(O0,O1,O2, toTreatHexahedra); |
587 |
} |
} |
601 |
//create mesh intersection for the object 0 and 1 |
//create mesh intersection for the object 0 and 1 |
602 |
__createTrianglesIntersection<booleanTest>(0, O1, O2, toTreatHexahedra, |
__createTrianglesIntersection<booleanTest>(0, O1, O2, toTreatHexahedra, |
603 |
triangleListIntersectionNew, listVertexIntersectionNew); |
triangleListIntersectionNew, listVertexIntersectionNew); |
604 |
ffout(4)<<"nb triangles in intersection 0 "<<triangleListIntersectionNew.size()<<"\n"<<std::flush; |
ffout(3)<<"nb triangles in intersection 0 "<<triangleListIntersectionNew.size()<<"\n"<<std::flush; |
605 |
__createTrianglesIntersection<booleanTest>(1, O2, O1, toTreatHexahedra, |
__createTrianglesIntersection<booleanTest>(1, O2, O1, toTreatHexahedra, |
606 |
triangleListIntersectionNew, listVertexIntersectionNew); |
triangleListIntersectionNew, listVertexIntersectionNew); |
607 |
ffout(4)<<"nb triangles in intersection 1 "<<triangleListIntersectionNew.size()<<"\n"<<std::flush; |
ffout(3)<<"nb triangles in intersection 1 "<<triangleListIntersectionNew.size()<<"\n"<<std::flush; |
608 |
|
|
609 |
pairTriangleToIntersectionPoints.clear(); |
pairTriangleToIntersectionPoints.clear(); |
610 |
|
|
677 |
ntr+=listOfVertexMesh.size(); |
ntr+=listOfVertexMesh.size(); |
678 |
|
|
679 |
s_mesh.setNumberOfVertices(ntr); |
s_mesh.setNumberOfVertices(ntr); |
680 |
ffout(4)<<"nb tot vertices "<<s_mesh.numberOfVertices()<<"\n"<<std::flush; |
ffout(3)<<"nb tot vertices "<<s_mesh.numberOfVertices()<<"\n"<<std::flush; |
681 |
|
|
682 |
//! copies vertices into the s_mesh. |
//! copies vertices into the s_mesh. |
683 |
int i = 0; |
int i = 0; |
705 |
//if(nobjectToTreat==0){ |
//if(nobjectToTreat==0){ |
706 |
ncell+=triangleList.size(); |
ncell+=triangleList.size(); |
707 |
//} |
//} |
708 |
// ffout(4)<<"ncell "<<ncell<<" n0 "<<n0<<" n1 "<<n1<<"\n"; |
// ffout(3)<<"ncell "<<ncell<<" n0 "<<n0<<" n1 "<<n1<<"\n"; |
709 |
|
|
710 |
s_mesh.setNumberOfCells(ncell); |
s_mesh.setNumberOfCells(ncell); |
711 |
ffout(4)<<"nb tot cells "<<s_mesh.numberOfCells()<<" \n"<<std::flush; |
ffout(3)<<"nb tot cells "<<s_mesh.numberOfCells()<<" \n"<<std::flush; |
712 |
|
|
713 |
for(size_t size=0 ; size< triangleList.size() ; ++size) { |
for(size_t size=0 ; size< triangleList.size() ; ++size) { |
714 |
const Triangle& T=triangleList[size]; |
const Triangle& T=triangleList[size]; |
807 |
} |
} |
808 |
} |
} |
809 |
} else { |
} else { |
810 |
//ffout(4)<<"pas d'intersection dans l'hexa\n"; |
//ffout(3)<<"pas d'intersection dans l'hexa\n"; |
811 |
} |
} |
812 |
} |
} |
813 |
} |
} |
869 |
} |
} |
870 |
} |
} |
871 |
} |
} |
872 |
#warning Reference not set. |
//#warning Reference not set. |
873 |
Triangle T(*triangle[0], *triangle[1], *triangle[2]); |
Triangle T(*triangle[0], *triangle[1], *triangle[2],K.reference()); |
874 |
__addTriangle(T, cell, triangleListIntersectionNew); |
__addTriangle(T, cell, triangleListIntersectionNew); |
875 |
} |
} |
876 |
|
|
1044 |
if(inV01 > epsilon and inV02 > epsilon and inV12 > epsilon ) { |
if(inV01 > epsilon and inV02 > epsilon and inV12 > epsilon ) { |
1045 |
__InTriangle(P,V,num); |
__InTriangle(P,V,num); |
1046 |
if(num==3) { |
if(num==3) { |
1047 |
//ffout(4)<<"ajout du point cas 2\n"; |
//ffout(3)<<"ajout du point cas 2\n"; |
1048 |
//ffout(4)<<P[0]<<" "<<P[1]<<" "<<P[2]<<" \n"; |
//ffout(3)<<P[0]<<" "<<P[1]<<" "<<P[2]<<" \n"; |
1049 |
//listVertexIntersectionNew.push_back(new Vertex (P)); |
//listVertexIntersectionNew.push_back(new Vertex (P)); |
1050 |
PIntersection PIn; |
PIntersection PIn; |
1051 |
// if(!(norm2>epsilon)) { |
// if(!(norm2>epsilon)) { |
1137 |
size_t& refVertex1=(*edgesRefVertex[numobject])[V1]; |
size_t& refVertex1=(*edgesRefVertex[numobject])[V1]; |
1138 |
|
|
1139 |
if(refVertex0+refVertex1==4 and edgeCut==1) { |
if(refVertex0+refVertex1==4 and edgeCut==1) { |
1140 |
ffout(4)<<"warning edge ref 2 cut \n"; |
ffout(3)<<"warning edge ref 2 cut \n"; |
1141 |
ffout(4)<<(*V0)[0]<<" "<<(*V0)[1]<<" "<<(*V0)[2]<<" \n"; |
ffout(3)<<(*V0)[0]<<" "<<(*V0)[1]<<" "<<(*V0)[2]<<" \n"; |
1142 |
ffout(4)<<(*V1)[0]<<" "<<(*V1)[1]<<" "<<(*V1)[2]<<" \n"; |
ffout(3)<<(*V1)[0]<<" "<<(*V1)[1]<<" "<<(*V1)[2]<<" \n"; |
1143 |
refVertex0=0; |
refVertex0=0; |
1144 |
refVertex1=0; |
refVertex1=0; |
1145 |
} else { |
} else { |
1156 |
std::list<Triangle*>::iterator currentTriangle, |
std::list<Triangle*>::iterator currentTriangle, |
1157 |
PIntersection& listVertexIntersectionNew) |
PIntersection& listVertexIntersectionNew) |
1158 |
{ |
{ |
1159 |
//ffout(4)<< "createpointintersection "<<numobject<<" "<<objectNumber<<"\n"; |
//ffout(3)<< "createpointintersection "<<numobject<<" "<<objectNumber<<"\n"; |
1160 |
//ffout(4)<<"*************************\n"; |
//ffout(3)<<"*************************\n"; |
1161 |
|
|
1162 |
PairTriangleNew pTriangle; |
PairTriangleNew pTriangle; |
1163 |
pTriangle.first=(*currentTriangle1); |
pTriangle.first=(*currentTriangle1); |
1170 |
const TinyVector<3,size_t >& pintercut=Pinter.cutTriangle1(); |
const TinyVector<3,size_t >& pintercut=Pinter.cutTriangle1(); |
1171 |
|
|
1172 |
if(pintercut[0]+pintercut[1]+pintercut[2]!=0) { |
if(pintercut[0]+pintercut[1]+pintercut[2]!=0) { |
1173 |
//ffout(4)<<"le tr est cut\n"; |
//ffout(3)<<"le tr est cut\n"; |
1174 |
assert(pairTriangleToIntersectionPoints.find(pTriangle)==pairTriangleToIntersectionPoints.end()); |
assert(pairTriangleToIntersectionPoints.find(pTriangle)==pairTriangleToIntersectionPoints.end()); |
1175 |
pairTriangleToIntersectionPoints[pTriangle] = Pinter; |
pairTriangleToIntersectionPoints[pTriangle] = Pinter; |
1176 |
} else { |
} else { |
1177 |
if(Pinter.size()!=0) { |
if(Pinter.size()!=0) { |
1178 |
//ffout(4)<<"rajout2 \n"; |
//ffout(3)<<"rajout2 \n"; |
1179 |
pairTriangleToIntersectionPoints[pTriangle] = Pinter; |
pairTriangleToIntersectionPoints[pTriangle] = Pinter; |
1180 |
} |
} |
1181 |
} |
} |
1307 |
const Vertex& B=__determinateNumber(vertexNum[0],pointsIntersection); |
const Vertex& B=__determinateNumber(vertexNum[0],pointsIntersection); |
1308 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1309 |
const Vertex& C=__determinateNumber(vertexNum[1],pointsIntersection); |
const Vertex& C=__determinateNumber(vertexNum[1],pointsIntersection); |
1310 |
#warning Reference not set. |
//#warning Reference not set. |
1311 |
__addTriangle(Triangle(A,B,C),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
1312 |
} else { |
} else { |
1313 |
ffout(4) <<"pbs 10\n"<<std::flush; |
ffout(3) <<"pbs 10\n"<<std::flush; |
1314 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
1315 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
1316 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
1317 |
} |
} |
1318 |
} else { |
} else { |
1319 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1320 |
ffout(4)<<"pbs 11\n"<<std::flush; |
ffout(3)<<"pbs 11\n"<<std::flush; |
1321 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
1322 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
1323 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
1324 |
ffout(4)<<ncase<<"\n"; |
ffout(3)<<ncase<<"\n"; |
1325 |
ffout(4)<<__determinateNumber(vertexNum[1],pointsIntersection)<<"\n"; |
ffout(3)<<__determinateNumber(vertexNum[1],pointsIntersection)<<"\n"; |
1326 |
} else { |
} else { |
1327 |
ffout(4) <<"pbs 111\n"; |
ffout(3) <<"pbs 111\n"; |
1328 |
} |
} |
1329 |
} |
} |
1330 |
break; |
break; |
1336 |
const Vertex& B=__determinateNumber(vertexNum[0],pointsIntersection); |
const Vertex& B=__determinateNumber(vertexNum[0],pointsIntersection); |
1337 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1338 |
const Vertex& C=__determinateNumber(vertexNum[1],pointsIntersection); |
const Vertex& C=__determinateNumber(vertexNum[1],pointsIntersection); |
1339 |
#warning Reference not set. |
//#warning Reference not set. |
1340 |
__addTriangle(Triangle(A,B,D),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,D,K.reference()),cell,triangleListIntersectionNew); |
1341 |
__addTriangle(Triangle(A,D,C),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,D,C,K.reference()),cell,triangleListIntersectionNew); |
1342 |
} else { |
} else { |
1343 |
ffout(4)<<"-------- warning trou in 0\n"<<std::flush; |
ffout(3)<<"-------- warning trou in 0\n"<<std::flush; |
1344 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
1345 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
1346 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
1347 |
#warning Reference not set. |
//#warning Reference not set. |
1348 |
__addTriangle(Triangle(A,B,D),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,D,K.reference()),cell,triangleListIntersectionNew); |
1349 |
} |
} |
1350 |
} else { |
} else { |
1351 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1352 |
ffout(4)<<"-------- warning trou in\n"<<std::flush; |
ffout(3)<<"-------- warning trou in\n"<<std::flush; |
1353 |
const Vertex& B=__determinateNumber(vertexNum[1],pointsIntersection); |
const Vertex& B=__determinateNumber(vertexNum[1],pointsIntersection); |
1354 |
#warning Reference not set. |
//#warning Reference not set. |
1355 |
__addTriangle(Triangle(A,B,D),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,D,K.reference()),cell,triangleListIntersectionNew); |
1356 |
} else { |
} else { |
1357 |
ffout(4) <<"pbs 1\n"<<std::flush; |
ffout(3) <<"pbs 1\n"<<std::flush; |
1358 |
} |
} |
1359 |
} |
} |
1360 |
break; |
break; |
1361 |
} |
} |
1362 |
default: { |
default: { |
1363 |
#warning is it true? case where only one edge is cut? |
#warning is it true? case where only one edge is cut? |
1364 |
ffout(4) << numberPointsInterior<<" be careful 1\n"<<std::flush; |
ffout(3) << numberPointsInterior<<" be careful 1\n"<<std::flush; |
1365 |
//case 1 point inside and more than 1 point in the triangle |
//case 1 point inside and more than 1 point in the triangle |
1366 |
__createByEdges(K, cell, triangleListIntersectionNew); |
__createByEdges(K, cell, triangleListIntersectionNew); |
1367 |
} |
} |
1423 |
const Vertex& C=__determinateNumber(vertexNum[0],pointsIntersection); |
const Vertex& C=__determinateNumber(vertexNum[0],pointsIntersection); |
1424 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1425 |
const Vertex& D=__determinateNumber(vertexNum[1],pointsIntersection); |
const Vertex& D=__determinateNumber(vertexNum[1],pointsIntersection); |
1426 |
#warning Reference not set. |
//#warning Reference not set. |
1427 |
__addTriangle(Triangle(A,B,C),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
1428 |
__addTriangle(Triangle(C,B,D),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(C,B,D,K.reference()),cell,triangleListIntersectionNew); |
1429 |
} else { |
} else { |
1430 |
// ffout(4) <<"pbs 20\n"; |
// ffout(3) <<"pbs 20\n"; |
1431 |
#warning Reference not set. |
//#warning Reference not set. |
1432 |
__addTriangle(Triangle(A,B,C),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
1433 |
} |
} |
1434 |
} else { |
} else { |
1435 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1436 |
// ffout(4) <<"pbs 210\n"; |
// ffout(3) <<"pbs 210\n"; |
1437 |
const Vertex& C=__determinateNumber(vertexNum[1],pointsIntersection); |
const Vertex& C=__determinateNumber(vertexNum[1],pointsIntersection); |
1438 |
#warning Reference not set. |
//#warning Reference not set. |
1439 |
__addTriangle(Triangle(A,B,C),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
1440 |
} else { |
} else { |
1441 |
ffout(4) <<"pbs 21\n"<<std::flush; |
ffout(3) <<"pbs 21\n"<<std::flush; |
1442 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
1443 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
1444 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
1445 |
} |
} |
1446 |
} |
} |
1447 |
break; |
break; |
1454 |
const Vertex& C=__determinateNumber(vertexNum[0],pointsIntersection); |
const Vertex& C=__determinateNumber(vertexNum[0],pointsIntersection); |
1455 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1456 |
const Vertex& D=__determinateNumber(vertexNum[1],pointsIntersection); |
const Vertex& D=__determinateNumber(vertexNum[1],pointsIntersection); |
1457 |
#warning Reference not set. |
//#warning Reference not set. |
1458 |
__addTriangle(Triangle(A,C,E),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,C,E,K.reference()),cell,triangleListIntersectionNew); |
1459 |
__addTriangle(Triangle(A,E,B),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,E,B,K.reference()),cell,triangleListIntersectionNew); |
1460 |
__addTriangle(Triangle(B,E,D),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(B,E,D,K.reference()),cell,triangleListIntersectionNew); |
1461 |
} else { |
} else { |
1462 |
__addTriangle(Triangle(A,B,E),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,E,K.reference()),cell,triangleListIntersectionNew); |
1463 |
__addTriangle(Triangle(C,E,B),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(C,E,B,K.reference()),cell,triangleListIntersectionNew); |
1464 |
} |
} |
1465 |
} else { |
} else { |
1466 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1467 |
const Vertex& D=__determinateNumber(vertexNum[1],pointsIntersection); |
const Vertex& D=__determinateNumber(vertexNum[1],pointsIntersection); |
1468 |
#warning Reference not set. |
//#warning Reference not set. |
1469 |
__addTriangle(Triangle(D,E,B),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(D,E,B,K.reference()),cell,triangleListIntersectionNew); |
1470 |
__addTriangle(Triangle(A,B,E),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,E,K.reference()),cell,triangleListIntersectionNew); |
1471 |
} else { |
} else { |
1472 |
__addTriangle(Triangle(A,B,E),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,E,K.reference()),cell,triangleListIntersectionNew); |
1473 |
} |
} |
1474 |
} |
} |
1475 |
break; |
break; |
1476 |
} |
} |
1477 |
default: { |
default: { |
1478 |
//POUR STEPH : peut generer des tr plats |
//POUR STEPH : peut generer des tr plats |
1479 |
ffout(4) << numberPointsInterior <<"be careful 2\n"<<std::flush; |
ffout(3) << numberPointsInterior <<"be careful 2\n"<<std::flush; |
1480 |
// ffout(4)<<V0<<"\n"; |
// ffout(3)<<V0<<"\n"; |
1481 |
// ffout(4)<<V1<<"\n"; |
// ffout(3)<<V1<<"\n"; |
1482 |
// ffout(4)<<V2<<"\n"; |
// ffout(3)<<V2<<"\n"; |
1483 |
TinyVector<10,const Vertex*> P,Ptemp; |
TinyVector<10,const Vertex*> P,Ptemp; |
1484 |
size_t i=0; |
size_t i=0; |
1485 |
for(std::map<const Vertex*,const Vertex*>::const_iterator it=pointsInterior.begin(); |
for(std::map<const Vertex*,const Vertex*>::const_iterator it=pointsInterior.begin(); |
1494 |
|
|
1495 |
if(edgesCut[0]==1) { |
if(edgesCut[0]==1) { |
1496 |
const Vertex& C=__determinateNumber(vertexNum[0],pointsIntersection); |
const Vertex& C=__determinateNumber(vertexNum[0],pointsIntersection); |
1497 |
__addTriangle(Triangle(A,B,C),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
1498 |
P[0]=&C; |
P[0]=&C; |
1499 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1500 |
const Vertex& D=__determinateNumber(vertexNum[1],pointsIntersection); |
const Vertex& D=__determinateNumber(vertexNum[1],pointsIntersection); |
1512 |
Ptemp[i-1]=P[i]; |
Ptemp[i-1]=P[i]; |
1513 |
} |
} |
1514 |
} |
} |
1515 |
#warning Reference not set. |
//#warning Reference not set. |
1516 |
__addTriangle(Triangle(B,*P[0],*P[num]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(B,*P[0],*P[num],K.reference()),cell,triangleListIntersectionNew); |
1517 |
Ptemp[0]=P[num]; |
Ptemp[0]=P[num]; |
1518 |
P=Ptemp; |
P=Ptemp; |
1519 |
--size; |
--size; |
1520 |
// ffout(4)<<"size = "<<size<<"\n"; |
// ffout(3)<<"size = "<<size<<"\n"; |
1521 |
} |
} |
1522 |
#warning Reference not set. |
//#warning Reference not set. |
1523 |
__addTriangle(Triangle(B,*P[0],*P[1]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(B,*P[0],*P[1],K.reference()),cell,triangleListIntersectionNew); |
1524 |
__addTriangle(Triangle(B,*P[1],D),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(B,*P[1],D,K.reference()),cell,triangleListIntersectionNew); |
1525 |
//__addTriangle(A,B,D,cell); |
//__addTriangle(A,B,D,cell); |
1526 |
} else { |
} else { |
1527 |
ffout(4)<<"une seule arete cut pbs\n"; |
ffout(3)<<"une seule arete cut pbs\n"; |
1528 |
} |
} |
1529 |
} else { |
} else { |
1530 |
ffout(4)<<"une seule arete cut pbs2\n"; |
ffout(3)<<"une seule arete cut pbs2\n"; |
1531 |
} |
} |
1532 |
} |
} |
1533 |
} |
} |
1577 |
//detection tr plat |
//detection tr plat |
1578 |
size_t isDegenerate=0; |
size_t isDegenerate=0; |
1579 |
if(__isDegenerate(*(*jt0))) { |
if(__isDegenerate(*(*jt0))) { |
1580 |
// ffout(4)<<"degenerate triangle\n"; |
// ffout(3)<<"degenerate triangle\n"; |
1581 |
isDegenerate=1; |
isDegenerate=1; |
1582 |
} |
} |
1583 |
if(pairTriangleToIntersectionPoints[pairTriangle].size()==2 and isDegenerate==0) { |
if(pairTriangleToIntersectionPoints[pairTriangle].size()==2 and isDegenerate==0) { |
1585 |
const Vertex*& V1=pairTriangleToIntersectionPoints[pairTriangle][1]; |
const Vertex*& V1=pairTriangleToIntersectionPoints[pairTriangle][1]; |
1586 |
if((V0==&(*(*jt0))(0) or V0==&(*(*jt0))(1) or V0==&(*(*jt0))(2)) |
if((V0==&(*(*jt0))(0) or V0==&(*(*jt0))(1) or V0==&(*(*jt0))(2)) |
1587 |
and (V1==&(*(*jt0))(0) or V1==&(*(*jt0))(1) or V1==&(*(*jt0))(2))) { |
and (V1==&(*(*jt0))(0) or V1==&(*(*jt0))(1) or V1==&(*(*jt0))(2))) { |
1588 |
//ffout(4)<<"inter confondu avec arete\n"; |
//ffout(3)<<"inter confondu avec arete\n"; |
1589 |
isDegenerate=1; |
isDegenerate=1; |
1590 |
} |
} |
1591 |
} |
} |
1633 |
size_t r=0; |
size_t r=0; |
1634 |
size_t sum=cutTriangle[0]+cutTriangle[1]+cutTriangle[2]; |
size_t sum=cutTriangle[0]+cutTriangle[1]+cutTriangle[2]; |
1635 |
if(sum>3) { |
if(sum>3) { |
1636 |
ffout(4)<<"sum "<<sum<<"\n"<<std::flush; |
ffout(3)<<"sum "<<sum<<"\n"<<std::flush; |
1637 |
} |
} |
1638 |
|
|
1639 |
switch (sum) { |
switch (sum) { |
1658 |
break; |
break; |
1659 |
} |
} |
1660 |
default: { |
default: { |
1661 |
ffout(4) << "pbs sum = "<<sum<<" size " |
ffout(3) << "pbs sum = "<<sum<<" size " |
1662 |
<< pairTriangleToIntersectionPoints[pairTriangle].size()<<" \n"; |
<< pairTriangleToIntersectionPoints[pairTriangle].size()<<" \n"; |
1663 |
ffout(4) << K(0) << "\n"; |
ffout(3) << K(0) << "\n"; |
1664 |
ffout(4) << K(1) << "\n"; |
ffout(3) << K(1) << "\n"; |
1665 |
ffout(4) << K(2) << "\n"; |
ffout(3) << K(2) << "\n"; |
1666 |
ffout(4) << cutTriangle[0] << " " << cutTriangle[1] << " " << cutTriangle[2] << "\n"; |
ffout(3) << cutTriangle[0] << " " << cutTriangle[1] << " " << cutTriangle[2] << "\n"; |
1667 |
} |
} |
1668 |
} |
} |
1669 |
if(pointsInterior.find(pairTriangleToIntersectionPoints[pairTriangle][r]) |
if(pointsInterior.find(pairTriangleToIntersectionPoints[pairTriangle][r]) |
1673 |
} |
} |
1674 |
} |
} |
1675 |
} else { |
} else { |
1676 |
// ffout(4) <<"pasintersecte\n"; |
// ffout(3) <<"pasintersecte\n"; |
1677 |
} |
} |
1678 |
} |
} |
1679 |
} |
} |
1728 |
} |
} |
1729 |
} |
} |
1730 |
else { |
else { |
1731 |
// ffout(4)<<"la paire de triangle n'existe pas!\n"; |
// ffout(3)<<"la paire de triangle n'existe pas!\n"; |
1732 |
} |
} |
1733 |
} |
} |
1734 |
} |
} |
1749 |
const Vertex* V2=¤tTriangle(2); |
const Vertex* V2=¤tTriangle(2); |
1750 |
|
|
1751 |
|
|
1752 |
if(cutTriangle[0][0]+cutTriangle[1][0]+cutTriangle[2][0]!=0 and ((*edgesRefVertex[numobject])[V0]+ |
if(ncase==1 and |
1753 |
|
cutTriangle[0][0]+cutTriangle[1][0]+cutTriangle[2][0]!=0 and ((*edgesRefVertex[numobject])[V0]+ |
1754 |
(*edgesRefVertex[numobject])[V1]+(*edgesRefVertex[numobject])[V2])==6) { |
(*edgesRefVertex[numobject])[V1]+(*edgesRefVertex[numobject])[V2])==6) { |
1755 |
ffout(4)<<"************************ ---------tr a pbs\n"<<std::flush; |
ffout(3)<<"************************ ---------tr a pbs\n"<<std::flush; |
1756 |
ffout(4)<<cutTriangle[0]<<" "<<cutTriangle[1]<<" "<<cutTriangle[2]<<"\n"; |
ffout(3)<<cutTriangle[0]<<" "<<cutTriangle[1]<<" "<<cutTriangle[2]<<"\n"; |
1757 |
ffout(4)<<*V0<<"\n"; |
ffout(3)<<*V0<<"\n"; |
1758 |
ffout(4)<<*V1<<"\n"; |
ffout(3)<<*V1<<"\n"; |
1759 |
ffout(4)<<*V2<<"\n"; |
ffout(3)<<*V2<<"\n"; |
1760 |
} |
} else { |
|
|
|
1761 |
__inout(numobject,cutTriangle[0][0],V0,V1); |
__inout(numobject,cutTriangle[0][0],V0,V1); |
1762 |
__inout(numobject,cutTriangle[1][0],V0,V2); |
__inout(numobject,cutTriangle[1][0],V0,V2); |
1763 |
__inout(numobject,cutTriangle[2][0],V1,V2); |
__inout(numobject,cutTriangle[2][0],V1,V2); |
1764 |
|
} |
1765 |
|
|
1766 |
if(ncase==0) { |
if(ncase==0) { |
1767 |
if(cutTriangle[0][0]+cutTriangle[1][0]+cutTriangle[2][0]==0 and ((*edgesRefVertex[numobject])[V0]+ |
if(cutTriangle[0][0]+cutTriangle[1][0]+cutTriangle[2][0]==0 and ((*edgesRefVertex[numobject])[V0]+ |
1798 |
const Vertex& V2=K(2); |
const Vertex& V2=K(2); |
1799 |
|
|
1800 |
if(((edgesCut[0][0]+edgesCut[1][0]+edgesCut[2][0]==0 and isIn[0]+isIn[1]+isIn[2]==3) /*or isIn[0]+isIn[1]+isIn[2]==3*/)) { |
if(((edgesCut[0][0]+edgesCut[1][0]+edgesCut[2][0]==0 and isIn[0]+isIn[1]+isIn[2]==3) /*or isIn[0]+isIn[1]+isIn[2]==3*/)) { |
1801 |
#warning Reference not set. |
//#warning Reference not set. |
1802 |
__addTriangle(Triangle(V0,V1,V2),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(V0,V1,V2,K.reference()),cell,triangleListIntersectionNew); |
1803 |
} else { |
} else { |
1804 |
if(isIn[0]+isIn[1]+isIn[2]==1) { |
if(isIn[0]+isIn[1]+isIn[2]==1) { |
1805 |
if(isIn[0]==1) { |
if(isIn[0]==1) { |
1849 |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
1850 |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
1851 |
} else { |
} else { |
1852 |
ffout(4)<<"pbs 0 existe pas\n"; |
ffout(3)<<"pbs 0 existe pas\n"; |
1853 |
} |
} |
1854 |
|
|
1855 |
size_t b=0; |
size_t b=0; |
1859 |
TinyVector<2,const Vertex*> VV=(*triangleWithVertex.find(T[b])).second; |
TinyVector<2,const Vertex*> VV=(*triangleWithVertex.find(T[b])).second; |
1860 |
if(VV[0]==P[b]) { |
if(VV[0]==P[b]) { |
1861 |
if(Pend!=VV[1]) { |
if(Pend!=VV[1]) { |
1862 |
#warning Reference not set. |
//#warning Reference not set. |
1863 |
__addTriangle(Triangle(*Pend,*P[b],*VV[1]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(*Pend,*P[b],*VV[1],K.reference()),cell,triangleListIntersectionNew); |
1864 |
} |
} |
1865 |
P[b+1]=VV[1]; |
P[b+1]=VV[1]; |
1866 |
} else { |
} else { |
1867 |
if(Pend!=VV[0]) { |
if(Pend!=VV[0]) { |
1868 |
#warning Reference not set. |
//#warning Reference not set. |
1869 |
__addTriangle(Triangle(*Pend,*P[b],*VV[0]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(*Pend,*P[b],*VV[0],K.reference()),cell,triangleListIntersectionNew); |
1870 |
} |
} |
1871 |
P[b+1]=VV[0]; |
P[b+1]=VV[0]; |
1872 |
} |
} |
1873 |
} else { |
} else { |
1874 |
ffout(4)<<"pbs 1 existe pas\n"; |
ffout(3)<<"pbs 1 existe pas\n"; |
1875 |
} |
} |
1876 |
TinyVector<2,const Triangle*> T2; |
TinyVector<2,const Triangle*> T2; |
1877 |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
1904 |
place0=2; |
place0=2; |
1905 |
} |
} |
1906 |
|
|
1907 |
//ffout(4)<<"place = "<<place0<<"\n"; |
//ffout(3)<<"place = "<<place0<<"\n"; |
1908 |
const Vertex* Pend=K.pointsIntersection[place0][1]; |
const Vertex* Pend=K.pointsIntersection[place0][1]; |
1909 |
TinyVector<10,const Vertex*> P; |
TinyVector<10,const Vertex*> P; |
1910 |
TinyVector<10,const Triangle*> T; |
TinyVector<10,const Triangle*> T; |
1912 |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
1913 |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
1914 |
} else { |
} else { |
1915 |
ffout(4)<<"pbs 0 existe pas\n"; |
ffout(3)<<"pbs 0 existe pas\n"; |
1916 |
} |
} |
1917 |
|
|
1918 |
size_t b=0; |
size_t b=0; |
1919 |
while(P[b]!=Pend and b<9) { |
while(P[b]!=Pend and b<9) { |
1920 |
//ffout(4)<<"------------------- b "<<b<<"\n"; |
//ffout(3)<<"------------------- b "<<b<<"\n"; |
1921 |
if(triangleWithVertex.find(T[b])!=triangleWithVertex.end()) { |
if(triangleWithVertex.find(T[b])!=triangleWithVertex.end()) { |
1922 |
TinyVector<2,const Vertex*> VV=(*triangleWithVertex.find(T[b])).second; |
TinyVector<2,const Vertex*> VV=(*triangleWithVertex.find(T[b])).second; |
1923 |
if(VV[0]==P[b]) { |
if(VV[0]==P[b]) { |
1924 |
if(Pend!=VV[1]) { |
if(Pend!=VV[1]) { |
1925 |
#warning Reference not set. |
//#warning Reference not set. |
1926 |
__addTriangle(Triangle(*Pend,*P[b],*VV[1]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(*Pend,*P[b],*VV[1],K.reference()),cell,triangleListIntersectionNew); |
1927 |
// ffout(4)<<"1 "<<*Pend<<"\n"; |
// ffout(3)<<"1 "<<*Pend<<"\n"; |
1928 |
// ffout(4)<<*P[b]<<"\n"; |
// ffout(3)<<*P[b]<<"\n"; |
1929 |
// ffout(4)<<*VV[1]<<"\n"; |
// ffout(3)<<*VV[1]<<"\n"; |
1930 |
} |
} |
1931 |
P[b+1]=VV[1]; |
P[b+1]=VV[1]; |
1932 |
} else { |
} else { |
1933 |
if(Pend!=VV[0]) { |
if(Pend!=VV[0]) { |
1934 |
#warning Reference not set. |
//#warning Reference not set. |
1935 |
__addTriangle(Triangle(*Pend,*P[b],*VV[0]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(*Pend,*P[b],*VV[0],K.reference()),cell,triangleListIntersectionNew); |
1936 |
//ffout(4)<<"2 "<<*Pend<<"\n"; |
//ffout(3)<<"2 "<<*Pend<<"\n"; |
1937 |
//ffout(4)<<*P[b]<<"\n"; |
//ffout(3)<<*P[b]<<"\n"; |
1938 |
//ffout(4)<<*VV[0]<<"\n"; |
//ffout(3)<<*VV[0]<<"\n"; |
1939 |
} |
} |
1940 |
P[b+1]=VV[0]; |
P[b+1]=VV[0]; |
1941 |
} |
} |
1942 |
} else { |
} else { |
1943 |
ffout(4)<<"pbs 1 existe pas\n"; |
ffout(3)<<"pbs 1 existe pas\n"; |
1944 |
} |
} |
1945 |
|
|
1946 |
TinyVector<2,const Triangle*> T2; |
TinyVector<2,const Triangle*> T2; |
1948 |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
1949 |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
1950 |
} else { |
} else { |
1951 |
ffout(4)<<"points exisste pas \n"; |
ffout(3)<<"points exisste pas \n"; |
1952 |
} |
} |
1953 |
if(K.edgecut[0][0]==1 and K.edgecut[0][1]==1) { |
if(K.edgecut[0][0]==1 and K.edgecut[0][1]==1) { |
1954 |
if(P[b+1]==K.pointsIntersection[0][1] or P[b+1]==K.pointsIntersection[0][0]) { |
if(P[b+1]==K.pointsIntersection[0][1] or P[b+1]==K.pointsIntersection[0][0]) { |
1965 |
if(T2[0]==T[b]) { |
if(T2[0]==T[b]) { |
1966 |
if(T2[1]==T[b]) { |
if(T2[1]==T[b]) { |
1967 |
//point edge |
//point edge |
1968 |
//ffout(4)<<"here\n"; |
//ffout(3)<<"here\n"; |
1969 |
if(K.edgecut[0][0]==1 and K.edgecut[0][1]==1) { |
if(K.edgecut[0][0]==1 and K.edgecut[0][1]==1) { |
1970 |
//ffout(4)<<"here2\n"; |
//ffout(3)<<"here2\n"; |
1971 |
if(P[b+1]==K.pointsIntersection[0][1]) { |
if(P[b+1]==K.pointsIntersection[0][1]) { |
1972 |
#warning Reference not set. |
//#warning Reference not set. |
1973 |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[0][0]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[0][0], |
1974 |
|
K.reference()),cell,triangleListIntersectionNew); |
1975 |
P[b+1]=K.pointsIntersection[0][0]; |
P[b+1]=K.pointsIntersection[0][0]; |
1976 |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
1977 |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
1980 |
T[b+1]=T2[0]; |
T[b+1]=T2[0]; |
1981 |
} else |
} else |
1982 |
if(P[b+1]==K.pointsIntersection[0][0]){ |
if(P[b+1]==K.pointsIntersection[0][0]){ |
1983 |
#warning Reference not set. |
//#warning Reference not set. |
1984 |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[0][1]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[0][1], |
1985 |
|
K.reference()),cell,triangleListIntersectionNew); |
1986 |
P[b+1]=K.pointsIntersection[0][1]; |
P[b+1]=K.pointsIntersection[0][1]; |
1987 |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
1988 |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
1989 |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
1990 |
} else { |
} else { |
1991 |
ffout(4)<<"le tr e pas\n"; |
ffout(3)<<"le tr e pas\n"; |
1992 |
} |
} |
1993 |
T[b+1]=T2[0]; |
T[b+1]=T2[0]; |
1994 |
} else |
} else |
1995 |
if(P[b+1]!=Pend) { |
if(P[b+1]!=Pend) { |
1996 |
ffout(4)<<"point pas sur edge trou???? \n"; |
ffout(3)<<"point pas sur edge trou???? \n"; |
1997 |
ffout(4)<<*P[b+1]<<"\n"; |
ffout(3)<<*P[b+1]<<"\n"; |
1998 |
ffout(4)<<*Pend<<"\n"; |
ffout(3)<<*Pend<<"\n"; |
1999 |
P[b+1]=Pend; |
P[b+1]=Pend; |
2000 |
} |
} |
2001 |
} else { |
} else { |
2002 |
if(K.edgecut[2][0]==1 and K.edgecut[2][1]==1) { |
if(K.edgecut[2][0]==1 and K.edgecut[2][1]==1) { |
2003 |
//ffout(4)<<"here3\n"; |
//ffout(3)<<"here3\n"; |
2004 |
if(P[b+1]==K.pointsIntersection[2][1]) { |
if(P[b+1]==K.pointsIntersection[2][1]) { |
2005 |
#warning Reference not set. |
//#warning Reference not set. |
2006 |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[2][0]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[2][0], |
2007 |
|
K.reference()),cell,triangleListIntersectionNew); |
2008 |
P[b+1]=K.pointsIntersection[2][0]; |
P[b+1]=K.pointsIntersection[2][0]; |
2009 |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
2010 |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
2013 |
T[b+1]=T2[0]; |
T[b+1]=T2[0]; |
2014 |
} else { |
} else { |
2015 |
if(P[b+1]==K.pointsIntersection[2][0]){ |
if(P[b+1]==K.pointsIntersection[2][0]){ |
2016 |
#warning Reference not set. |
//#warning Reference not set. |
2017 |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[2][1]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[2][1], |
2018 |
|
K.reference()),cell,triangleListIntersectionNew); |
2019 |
P[b+1]=K.pointsIntersection[2][1]; |
P[b+1]=K.pointsIntersection[2][1]; |
2020 |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
2021 |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
2025 |
} |
} |
2026 |
} |
} |
2027 |
} else { |
} else { |
2028 |
ffout(4)<<"pas trouve l'egde et le point\n"; |
ffout(3)<<"pas trouve l'egde et le point\n"; |
2029 |
} |
} |
2030 |
} |
} |
2031 |
} else { |
} else { |
2067 |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
2068 |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
2069 |
} else { |
} else { |
2070 |
ffout(4)<<"pbs 0 existe pas\n"; |
ffout(3)<<"pbs 0 existe pas\n"; |
2071 |
} |
} |
2072 |
|
|
2073 |
size_t b=0; |
size_t b=0; |
2076 |
TinyVector<2,const Vertex*> VV=(*triangleWithVertex.find(T[b])).second; |
TinyVector<2,const Vertex*> VV=(*triangleWithVertex.find(T[b])).second; |
2077 |
if(VV[0]==P[b]) { |
if(VV[0]==P[b]) { |
2078 |
if(VV[1]==P[b]) { |
if(VV[1]==P[b]) { |
2079 |
ffout(4)<<"egal\n"; |
ffout(3)<<"egal\n"; |
2080 |
if(K.pointsIntersection[place2][0]==P[b]) { |
if(K.pointsIntersection[place2][0]==P[b]) { |
2081 |
P[b+1]=K.pointsIntersection[place2][1]; |
P[b+1]=K.pointsIntersection[place2][1]; |
2082 |
#warning Reference not set. |
//#warning Reference not set. |
2083 |
__addTriangle(Triangle(K(in0),*P[b],*P[b+1]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(K(in0),*P[b],*P[b+1],K.reference()),cell,triangleListIntersectionNew); |
2084 |
} else { |
} else { |
2085 |
if(K.pointsIntersection[place2][1]==P[b]){ |
if(K.pointsIntersection[place2][1]==P[b]){ |
2086 |
P[b+1]=K.pointsIntersection[place2][0]; |
P[b+1]=K.pointsIntersection[place2][0]; |
2087 |
#warning Reference not set. |
//#warning Reference not set. |
2088 |
__addTriangle(Triangle(K(in0),*P[b],*P[b+1]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(K(in0),*P[b],*P[b+1],K.reference()),cell,triangleListIntersectionNew); |
2089 |
} else { |
} else { |
2090 |
ffout(4)<<"pbs pbs\n"; |
ffout(3)<<"pbs pbs\n"; |
2091 |
ffout(4)<<*P[b]<<"\n"; |
ffout(3)<<*P[b]<<"\n"; |
2092 |
std::exit(0); |
std::exit(0); |
2093 |
} |
} |
2094 |
} |
} |
2095 |
} else { |
} else { |
2096 |
#warning Reference not set. |
//#warning Reference not set. |
2097 |
__addTriangle(Triangle(K(in0),*P[b],*VV[1]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(K(in0),*P[b],*VV[1],K.reference()),cell,triangleListIntersectionNew); |
2098 |
P[b+1]=VV[1]; |
P[b+1]=VV[1]; |
2099 |
} |
} |
2100 |
} else { |
} else { |
2101 |
#warning Reference not set. |
//#warning Reference not set. |
2102 |
__addTriangle(Triangle(K(in0),*P[b],*VV[0]),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(K(in0),*P[b],*VV[0],K.reference()),cell,triangleListIntersectionNew); |
2103 |
P[b+1]=VV[0]; |
P[b+1]=VV[0]; |
2104 |
} |
} |
2105 |
} else { |
} else { |
2106 |
ffout(4)<<"pbs 1 existe pas\n"; |
ffout(3)<<"pbs 1 existe pas\n"; |
2107 |
} |
} |
2108 |
TinyVector<2,const Triangle*> T2; |
TinyVector<2,const Triangle*> T2; |
2109 |
|
|
2111 |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
2112 |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
2113 |
} else { |
} else { |
2114 |
ffout(4)<<"pbs tr existe pas\n"; |
ffout(3)<<"pbs tr existe pas\n"; |
2115 |
} |
} |
2116 |
|
|
2117 |
if(T2[0]==T[b] and T2[1]==T[b]) { |
if(T2[0]==T[b] and T2[1]==T[b]) { |
2118 |
// ffout(4)<<"here0\n"; |
// ffout(3)<<"here0\n"; |
2119 |
//point edge |
//point edge |
2120 |
if(P[b+1]!=Pend) { |
if(P[b+1]!=Pend) { |
2121 |
if(K.pointsIntersection[place2][0]==P[b+1]) { |
if(K.pointsIntersection[place2][0]==P[b+1]) { |
2122 |
const Vertex* A=K.pointsIntersection[place2][1]; |
const Vertex* A=K.pointsIntersection[place2][1]; |
2123 |
#warning Reference not set. |
//#warning Reference not set. |
2124 |
__addTriangle(Triangle(K(in0),*P[b+1],*A),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(K(in0),*P[b+1],*A,K.reference()),cell,triangleListIntersectionNew); |
2125 |
if(vertexInTriangles.find(A)!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(A)!=vertexInTriangles.end()) { |
2126 |
T[b+1]=(*vertexInTriangles.find(A)).second[0]; |
T[b+1]=(*vertexInTriangles.find(A)).second[0]; |
2127 |
P[b+1]=A; |
P[b+1]=A; |
2128 |
} |
} |
2129 |
} else { |
} else { |
2130 |
const Vertex* A=K.pointsIntersection[place2][0]; |
const Vertex* A=K.pointsIntersection[place2][0]; |
2131 |
#warning Reference not set. |
//#warning Reference not set. |
2132 |
__addTriangle(Triangle(K(in0),*P[b+1],*A),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(K(in0),*P[b+1],*A,K.reference()),cell,triangleListIntersectionNew); |
2133 |
if(vertexInTriangles.find(A)!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(A)!=vertexInTriangles.end()) { |
2134 |
T[b+1]=(*vertexInTriangles.find(A)).second[0]; |
T[b+1]=(*vertexInTriangles.find(A)).second[0]; |
2135 |
P[b+1]=A; |
P[b+1]=A; |
2147 |
} |
} |
2148 |
} |
} |
2149 |
|
|
2150 |
|
void SurfaceMeshGenerator::Internals::__3pointsintersection(const TriangleCut& K,const Cell* cell, |
2151 |
|
std::vector<Triangle>& triangleListIntersectionNew) |
2152 |
|
{ |
2153 |
|
TinyVector<3,const Vertex*> V; |
2154 |
|
size_t num=0; |
2155 |
|
for(std::map<const Vertex*,TinyVector<2,const Triangle*> >::iterator |
2156 |
|
it=vertexInTriangles.begin() ; it!=vertexInTriangles.end() ; ++it , ++num) { |
2157 |
|
V[num]=(*it).first; |
2158 |
|
} |
2159 |
|
if(V[0]!=V[1] and V[1]!=V[2] and V[2]!=V[0]) { |
2160 |
|
__addTriangle(Triangle(*V[0],*V[1],*V[2],K.reference()),cell,triangleListIntersectionNew); |
2161 |
|
ffout(3)<<"on comble le trou\n"<<std::flush; |
2162 |
|
} else { |
2163 |
|
ffout(3)<<"----- deux inter =\n"; |
2164 |
|
ffout(3)<<V[0]<<"\n"; |
2165 |
|
ffout(3)<<V[1]<<"\n"; |
2166 |
|
ffout(3)<<V[2]<<"\n"; |
2167 |
|
} |
2168 |
|
} |
2169 |
template <typename booleanTest> |
template <typename booleanTest> |
2170 |
void SurfaceMeshGenerator::Internals:: |
void SurfaceMeshGenerator::Internals:: |
2171 |
__createTrianglesIntersection(const size_t numobject, |
__createTrianglesIntersection(const size_t numobject, |
2177 |
{ |
{ |
2178 |
//build mesh of object O1 (which is intersected with O2) |
//build mesh of object O1 (which is intersected with O2) |
2179 |
|
|
2180 |
//ffout(4)<<"numero "<<numobject<<" "<<objectNumber<<"\n"<<std::flush; |
//ffout(3)<<"numero "<<numobject<<" "<<objectNumber<<"\n"<<std::flush; |
2181 |
size_t objectNumber=0; |
size_t objectNumber=0; |
2182 |
if(numobject==0) |
if(numobject==0) |
2183 |
objectNumber=1; |
objectNumber=1; |
2231 |
} |
} |
2232 |
|
|
2233 |
size_t nbinters=listVertexIntersectionNew.size(); |
size_t nbinters=listVertexIntersectionNew.size(); |
2234 |
ffout(4)<<"size listVertexIntersectionNew "<<nbinters<<"\n"<<std::flush; |
ffout(3)<<"size listVertexIntersectionNew "<<nbinters<<"\n"<<std::flush; |
2235 |
|
|
2236 |
size_t dd_max=4;//4 |
size_t dd_max=4;//4 |
2237 |
//ffout(4)<<"size liste intersection "<<taille<<"\n"<<std::flush; |
//ffout(3)<<"size liste intersection "<<taille<<"\n"<<std::flush; |
2238 |
for(size_t dd=0 ; dd<dd_max ; ++dd) { |
for(size_t dd=0 ; dd<dd_max ; ++dd) { |
2239 |
ffout(4)<<"num passage "<<dd<<"\n"<<std::flush; |
ffout(3)<<"num passage "<<dd<<"\n"<<std::flush; |
2240 |
for(std::set<const Cell*>::iterator i=toTreatHexahedra.begin() ; i!=toTreatHexahedra.end() ; ++i) |
for(std::set<const Cell*>::iterator i=toTreatHexahedra.begin() ; i!=toTreatHexahedra.end() ; ++i) |
2241 |
{ |
{ |
2242 |
MapCellTriangle::iterator it0=hexaToTriangle0.find(*i); |
MapCellTriangle::iterator it0=hexaToTriangle0.find(*i); |
2261 |
for(std::set<const Cell*>::iterator i=toTreatHexahedra.begin(); |
for(std::set<const Cell*>::iterator i=toTreatHexahedra.begin(); |
2262 |
i!=toTreatHexahedra.end() ; ++i) { |
i!=toTreatHexahedra.end() ; ++i) { |
2263 |
MapCellTriangle::iterator it0=hexaToTriangle0.find(*i); |
MapCellTriangle::iterator it0=hexaToTriangle0.find(*i); |
2264 |
|
|
2265 |
if(it0!=hexaToTriangle0.end()) { |
if(it0!=hexaToTriangle0.end()) { |
2266 |
std::list<Triangle*> listTriangle0=(*it0).second; |
std::list<Triangle*> listTriangle0=(*it0).second; |
2267 |
for(std::list<Triangle*>::iterator jt0=listTriangle0.begin() ; |
for(std::list<Triangle*>::iterator jt0=listTriangle0.begin() ; |
2271 |
const Vertex& V1 = (*T)(1); |
const Vertex& V1 = (*T)(1); |
2272 |
const Vertex& V2 = (*T)(2); |
const Vertex& V2 = (*T)(2); |
2273 |
TriangleCut K(V0,V1,V2,numobject,objectNumber); |
TriangleCut K(V0,V1,V2,numobject,objectNumber); |
2274 |
|
K.reference()=(*T).reference(); |
2275 |
triangleWithVertex.clear(); |
triangleWithVertex.clear(); |
2276 |
vertexInTriangles.clear(); |
vertexInTriangles.clear(); |
2277 |
|
|
2278 |
__createLocalListIntersection(objectNumber,O2,T,K,*i); |
__createLocalListIntersection(objectNumber,O2,T,K,*i); |
2279 |
|
|
2280 |
__putEdgeRef(1,*T,K); |
__putEdgeRef(1,*T,K); |
2281 |
|
|
2282 |
// K.isInTriangle[i] vaut 1 si le point est a garder pour construire le maillage 0 sinon. |
|
2283 |
// K.edgecut[i] vaut 1 si l'arete est coupee |
///////////////////////creation des triangles////////////////////////////// |
2284 |
if(K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]==0 |
size_t numberVertexInDomain=K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]; |
2285 |
and K.edgecut[0]+K.edgecut[1]+K.edgecut[2]==3 and vertexInTriangles.size()<3) { |
switch (numberVertexInDomain) { |
2286 |
// K is outside but the 3 edges are cut "and there are less than 3 points in K" |
case 0: { |
2287 |
|
if(K.edgecut[0]+K.edgecut[1]+K.edgecut[2]==3 and vertexInTriangles.size()<3) { |
2288 |
// On ne peut normalement pas se trouver ICI. |
ffout(3)<<"tous les points d'inter ne sont pas dans la liste\n"; |
2289 |
ffout(4)<<"tous les points d'inter ne sont pas dans la liste\n"; |
__casePinterNotInList(K,*i, triangleListIntersectionNew); |
2290 |
__casePinterNotInList(K,*i, triangleListIntersectionNew); |
std::exit(1); |
2291 |
std::exit(1); |
} else if(K.edgecut[0]+K.edgecut[1]+K.edgecut[2]!=0) { |
2292 |
} |
if(vertexInTriangles.size()==3) { |
2293 |
|
//there are 3 points intersection so we create a triangle |
2294 |
if(K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]==0 |
__3pointsintersection(K,*i,triangleListIntersectionNew); |
|
and K.edgecut[0]+K.edgecut[1]+K.edgecut[2]!=0) { |
|
|
//K is outside |
|
|
if(vertexInTriangles.size()==3) { |
|
|
//there are 3 points intersection |
|
|
TinyVector<3,const Vertex*> V; |
|
|
size_t num=0; |
|
|
for(std::map<const Vertex*,TinyVector<2,const Triangle*> >::iterator |
|
|
it=vertexInTriangles.begin() ; it!=vertexInTriangles.end() ; ++it , ++num) { |
|
|
V[num]=(*it).first; |
|
|
} |
|
|
if(V[0]!=V[1] and V[1]!=V[2] and V[2]!=V[0]) { |
|
|
#warning Reference not set. |
|
|
__addTriangle(Triangle(*V[0],*V[1],*V[2]),*i,triangleListIntersectionNew); |
|
|
ffout(4)<<"on comble le trou\n"<<std::flush; |
|
|
} else { |
|
|
ffout(4)<<"----- deux inter =\n"; |
|
|
ffout(4)<<V[0]<<"\n"; |
|
|
ffout(4)<<V[1]<<"\n"; |
|
|
ffout(4)<<V[2]<<"\n"; |
|
|
} |
|
|
} else { |
|
|
if(vertexInTriangles.size()>3 and |
|
|
K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==1){ |
|
|
//one edge cut but twice |
|
|
ffout(4)<<"createNotIn\n"; |
|
|
//POUR STEPH : createNotIn peut generer des tr plats |
|
|
__createNotIn(K,*i, triangleListIntersectionNew); |
|
2295 |
} else { |
} else { |
2296 |
if(vertexInTriangles.size()>3 and |
size_t numberEdgesCut=K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]; |
2297 |
K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==2) { |
if(vertexInTriangles.size()>3 and numberEdgesCut==1){ |
2298 |
//two edge cut but twice |
//one edge cut but twice |
2299 |
ffout(4)<<"createNotIn2\n"; |
ffout(3)<<"createNotIn\n"; |
2300 |
__createNotIn2(K,*i, triangleListIntersectionNew); |
//POUR STEPH : createNotIn peut generer des tr plats |
2301 |
|
__createNotIn(K,*i, triangleListIntersectionNew); |
2302 |
} else { |
} else { |
2303 |
if(K.edgecut[0]!=0) { |
if(vertexInTriangles.size()>3 and numberEdgesCut==2) { |
2304 |
if(K.pointsIntersection[0][0]==&V0 |
//two edge cut but twice |
2305 |
or K.pointsIntersection[0][0]==&V1 |
ffout(3)<<"createNotIn2\n"; |
2306 |
or K.pointsIntersection[0][0]==&V2 or vertexInTriangles.size()==1) { |
__createNotIn2(K,*i, triangleListIntersectionNew); |
2307 |
// ffout(4)<<"**********normal\n"; |
} else { |
2308 |
} else { |
if(K.edgecut[0]!=0) { |
2309 |
if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3 |
if(K.pointsIntersection[0][0]==&V0 |
2310 |
and K.edgecut[0][1]+K.edgecut[1][1]+K.edgecut[2][1]==3) { |
or K.pointsIntersection[0][0]==&V1 |
2311 |
if(K.pointsIntersection[0][1]==K.pointsIntersection[0][0]) { |
or K.pointsIntersection[0][0]==&V2 or vertexInTriangles.size()==1) { |
2312 |
K.edgecut[0][0]=0; |
// ffout(3)<<"**********normal\n"; |
2313 |
K.edgecut[0][1]=0; |
} else { |
2314 |
} |
if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3 |
2315 |
if(K.pointsIntersection[1][1]==K.pointsIntersection[1][0]) { |
and K.edgecut[0][1]+K.edgecut[1][1]+K.edgecut[2][1]==3) { |
2316 |
K.edgecut[1][0]=0; |
if(K.pointsIntersection[0][1]==K.pointsIntersection[0][0]) { |
2317 |
K.edgecut[1][1]=0; |
K.edgecut[0][0]=0; |
2318 |
} |
K.edgecut[0][1]=0; |
2319 |
if(K.pointsIntersection[2][1]==K.pointsIntersection[2][0]) { |
} |
2320 |
K.edgecut[2][0]=0; |
if(K.pointsIntersection[1][1]==K.pointsIntersection[1][0]) { |
2321 |
K.edgecut[2][1]=0; |
K.edgecut[1][0]=0; |
2322 |
} |
K.edgecut[1][1]=0; |
2323 |
if(vertexInTriangles.size()>3 and |
} |
2324 |
K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==2){ |
if(K.pointsIntersection[2][1]==K.pointsIntersection[2][0]) { |
2325 |
ffout(4)<<"hhhhhhhh\n"; |
K.edgecut[2][0]=0; |
2326 |
__createNotIn2(K,*i,triangleListIntersectionNew); |
K.edgecut[2][1]=0; |
2327 |
} else { |
} |
2328 |
if(vertexInTriangles.size()>3 and |
if(vertexInTriangles.size()>3 and |
2329 |
K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==1) { |
K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==2){ |
2330 |
ffout(4)<<"case\n"; |
ffout(3)<<"hhhhhhhh\n"; |
2331 |
__createNotIn(K,*i,triangleListIntersectionNew); |
ffout(3)<<K(0)<<"\n"; |
2332 |
|
ffout(3)<<K(1)<<"\n"; |
2333 |
|
ffout(3)<<K(2)<<"\n"; |
2334 |
|
__createNotIn2(K,*i,triangleListIntersectionNew); |
2335 |
|
} else { |
2336 |
|
if(vertexInTriangles.size()>3 and |
2337 |
|
K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==1) { |
2338 |
|
ffout(3)<<"case\n"; |
2339 |
|
__createNotIn(K,*i,triangleListIntersectionNew); |
2340 |
|
} |
2341 |
|
} |
2342 |
|
} else { |
2343 |
|
if(vertexInTriangles.size()>=3) { |
2344 |
|
ffout(3)<<"triangle cut but outside1\n"; |
2345 |
|
ffout(3)<<V0<<"\n"; |
2346 |
|
ffout(3)<<V1<<"\n"; |
2347 |
|
ffout(3)<<V2<<"\n"; |
2348 |
|
ffout(3)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
2349 |
} |
} |
|
} |
|
|
} else { |
|
|
if(vertexInTriangles.size()>=3) { |
|
|
ffout(4)<<"triangle cut but outside1\n"; |
|
|
ffout(4)<<V0<<"\n"; |
|
|
ffout(4)<<V1<<"\n"; |
|
|
ffout(4)<<V2<<"\n"; |
|
|
ffout(4)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
|
2350 |
} |
} |
2351 |
} |
} |
|
} |
|
|
} else { |
|
|
if(K.edgecut[1]!=0) { |
|
|
if(K.pointsIntersection[1][0]==&V0 |
|
|
or K.pointsIntersection[1][0]==&V1 |
|
|
or K.pointsIntersection[1][0]==&V2 or vertexInTriangles.size()<3) { |
|
|
// ffout(4)<<"**********normal\n"; |
|
|
} else { |
|
|
ffout(4)<<"triangle cut but outside2\n"; |
|
|
ffout(4)<<V0<<"\n"; |
|
|
ffout(4)<<V1<<"\n"; |
|
|
ffout(4)<<V2<<"\n"; |
|
|
ffout(4)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
|
|
} |
|
2352 |
} else { |
} else { |
2353 |
if(K.edgecut[2]!=0) { |
if(K.edgecut[1]!=0) { |
2354 |
if(K.pointsIntersection[2][0]==&V0 |
if(K.pointsIntersection[1][0]==&V0 |
2355 |
or K.pointsIntersection[2][0]==&V1 |
or K.pointsIntersection[1][0]==&V1 |
2356 |
or K.pointsIntersection[2][0]==&V2 or vertexInTriangles.size()<3) { |
or K.pointsIntersection[1][0]==&V2 or vertexInTriangles.size()<3) { |
2357 |
//ffout(4)<<"**********normal\n"; |
// ffout(3)<<"**********normal\n"; |
2358 |
} else { |
} else { |
2359 |
ffout(4)<<"triangle cut but outside3\n"; |
ffout(3)<<"triangle cut but outside2\n"; |
2360 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
2361 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
2362 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
2363 |
ffout(4)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
ffout(3)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
2364 |
|
} |
2365 |
|
} else { |
2366 |
|
if(K.edgecut[2]!=0) { |
2367 |
|
if(K.pointsIntersection[2][0]==&V0 |
2368 |
|
or K.pointsIntersection[2][0]==&V1 |
2369 |
|
or K.pointsIntersection[2][0]==&V2 or vertexInTriangles.size()<3) { |
2370 |
|
//ffout(3)<<"**********normal\n"; |
2371 |
|
} else { |
2372 |
|
ffout(3)<<"triangle cut but outside3\n"; |
2373 |
|
ffout(3)<<V0<<"\n"; |
2374 |
|
ffout(3)<<V1<<"\n"; |
2375 |
|
ffout(3)<<V2<<"\n"; |
2376 |
|
ffout(3)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
2377 |
|
} |
2378 |
} |
} |
2379 |
} |
} |
2380 |
} |
} |
2381 |
} |
} |
2382 |
} |
} |
2383 |
|
} |
2384 |
|
} |
2385 |
|
break; |
2386 |
|
} |
2387 |
|
case 1: { |
2388 |
|
if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3) { |
2389 |
|
if(K.pointsIntersection[0][0]!=K.pointsIntersection[1][0] |
2390 |
|
and K.pointsIntersection[1][0]!=K.pointsIntersection[2][0] |
2391 |
|
and K.pointsIntersection[2][0]!=K.pointsIntersection[0][0]) { |
2392 |
|
ffout(3)<<"---------------- 3 edge cut \n"; |
2393 |
|
__createByEdges(K,*i,triangleListIntersectionNew); |
2394 |
|
} else { |
2395 |
|
__createListTriangle(K,*i,triangleListIntersectionNew); |
2396 |
} |
} |
|
} |
|
|
} |
|
|
if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3 |
|
|
and K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]==1) { |
|
|
if(K.pointsIntersection[0][0]!=K.pointsIntersection[1][0] |
|
|
and K.pointsIntersection[1][0]!=K.pointsIntersection[2][0] |
|
|
and K.pointsIntersection[2][0]!=K.pointsIntersection[0][0]) { |
|
|
ffout(4)<<"---------------- 3 edge cut \n"; |
|
|
__createByEdges(K,*i,triangleListIntersectionNew); |
|
|
} else { |
|
|
__createListTriangle(K,*i,triangleListIntersectionNew); |
|
|
} |
|
|
} else { |
|
|
if(nbinters!=0) { |
|
|
__createListTriangle(K,*i,triangleListIntersectionNew); |
|
2397 |
} else { |
} else { |
2398 |
//ffout(4)<<"j ajoute le tr car pas d'intersection dans les 2 listes\n"; |
__createListTriangle(K,*i,triangleListIntersectionNew); |
|
#warning Reference not set. |
|
|
__addTriangle(Triangle(V0,V1,V2),*i,triangleListIntersectionNew); |
|
2399 |
} |
} |
2400 |
|
break; |
2401 |
} |
} |
2402 |
} |
case 2: { |
2403 |
|
__createListTriangle(K,*i,triangleListIntersectionNew); |
2404 |
|
break; |
2405 |
|
} |
2406 |
|
case 3: { |
2407 |
|
if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==0) { |
2408 |
|
__addTriangle(*T,*i,triangleListIntersectionNew); |
2409 |
|
} else { |
2410 |
|
if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3) { |
2411 |
|
ffout(3)<<"cas a traiter-------------\n"; |
2412 |
|
} else { |
2413 |
|
ffout(3)<<"cas pas traite\n"; |
2414 |
|
} |
2415 |
|
} |
2416 |
|
break; |
2417 |
|
} |
2418 |
|
} |
2419 |
|
|
2420 |
|
////////////////////////////////////////////////////////////////////////// |
2421 |
|
// // K.isInTriangle[i] vaut 1 si le point est a garder pour construire le maillage 0 sinon. |
2422 |
|
// // K.edgecut[i] vaut 1 si l'arete est coupee |
2423 |
|
// if(K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]==0 |
2424 |
|
// and K.edgecut[0]+K.edgecut[1]+K.edgecut[2]==3 and vertexInTriangles.size()<3) { |
2425 |
|
// // K is outside but the 3 edges are cut "and there are less than 3 points in K" |
2426 |
|
// |
2427 |
|
// // On ne peut normalement pas se trouver ICI. |
2428 |
|
// ffout(3)<<"tous les points d'inter ne sont pas dans la liste\n"; |
2429 |
|
// __casePinterNotInList(K,*i, triangleListIntersectionNew); |
2430 |
|
// std::exit(1); |
2431 |
|
// } |
2432 |
|
// |
2433 |
|
// if(K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]==0 |
2434 |
|
// and K.edgecut[0]+K.edgecut[1]+K.edgecut[2]!=0) { |
2435 |
|
// //K is outside |
2436 |
|
// if(vertexInTriangles.size()==3) { |
2437 |
|
// //there are 3 points intersection |
2438 |
|
// TinyVector<3,const Vertex*> V; |
2439 |
|
// size_t num=0; |
2440 |
|
// for(std::map<const Vertex*,TinyVector<2,const Triangle*> >::iterator |
2441 |
|
// it=vertexInTriangles.begin() ; it!=vertexInTriangles.end() ; ++it , ++num) { |
2442 |
|
// V[num]=(*it).first; |
2443 |
|
// } |
2444 |
|
// if(V[0]!=V[1] and V[1]!=V[2] and V[2]!=V[0]) { |
2445 |
|
//#warning Reference not set. |
2446 |
|
// __addTriangle(Triangle(*V[0],*V[1],*V[2],(*T).reference()),*i,triangleListIntersectionNew); |
2447 |
|
// ffout(3)<<"on comble le trou\n"<<std::flush; |
2448 |
|
// } else { |
2449 |
|
// ffout(3)<<"----- deux inter =\n"; |
2450 |
|
// ffout(3)<<V[0]<<"\n"; |
2451 |
|
// ffout(3)<<V[1]<<"\n"; |
2452 |
|
// ffout(3)<<V[2]<<"\n"; |
2453 |
|
// } |
2454 |
|
// } else { |
2455 |
|
// if(vertexInTriangles.size()>3 and |
2456 |
|
// K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==1){ |
2457 |
|
// //one edge cut but twice |
2458 |
|
// ffout(3)<<"createNotIn\n"; |
2459 |
|
// //POUR STEPH : createNotIn peut generer des tr plats |
2460 |
|
// __createNotIn(K,*i, triangleListIntersectionNew); |
2461 |
|
// } else { |
2462 |
|
// if(vertexInTriangles.size()>3 and |
2463 |
|
// K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==2) { |
2464 |
|
// //two edge cut but twice |
2465 |
|
// ffout(3)<<"createNotIn2\n"; |
2466 |
|
// __createNotIn2(K,*i, triangleListIntersectionNew); |
2467 |
|
// } else { |
2468 |
|
// if(K.edgecut[0]!=0) { |
2469 |
|
// if(K.pointsIntersection[0][0]==&V0 |
2470 |
|
// or K.pointsIntersection[0][0]==&V1 |
2471 |
|
// or K.pointsIntersection[0][0]==&V2 or vertexInTriangles.size()==1) { |
2472 |
|
// // ffout(3)<<"**********normal\n"; |
2473 |
|
// } else { |
2474 |
|
// if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3 |
2475 |
|
// and K.edgecut[0][1]+K.edgecut[1][1]+K.edgecut[2][1]==3) { |
2476 |
|
// if(K.pointsIntersection[0][1]==K.pointsIntersection[0][0]) { |
2477 |
|
// K.edgecut[0][0]=0; |
2478 |
|
// K.edgecut[0][1]=0; |
2479 |
|
// } |
2480 |
|
// if(K.pointsIntersection[1][1]==K.pointsIntersection[1][0]) { |
2481 |
|
// K.edgecut[1][0]=0; |
2482 |
|
// K.edgecut[1][1]=0; |
2483 |
|
// } |
2484 |
|
// if(K.pointsIntersection[2][1]==K.pointsIntersection[2][0]) { |
2485 |
|
// K.edgecut[2][0]=0; |
2486 |
|
// K.edgecut[2][1]=0; |
2487 |
|
// } |
2488 |
|
// if(vertexInTriangles.size()>3 and |
2489 |
|
// K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==2){ |
2490 |
|
// ffout(3)<<"hhhhhhhh\n"; |
2491 |
|
// __createNotIn2(K,*i,triangleListIntersectionNew); |
2492 |
|
// } else { |
2493 |
|
// if(vertexInTriangles.size()>3 and |
2494 |
|
// K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==1) { |
2495 |
|
// ffout(3)<<"case\n"; |
2496 |
|
// __createNotIn(K,*i,triangleListIntersectionNew); |
2497 |
|
// } |
2498 |
|
// } |
2499 |
|
// } else { |
2500 |
|
// if(vertexInTriangles.size()>=3) { |
2501 |
|
// ffout(3)<<"triangle cut but outside1\n"; |
2502 |
|
// ffout(3)<<V0<<"\n"; |
2503 |
|
// ffout(3)<<V1<<"\n"; |
2504 |
|
// ffout(3)<<V2<<"\n"; |
2505 |
|
// ffout(3)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
2506 |
|
// } |
2507 |
|
// } |
2508 |
|
// } |
2509 |
|
// } else { |
2510 |
|
// if(K.edgecut[1]!=0) { |
2511 |
|
// if(K.pointsIntersection[1][0]==&V0 |
2512 |
|
// or K.pointsIntersection[1][0]==&V1 |
2513 |
|
// or K.pointsIntersection[1][0]==&V2 or vertexInTriangles.size()<3) { |
2514 |
|
// // ffout(3)<<"**********normal\n"; |
2515 |
|
// } else { |
2516 |
|
// ffout(3)<<"triangle cut but outside2\n"; |
2517 |
|
// ffout(3)<<V0<<"\n"; |
2518 |
|
// ffout(3)<<V1<<"\n"; |
2519 |
|
// ffout(3)<<V2<<"\n"; |
2520 |
|
// ffout(3)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
2521 |
|
// } |
2522 |
|
// } else { |
2523 |
|
// if(K.edgecut[2]!=0) { |
2524 |
|
// if(K.pointsIntersection[2][0]==&V0 |
2525 |
|
// or K.pointsIntersection[2][0]==&V1 |
2526 |
|
// or K.pointsIntersection[2][0]==&V2 or vertexInTriangles.size()<3) { |
2527 |
|
// //ffout(3)<<"**********normal\n"; |
2528 |
|
// } else { |
2529 |
|
// ffout(3)<<"triangle cut but outside3\n"; |
2530 |
|
// ffout(3)<<V0<<"\n"; |
2531 |
|
// ffout(3)<<V1<<"\n"; |
2532 |
|
// ffout(3)<<V2<<"\n"; |
2533 |
|
// ffout(3)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
2534 |
|
// } |
2535 |
|
// } |
2536 |
|
// } |
2537 |
|
// } |
2538 |
|
// } |
2539 |
|
// } |
2540 |
|
// } |
2541 |
|
// } |
2542 |
|
// if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3 |
2543 |
|
// and K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]==1) { |
2544 |
|
// if(K.pointsIntersection[0][0]!=K.pointsIntersection[1][0] |
2545 |
|
// and K.pointsIntersection[1][0]!=K.pointsIntersection[2][0] |
2546 |
|
// and K.pointsIntersection[2][0]!=K.pointsIntersection[0][0]) { |
2547 |
|
// ffout(3)<<"---------------- 3 edge cut \n"; |
2548 |
|
// __createByEdges(K,*i,triangleListIntersectionNew); |
2549 |
|
// } else { |
2550 |
|
// __createListTriangle(K,*i,triangleListIntersectionNew); |
2551 |
|
// } |
2552 |
|
// } else { |
2553 |
|
// if(nbinters!=0) { |
2554 |
|
// __createListTriangle(K,*i,triangleListIntersectionNew); |
2555 |
|
// } else { |
2556 |
|
// //ffout(3)<<"j ajoute le tr car pas d'intersection dans les 2 listes\n"; |
2557 |
|
//#warning Reference not set. |
2558 |
|
// __addTriangle(Triangle(V0,V1,V2,(*T).reference()),*i,triangleListIntersectionNew); |
2559 |
|
// } |
2560 |
|
// } |
2561 |
|
// } |
2562 |
} |
} |
2563 |
} |
} |
2564 |
|
} |
2565 |
(*edgesRefVertex[numobject]).clear(); |
(*edgesRefVertex[numobject]).clear(); |
2566 |
} |
} |
2567 |
|
|
2568 |
bool SurfaceMeshGenerator::Internals:: |
bool SurfaceMeshGenerator::Internals:: |
2926 |
++itcell; |
++itcell; |
2927 |
} |
} |
2928 |
} else { |
} else { |
2929 |
ffout(4)<<"------jobDone false\n"; |
ffout(3)<<"------jobDone false\n"; |
2930 |
SurfaceMeshGenerator::Internals::MotherCellList::iterator itcell |
SurfaceMeshGenerator::Internals::MotherCellList::iterator itcell |
2931 |
=cellList.begin(); |
=cellList.begin(); |
2932 |
for (EdgePairList::iterator t = localTriangleList.begin(); |
for (EdgePairList::iterator t = localTriangleList.begin(); |
3244 |
__marchingTetrahedra(SMesh, *o, 0); |
__marchingTetrahedra(SMesh, *o, 0); |
3245 |
|
|
3246 |
objectStack.push(o); |
objectStack.push(o); |
3247 |
ffout(4) << "Marching cube sur " << objectStack.top() << '\n'; |
ffout(3) << "Marching cube sur " << objectStack.top() << '\n'; |
3248 |
} |
} |
3249 |
} |
} |
3250 |
|
|
3407 |
sortie<<" \n"; |
sortie<<" \n"; |
3408 |
sortie<<"Triangles"<<"\n"; |
sortie<<"Triangles"<<"\n"; |
3409 |
sortie<<s_mesh.numberOfCells()<<"\n"; |
sortie<<s_mesh.numberOfCells()<<"\n"; |
3410 |
ffout(4)<<"fin ecriture vertex\n"; |
ffout(3)<<"fin ecriture vertex\n"; |
3411 |
for (size_t i=0; i<s_mesh.numberOfCells(); ++i) { |
for (size_t i=0; i<s_mesh.numberOfCells(); ++i) { |
3412 |
const Triangle& T = s_mesh.cell(i); |
const Triangle& T = s_mesh.cell(i); |
3413 |
// ffout(4)<<s_mesh.vertexNumber(T(0))<<" "<<s_mesh.vertexNumber(T(1))<<" "<<s_mesh.//vertexNumber(T(2))<<"\n"; |
// ffout(3)<<s_mesh.vertexNumber(T(0))<<" "<<s_mesh.vertexNumber(T(1))<<" "<<s_mesh.//vertexNumber(T(2))<<"\n"; |
3414 |
sortie<<s_mesh.vertexNumber(T(0))+8*toTreatHexahedra.size()+1<<" "<<s_mesh.vertexNumber(T(1))+8*toTreatHexahedra.size()+1<<" "<<s_mesh.vertexNumber(T(2))+8*toTreatHexahedra.size()+1; |
sortie<<s_mesh.vertexNumber(T(0))+8*toTreatHexahedra.size()+1<<" "<<s_mesh.vertexNumber(T(1))+8*toTreatHexahedra.size()+1<<" "<<s_mesh.vertexNumber(T(2))+8*toTreatHexahedra.size()+1; |
3415 |
|
|
3416 |
// sortie<<3*i+1+8*toTreatHexahedra.size()<<" "<<3*i+2+8*toTreatHexahedra.size()<<" //"<<3*i+3+8*toTreatHexahedra.size();//<<" "<<1<<"\n"; |
// sortie<<3*i+1+8*toTreatHexahedra.size()<<" "<<3*i+2+8*toTreatHexahedra.size()<<" //"<<3*i+3+8*toTreatHexahedra.size();//<<" "<<1<<"\n"; |
3422 |
// sortie<<" 4"<<"\n"; |
// sortie<<" 4"<<"\n"; |
3423 |
sortie << " " << T.reference() << '\n'; |
sortie << " " << T.reference() << '\n'; |
3424 |
} |
} |
3425 |
ffout(4)<<"fin ecriture triangles\n"; |
ffout(3)<<"fin ecriture triangles\n"; |
3426 |
sortie<<" \n"; |
sortie<<" \n"; |
3427 |
sortie<<"Hexahedra"<<"\n"; |
sortie<<"Hexahedra"<<"\n"; |
3428 |
sortie<<toTreatHexahedra.size()<<" \n"; |
sortie<<toTreatHexahedra.size()<<" \n"; |
3430 |
for(size_t i=0;i<toTreatHexahedra.size();i++) |
for(size_t i=0;i<toTreatHexahedra.size();i++) |
3431 |
sortie<<8*i+1<<" "<<8*i+2<<" "<<8*i+3<<" "<<8*i+4<<" "<<8*i+5<<" "<<8*i+6<<" "<<8*i+7<<" "<<8*i+8<<" 3"<<"\n"; |
sortie<<8*i+1<<" "<<8*i+2<<" "<<8*i+3<<" "<<8*i+4<<" "<<8*i+5<<" "<<8*i+6<<" "<<8*i+7<<" "<<8*i+8<<" 3"<<"\n"; |
3432 |
sortie<<"End"<<" \n"; |
sortie<<"End"<<" \n"; |
3433 |
ffout(4)<<"fin ecriture intersection.mesh\n"; |
ffout(3)<<"fin ecriture intersection.mesh\n"; |
3434 |
} |
} |