593 |
hexaList2.begin(), hexaList2.end(), |
hexaList2.begin(), hexaList2.end(), |
594 |
inserter(toTreatHexahedra, toTreatHexahedra.begin())); |
inserter(toTreatHexahedra, toTreatHexahedra.begin())); |
595 |
|
|
596 |
ffout(4)<<"nb hexa to treat "<<toTreatHexahedra.size()<<"\n"; |
ffout(3)<<"nb hexa to treat "<<toTreatHexahedra.size()<<"\n"; |
597 |
|
|
598 |
__calculateIntersection<booleanTest>(O0,O1,O2, toTreatHexahedra); |
__calculateIntersection<booleanTest>(O0,O1,O2, toTreatHexahedra); |
599 |
} |
} |
613 |
//create mesh intersection for the object 0 and 1 |
//create mesh intersection for the object 0 and 1 |
614 |
__createTrianglesIntersection<booleanTest>(0, O1, O2, toTreatHexahedra, |
__createTrianglesIntersection<booleanTest>(0, O1, O2, toTreatHexahedra, |
615 |
triangleListIntersectionNew, listVertexIntersectionNew); |
triangleListIntersectionNew, listVertexIntersectionNew); |
616 |
ffout(4)<<"nb triangles in intersection 0 "<<triangleListIntersectionNew.size()<<"\n"<<std::flush; |
ffout(3)<<"nb triangles in intersection 0 "<<triangleListIntersectionNew.size()<<"\n"<<std::flush; |
617 |
__createTrianglesIntersection<booleanTest>(1, O2, O1, toTreatHexahedra, |
__createTrianglesIntersection<booleanTest>(1, O2, O1, toTreatHexahedra, |
618 |
triangleListIntersectionNew, listVertexIntersectionNew); |
triangleListIntersectionNew, listVertexIntersectionNew); |
619 |
ffout(4)<<"nb triangles in intersection 1 "<<triangleListIntersectionNew.size()<<"\n"<<std::flush; |
ffout(3)<<"nb triangles in intersection 1 "<<triangleListIntersectionNew.size()<<"\n"<<std::flush; |
620 |
|
|
621 |
pairTriangleToIntersectionPoints.clear(); |
pairTriangleToIntersectionPoints.clear(); |
622 |
|
|
689 |
ntr+=listOfVertexMesh.size(); |
ntr+=listOfVertexMesh.size(); |
690 |
|
|
691 |
s_mesh.setNumberOfVertices(ntr); |
s_mesh.setNumberOfVertices(ntr); |
692 |
ffout(4)<<"nb tot vertices "<<s_mesh.numberOfVertices()<<"\n"<<std::flush; |
ffout(3)<<"nb tot vertices "<<s_mesh.numberOfVertices()<<"\n"<<std::flush; |
693 |
|
|
694 |
//! copies vertices into the s_mesh. |
//! copies vertices into the s_mesh. |
695 |
int i = 0; |
int i = 0; |
717 |
//if(nobjectToTreat==0){ |
//if(nobjectToTreat==0){ |
718 |
ncell+=triangleList.size(); |
ncell+=triangleList.size(); |
719 |
//} |
//} |
720 |
// ffout(4)<<"ncell "<<ncell<<" n0 "<<n0<<" n1 "<<n1<<"\n"; |
// ffout(3)<<"ncell "<<ncell<<" n0 "<<n0<<" n1 "<<n1<<"\n"; |
721 |
|
|
722 |
s_mesh.setNumberOfCells(ncell); |
s_mesh.setNumberOfCells(ncell); |
723 |
ffout(4)<<"nb tot cells "<<s_mesh.numberOfCells()<<" \n"<<std::flush; |
ffout(3)<<"nb tot cells "<<s_mesh.numberOfCells()<<" \n"<<std::flush; |
724 |
|
|
725 |
for(size_t size=0 ; size< triangleList.size() ; ++size) { |
for(size_t size=0 ; size< triangleList.size() ; ++size) { |
726 |
const Triangle& T=triangleList[size]; |
const Triangle& T=triangleList[size]; |
822 |
} |
} |
823 |
} |
} |
824 |
} else { |
} else { |
825 |
//ffout(4)<<"pas d'intersection dans l'hexa\n"; |
//ffout(3)<<"pas d'intersection dans l'hexa\n"; |
826 |
} |
} |
827 |
} |
} |
828 |
} |
} |
1059 |
if(inV01 > epsilon and inV02 > epsilon and inV12 > epsilon ) { |
if(inV01 > epsilon and inV02 > epsilon and inV12 > epsilon ) { |
1060 |
__InTriangle(P,V,num); |
__InTriangle(P,V,num); |
1061 |
if(num==3) { |
if(num==3) { |
1062 |
//ffout(4)<<"ajout du point cas 2\n"; |
//ffout(3)<<"ajout du point cas 2\n"; |
1063 |
//ffout(4)<<P[0]<<" "<<P[1]<<" "<<P[2]<<" \n"; |
//ffout(3)<<P[0]<<" "<<P[1]<<" "<<P[2]<<" \n"; |
1064 |
//listVertexIntersectionNew.push_back(new Vertex (P)); |
//listVertexIntersectionNew.push_back(new Vertex (P)); |
1065 |
PIntersection PIn; |
PIntersection PIn; |
1066 |
// if(!(norm2>epsilon)) { |
// if(!(norm2>epsilon)) { |
1152 |
size_t& refVertex1=(*edgesRefVertex[numobject])[V1]; |
size_t& refVertex1=(*edgesRefVertex[numobject])[V1]; |
1153 |
|
|
1154 |
if(refVertex0+refVertex1==4 and edgeCut==1) { |
if(refVertex0+refVertex1==4 and edgeCut==1) { |
1155 |
ffout(4)<<"warning edge ref 2 cut \n"; |
ffout(3)<<"warning edge ref 2 cut \n"; |
1156 |
ffout(4)<<(*V0)[0]<<" "<<(*V0)[1]<<" "<<(*V0)[2]<<" \n"; |
ffout(3)<<(*V0)[0]<<" "<<(*V0)[1]<<" "<<(*V0)[2]<<" \n"; |
1157 |
ffout(4)<<(*V1)[0]<<" "<<(*V1)[1]<<" "<<(*V1)[2]<<" \n"; |
ffout(3)<<(*V1)[0]<<" "<<(*V1)[1]<<" "<<(*V1)[2]<<" \n"; |
1158 |
refVertex0=0; |
refVertex0=0; |
1159 |
refVertex1=0; |
refVertex1=0; |
1160 |
} else { |
} else { |
1171 |
std::list<Triangle*>::iterator currentTriangle, |
std::list<Triangle*>::iterator currentTriangle, |
1172 |
PIntersection& listVertexIntersectionNew) |
PIntersection& listVertexIntersectionNew) |
1173 |
{ |
{ |
1174 |
//ffout(4)<< "createpointintersection "<<numobject<<" "<<objectNumber<<"\n"; |
//ffout(3)<< "createpointintersection "<<numobject<<" "<<objectNumber<<"\n"; |
1175 |
//ffout(4)<<"*************************\n"; |
//ffout(3)<<"*************************\n"; |
1176 |
|
|
1177 |
PairTriangleNew pTriangle; |
PairTriangleNew pTriangle; |
1178 |
pTriangle.first=(*currentTriangle1); |
pTriangle.first=(*currentTriangle1); |
1185 |
const TinyVector<3,size_t >& pintercut=Pinter.cutTriangle1(); |
const TinyVector<3,size_t >& pintercut=Pinter.cutTriangle1(); |
1186 |
|
|
1187 |
if(pintercut[0]+pintercut[1]+pintercut[2]!=0) { |
if(pintercut[0]+pintercut[1]+pintercut[2]!=0) { |
1188 |
//ffout(4)<<"le tr est cut\n"; |
//ffout(3)<<"le tr est cut\n"; |
1189 |
assert(pairTriangleToIntersectionPoints.find(pTriangle)==pairTriangleToIntersectionPoints.end()); |
assert(pairTriangleToIntersectionPoints.find(pTriangle)==pairTriangleToIntersectionPoints.end()); |
1190 |
pairTriangleToIntersectionPoints[pTriangle] = Pinter; |
pairTriangleToIntersectionPoints[pTriangle] = Pinter; |
1191 |
} else { |
} else { |
1192 |
if(Pinter.size()!=0) { |
if(Pinter.size()!=0) { |
1193 |
//ffout(4)<<"rajout2 \n"; |
//ffout(3)<<"rajout2 \n"; |
1194 |
pairTriangleToIntersectionPoints[pTriangle] = Pinter; |
pairTriangleToIntersectionPoints[pTriangle] = Pinter; |
1195 |
} |
} |
1196 |
} |
} |
1325 |
//#warning Reference not set. |
//#warning Reference not set. |
1326 |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
1327 |
} else { |
} else { |
1328 |
ffout(4) <<"pbs 10\n"<<std::flush; |
ffout(3) <<"pbs 10\n"<<std::flush; |
1329 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
1330 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
1331 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
1332 |
} |
} |
1333 |
} else { |
} else { |
1334 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1335 |
ffout(4)<<"pbs 11\n"<<std::flush; |
ffout(3)<<"pbs 11\n"<<std::flush; |
1336 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
1337 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
1338 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
1339 |
ffout(4)<<ncase<<"\n"; |
ffout(3)<<ncase<<"\n"; |
1340 |
ffout(4)<<__determinateNumber(vertexNum[1],pointsIntersection)<<"\n"; |
ffout(3)<<__determinateNumber(vertexNum[1],pointsIntersection)<<"\n"; |
1341 |
} else { |
} else { |
1342 |
ffout(4) <<"pbs 111\n"; |
ffout(3) <<"pbs 111\n"; |
1343 |
} |
} |
1344 |
} |
} |
1345 |
break; |
break; |
1355 |
__addTriangle(Triangle(A,B,D,K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,D,K.reference()),cell,triangleListIntersectionNew); |
1356 |
__addTriangle(Triangle(A,D,C,K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,D,C,K.reference()),cell,triangleListIntersectionNew); |
1357 |
} else { |
} else { |
1358 |
ffout(4)<<"-------- warning trou in 0\n"<<std::flush; |
ffout(3)<<"-------- warning trou in 0\n"<<std::flush; |
1359 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
1360 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
1361 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
1362 |
//#warning Reference not set. |
//#warning Reference not set. |
1363 |
__addTriangle(Triangle(A,B,D,K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,D,K.reference()),cell,triangleListIntersectionNew); |
1364 |
} |
} |
1365 |
} else { |
} else { |
1366 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1367 |
ffout(4)<<"-------- warning trou in\n"<<std::flush; |
ffout(3)<<"-------- warning trou in\n"<<std::flush; |
1368 |
const Vertex& B=__determinateNumber(vertexNum[1],pointsIntersection); |
const Vertex& B=__determinateNumber(vertexNum[1],pointsIntersection); |
1369 |
//#warning Reference not set. |
//#warning Reference not set. |
1370 |
__addTriangle(Triangle(A,B,D,K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,D,K.reference()),cell,triangleListIntersectionNew); |
1371 |
} else { |
} else { |
1372 |
ffout(4) <<"pbs 1\n"<<std::flush; |
ffout(3) <<"pbs 1\n"<<std::flush; |
1373 |
} |
} |
1374 |
} |
} |
1375 |
break; |
break; |
1376 |
} |
} |
1377 |
default: { |
default: { |
1378 |
#warning is it true? case where only one edge is cut? |
#warning is it true? case where only one edge is cut? |
1379 |
ffout(4) << numberPointsInterior<<" be careful 1\n"<<std::flush; |
ffout(3) << numberPointsInterior<<" be careful 1\n"<<std::flush; |
1380 |
//case 1 point inside and more than 1 point in the triangle |
//case 1 point inside and more than 1 point in the triangle |
1381 |
__createByEdges(K, cell, triangleListIntersectionNew); |
__createByEdges(K, cell, triangleListIntersectionNew); |
1382 |
} |
} |
1442 |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
1443 |
__addTriangle(Triangle(C,B,D,K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(C,B,D,K.reference()),cell,triangleListIntersectionNew); |
1444 |
} else { |
} else { |
1445 |
// ffout(4) <<"pbs 20\n"; |
// ffout(3) <<"pbs 20\n"; |
1446 |
//#warning Reference not set. |
//#warning Reference not set. |
1447 |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
1448 |
} |
} |
1449 |
} else { |
} else { |
1450 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1451 |
// ffout(4) <<"pbs 210\n"; |
// ffout(3) <<"pbs 210\n"; |
1452 |
const Vertex& C=__determinateNumber(vertexNum[1],pointsIntersection); |
const Vertex& C=__determinateNumber(vertexNum[1],pointsIntersection); |
1453 |
//#warning Reference not set. |
//#warning Reference not set. |
1454 |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(A,B,C,K.reference()),cell,triangleListIntersectionNew); |
1455 |
} else { |
} else { |
1456 |
ffout(4) <<"pbs 21\n"<<std::flush; |
ffout(3) <<"pbs 21\n"<<std::flush; |
1457 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
1458 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
1459 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
1460 |
} |
} |
1461 |
} |
} |
1462 |
break; |
break; |
1491 |
} |
} |
1492 |
default: { |
default: { |
1493 |
//POUR STEPH : peut generer des tr plats |
//POUR STEPH : peut generer des tr plats |
1494 |
ffout(4) << numberPointsInterior <<"be careful 2\n"<<std::flush; |
ffout(3) << numberPointsInterior <<"be careful 2\n"<<std::flush; |
1495 |
// ffout(4)<<V0<<"\n"; |
// ffout(3)<<V0<<"\n"; |
1496 |
// ffout(4)<<V1<<"\n"; |
// ffout(3)<<V1<<"\n"; |
1497 |
// ffout(4)<<V2<<"\n"; |
// ffout(3)<<V2<<"\n"; |
1498 |
TinyVector<10,const Vertex*> P,Ptemp; |
TinyVector<10,const Vertex*> P,Ptemp; |
1499 |
size_t i=0; |
size_t i=0; |
1500 |
for(std::map<const Vertex*,const Vertex*>::const_iterator it=pointsInterior.begin(); |
for(std::map<const Vertex*,const Vertex*>::const_iterator it=pointsInterior.begin(); |
1532 |
Ptemp[0]=P[num]; |
Ptemp[0]=P[num]; |
1533 |
P=Ptemp; |
P=Ptemp; |
1534 |
--size; |
--size; |
1535 |
// ffout(4)<<"size = "<<size<<"\n"; |
// ffout(3)<<"size = "<<size<<"\n"; |
1536 |
} |
} |
1537 |
//#warning Reference not set. |
//#warning Reference not set. |
1538 |
__addTriangle(Triangle(B,*P[0],*P[1],K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(B,*P[0],*P[1],K.reference()),cell,triangleListIntersectionNew); |
1539 |
__addTriangle(Triangle(B,*P[1],D,K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(B,*P[1],D,K.reference()),cell,triangleListIntersectionNew); |
1540 |
//__addTriangle(A,B,D,cell); |
//__addTriangle(A,B,D,cell); |
1541 |
} else { |
} else { |
1542 |
ffout(4)<<"une seule arete cut pbs\n"; |
ffout(3)<<"une seule arete cut pbs\n"; |
1543 |
} |
} |
1544 |
} else { |
} else { |
1545 |
ffout(4)<<"une seule arete cut pbs2\n"; |
ffout(3)<<"une seule arete cut pbs2\n"; |
1546 |
} |
} |
1547 |
} |
} |
1548 |
} |
} |
1592 |
//detection tr plat |
//detection tr plat |
1593 |
size_t isDegenerate=0; |
size_t isDegenerate=0; |
1594 |
if(__isDegenerate(*(*jt0))) { |
if(__isDegenerate(*(*jt0))) { |
1595 |
// ffout(4)<<"degenerate triangle\n"; |
// ffout(3)<<"degenerate triangle\n"; |
1596 |
isDegenerate=1; |
isDegenerate=1; |
1597 |
} |
} |
1598 |
if(pairTriangleToIntersectionPoints[pairTriangle].size()==2 and isDegenerate==0) { |
if(pairTriangleToIntersectionPoints[pairTriangle].size()==2 and isDegenerate==0) { |
1600 |
const Vertex*& V1=pairTriangleToIntersectionPoints[pairTriangle][1]; |
const Vertex*& V1=pairTriangleToIntersectionPoints[pairTriangle][1]; |
1601 |
if((V0==&(*(*jt0))(0) or V0==&(*(*jt0))(1) or V0==&(*(*jt0))(2)) |
if((V0==&(*(*jt0))(0) or V0==&(*(*jt0))(1) or V0==&(*(*jt0))(2)) |
1602 |
and (V1==&(*(*jt0))(0) or V1==&(*(*jt0))(1) or V1==&(*(*jt0))(2))) { |
and (V1==&(*(*jt0))(0) or V1==&(*(*jt0))(1) or V1==&(*(*jt0))(2))) { |
1603 |
//ffout(4)<<"inter confondu avec arete\n"; |
//ffout(3)<<"inter confondu avec arete\n"; |
1604 |
isDegenerate=1; |
isDegenerate=1; |
1605 |
} |
} |
1606 |
} |
} |
1648 |
size_t r=0; |
size_t r=0; |
1649 |
size_t sum=cutTriangle[0]+cutTriangle[1]+cutTriangle[2]; |
size_t sum=cutTriangle[0]+cutTriangle[1]+cutTriangle[2]; |
1650 |
if(sum>3) { |
if(sum>3) { |
1651 |
ffout(4)<<"sum "<<sum<<"\n"<<std::flush; |
ffout(3)<<"sum "<<sum<<"\n"<<std::flush; |
1652 |
} |
} |
1653 |
|
|
1654 |
switch (sum) { |
switch (sum) { |
1673 |
break; |
break; |
1674 |
} |
} |
1675 |
default: { |
default: { |
1676 |
ffout(4) << "pbs sum = "<<sum<<" size " |
ffout(3) << "pbs sum = "<<sum<<" size " |
1677 |
<< pairTriangleToIntersectionPoints[pairTriangle].size()<<" \n"; |
<< pairTriangleToIntersectionPoints[pairTriangle].size()<<" \n"; |
1678 |
ffout(4) << K(0) << "\n"; |
ffout(3) << K(0) << "\n"; |
1679 |
ffout(4) << K(1) << "\n"; |
ffout(3) << K(1) << "\n"; |
1680 |
ffout(4) << K(2) << "\n"; |
ffout(3) << K(2) << "\n"; |
1681 |
ffout(4) << cutTriangle[0] << " " << cutTriangle[1] << " " << cutTriangle[2] << "\n"; |
ffout(3) << cutTriangle[0] << " " << cutTriangle[1] << " " << cutTriangle[2] << "\n"; |
1682 |
} |
} |
1683 |
} |
} |
1684 |
if(pointsInterior.find(pairTriangleToIntersectionPoints[pairTriangle][r]) |
if(pointsInterior.find(pairTriangleToIntersectionPoints[pairTriangle][r]) |
1688 |
} |
} |
1689 |
} |
} |
1690 |
} else { |
} else { |
1691 |
// ffout(4) <<"pasintersecte\n"; |
// ffout(3) <<"pasintersecte\n"; |
1692 |
} |
} |
1693 |
} |
} |
1694 |
} |
} |
1740 |
} |
} |
1741 |
} |
} |
1742 |
else { |
else { |
1743 |
// ffout(4)<<"la paire de triangle n'existe pas!\n"; |
// ffout(3)<<"la paire de triangle n'existe pas!\n"; |
1744 |
} |
} |
1745 |
} |
} |
1746 |
} |
} |
1938 |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
1939 |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
1940 |
} else { |
} else { |
1941 |
ffout(4)<<"pbs 0 existe pas\n"; |
ffout(3)<<"pbs 0 existe pas\n"; |
1942 |
} |
} |
1943 |
|
|
1944 |
size_t b=0; |
size_t b=0; |
1960 |
P[b+1]=VV[0]; |
P[b+1]=VV[0]; |
1961 |
} |
} |
1962 |
} else { |
} else { |
1963 |
ffout(4)<<"pbs 1 existe pas\n"; |
ffout(3)<<"pbs 1 existe pas\n"; |
1964 |
b=30; |
b=28; |
1965 |
} |
} |
1966 |
TinyVector<2,const Triangle*> T2; |
TinyVector<2,const Triangle*> T2; |
1967 |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
1979 |
} |
} |
1980 |
++b; |
++b; |
1981 |
} |
} |
1982 |
|
if(b==29) ffout(3)<<"createnotin b ="<<b<<"\n"; |
1983 |
} |
} |
1984 |
|
|
1985 |
void SurfaceMeshGenerator::Internals:: |
void SurfaceMeshGenerator::Internals:: |
1995 |
place0=2; |
place0=2; |
1996 |
} |
} |
1997 |
|
|
1998 |
//ffout(4)<<"place = "<<place0<<"\n"; |
//ffout(3)<<"place = "<<place0<<"\n"; |
1999 |
const Vertex* Pend=K.pointsIntersection[place0][1]; |
const Vertex* Pend=K.pointsIntersection[place0][1]; |
2000 |
TinyVector<30,const Vertex*> P; |
TinyVector<30,const Vertex*> P; |
2001 |
TinyVector<30,const Triangle*> T; |
TinyVector<30,const Triangle*> T; |
2003 |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
2004 |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
2005 |
} else { |
} else { |
2006 |
ffout(4)<<"pbs 0 existe pas\n"; |
ffout(3)<<"pbs 0 existe pas\n"; |
2007 |
} |
} |
2008 |
|
|
2009 |
size_t b=0; |
size_t b=0; |
2010 |
while(P[b]!=Pend and b<29) { |
while(P[b]!=Pend and b<29) { |
2011 |
//ffout(4)<<"------------------- b "<<b<<"\n"; |
//ffout(3)<<"------------------- b "<<b<<"\n"; |
2012 |
if(triangleWithVertex.find(T[b])!=triangleWithVertex.end()) { |
if(triangleWithVertex.find(T[b])!=triangleWithVertex.end()) { |
2013 |
TinyVector<2,const Vertex*> VV=(*triangleWithVertex.find(T[b])).second; |
TinyVector<2,const Vertex*> VV=(*triangleWithVertex.find(T[b])).second; |
2014 |
if(VV[0]==P[b]) { |
if(VV[0]==P[b]) { |
2015 |
if(Pend!=VV[1]) { |
if(Pend!=VV[1]) { |
|
//#warning Reference not set. |
|
2016 |
__addTriangle(Triangle(*Pend,*P[b],*VV[1],K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(*Pend,*P[b],*VV[1],K.reference()),cell,triangleListIntersectionNew); |
2017 |
// ffout(4)<<"1 "<<*Pend<<"\n"; |
// ffout(3)<<"1 "<<*Pend<<"\n"; |
2018 |
// ffout(4)<<*P[b]<<"\n"; |
// ffout(3)<<*P[b]<<"\n"; |
2019 |
// ffout(4)<<*VV[1]<<"\n"; |
// ffout(3)<<*VV[1]<<"\n"; |
2020 |
} |
} |
2021 |
P[b+1]=VV[1]; |
P[b+1]=VV[1]; |
2022 |
} else { |
} else { |
2023 |
if(Pend!=VV[0]) { |
if(Pend!=VV[0]) { |
2024 |
//#warning Reference not set. |
__addTriangle(Triangle(*Pend,*P[b],*VV[0],K.reference()),cell,triangleListIntersectionNew); |
2025 |
__addTriangle(Triangle(*Pend,*P[b],*VV[0],K.reference()),cell,triangleListIntersectionNew); |
//ffout(3)<<"2 "<<*Pend<<"\n"; |
2026 |
//ffout(4)<<"2 "<<*Pend<<"\n"; |
//ffout(3)<<*P[b]<<"\n"; |
2027 |
//ffout(4)<<*P[b]<<"\n"; |
//ffout(3)<<*VV[0]<<"\n"; |
|
//ffout(4)<<*VV[0]<<"\n"; |
|
2028 |
} |
} |
2029 |
P[b+1]=VV[0]; |
P[b+1]=VV[0]; |
2030 |
} |
} |
2031 |
} else { |
} else { |
2032 |
ffout(4)<<"pbs 1 existe pas\n"; |
ffout(3)<<"pbs 1 existe pas\n"; |
2033 |
b=30; |
b=28; |
2034 |
} |
} |
2035 |
|
|
2036 |
TinyVector<2,const Triangle*> T2; |
TinyVector<2,const Triangle*> T2; |
2037 |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[b+1])!=vertexInTriangles.end()) { |
2038 |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
2039 |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
2040 |
} else { |
} else { |
2041 |
ffout(4)<<"points exisste pas \n"; |
ffout(3)<<"points exisste pas \n"; |
2042 |
b=30; |
b=28; |
2043 |
} |
} |
2044 |
|
|
2045 |
if(K.edgecut[0][0]==1 and K.edgecut[0][1]==1) { |
if(K.edgecut[0][0]==1 and K.edgecut[0][1]==1) { |
2046 |
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]) { |
2047 |
T2[0]=T[b]; |
T2[0]=T[b]; |
2054 |
T2[1]=T[b]; |
T2[1]=T[b]; |
2055 |
} |
} |
2056 |
} |
} |
2057 |
|
|
2058 |
if(T2[0]==T[b]) { |
if(T2[0]==T[b]) { |
2059 |
if(T2[1]==T[b]) { |
if(T2[1]==T[b]) { |
2060 |
//point edge |
//point edge |
2061 |
//ffout(4)<<"here\n"; |
//ffout(3)<<"here\n"; |
2062 |
if(K.edgecut[0][0]==1 and K.edgecut[0][1]==1) { |
if(K.edgecut[0][0]==1 and K.edgecut[0][1]==1 and place0!=0) { |
2063 |
//ffout(4)<<"here2\n"; |
//ffout(3)<<"here2\n"; |
2064 |
if(P[b+1]==K.pointsIntersection[0][1]) { |
if(P[b+1]==K.pointsIntersection[0][1]) { |
|
//#warning Reference not set. |
|
2065 |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[0][0], |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[0][0], |
2066 |
K.reference()),cell,triangleListIntersectionNew); |
K.reference()),cell,triangleListIntersectionNew); |
2067 |
P[b+1]=K.pointsIntersection[0][0]; |
P[b+1]=K.pointsIntersection[0][0]; |
2072 |
T[b+1]=T2[0]; |
T[b+1]=T2[0]; |
2073 |
} else |
} else |
2074 |
if(P[b+1]==K.pointsIntersection[0][0]){ |
if(P[b+1]==K.pointsIntersection[0][0]){ |
|
//#warning Reference not set. |
|
2075 |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[0][1], |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[0][1], |
2076 |
K.reference()),cell,triangleListIntersectionNew); |
K.reference()),cell,triangleListIntersectionNew); |
2077 |
P[b+1]=K.pointsIntersection[0][1]; |
P[b+1]=K.pointsIntersection[0][1]; |
2079 |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
2080 |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
2081 |
} else { |
} else { |
2082 |
ffout(4)<<"le tr e pas\n"; |
ffout(3)<<"le tr e pas\n"; |
2083 |
} |
} |
2084 |
T[b+1]=T2[0]; |
T[b+1]=T2[0]; |
2085 |
} else |
} else |
2086 |
if(P[b+1]!=Pend) { |
if(P[b+1]!=Pend) { |
2087 |
ffout(4)<<"point pas sur edge trou???? \n"; |
ffout(3)<<"point pas sur edge trou???? \n"; |
2088 |
ffout(4)<<*P[b+1]<<"\n"; |
ffout(3)<<*P[b+1]<<"\n"; |
2089 |
ffout(4)<<*Pend<<"\n"; |
ffout(3)<<*Pend<<"\n"; |
2090 |
P[b+1]=Pend; |
P[b+1]=Pend; |
2091 |
} |
} |
2092 |
} else { |
} else { |
2093 |
if(K.edgecut[2][0]==1 and K.edgecut[2][1]==1) { |
if(K.edgecut[2][0]==1 and K.edgecut[2][1]==1 and place0!=2) { |
|
//ffout(4)<<"here3\n"; |
|
2094 |
if(P[b+1]==K.pointsIntersection[2][1]) { |
if(P[b+1]==K.pointsIntersection[2][1]) { |
|
//#warning Reference not set. |
|
2095 |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[2][0], |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[2][0], |
2096 |
K.reference()),cell,triangleListIntersectionNew); |
K.reference()),cell,triangleListIntersectionNew); |
2097 |
P[b+1]=K.pointsIntersection[2][0]; |
P[b+1]=K.pointsIntersection[2][0]; |
2102 |
T[b+1]=T2[0]; |
T[b+1]=T2[0]; |
2103 |
} else { |
} else { |
2104 |
if(P[b+1]==K.pointsIntersection[2][0]){ |
if(P[b+1]==K.pointsIntersection[2][0]){ |
|
//#warning Reference not set. |
|
2105 |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[2][1], |
__addTriangle(Triangle(*Pend,*P[b+1],*K.pointsIntersection[2][1], |
2106 |
K.reference()),cell,triangleListIntersectionNew); |
K.reference()),cell,triangleListIntersectionNew); |
2107 |
P[b+1]=K.pointsIntersection[2][1]; |
P[b+1]=K.pointsIntersection[2][1]; |
2113 |
} |
} |
2114 |
} |
} |
2115 |
} else { |
} else { |
2116 |
ffout(4)<<"pas trouve l'egde et le point\n"; |
ffout(3)<<"pas trouve l'egde et le point\n"; |
2117 |
} |
} |
2118 |
} |
} |
2119 |
} else { |
} else { |
2124 |
} |
} |
2125 |
++b; |
++b; |
2126 |
} |
} |
2127 |
|
if(b==29) ffout(3)<<"createnotin2 b ="<<b<<"\n"; |
2128 |
} |
} |
2129 |
|
|
2130 |
void SurfaceMeshGenerator::Internals:: |
void SurfaceMeshGenerator::Internals:: |
2156 |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
if(vertexInTriangles.find(P[0])!=vertexInTriangles.end()) { |
2157 |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
T[0]=(*vertexInTriangles.find(P[0])).second[0]; |
2158 |
} else { |
} else { |
2159 |
ffout(4)<<"pbs 0 existe pas\n"; |
ffout(3)<<"pbs 0 existe pas\n"; |
2160 |
} |
} |
2161 |
|
|
2162 |
size_t b=0; |
size_t b=0; |
2165 |
TinyVector<2,const Vertex*> VV=(*triangleWithVertex.find(T[b])).second; |
TinyVector<2,const Vertex*> VV=(*triangleWithVertex.find(T[b])).second; |
2166 |
if(VV[0]==P[b]) { |
if(VV[0]==P[b]) { |
2167 |
if(VV[1]==P[b]) { |
if(VV[1]==P[b]) { |
2168 |
ffout(4)<<"b ="<<b<<" egal\n"; |
ffout(3)<<"b ="<<b<<" egal\n"; |
2169 |
if(K.pointsIntersection[place2][0]==P[b]) { |
if(K.pointsIntersection[place2][0]==P[b]) { |
2170 |
P[b+1]=K.pointsIntersection[place2][1]; |
P[b+1]=K.pointsIntersection[place2][1]; |
|
//#warning Reference not set. |
|
2171 |
__addTriangle(Triangle(K(in0),*P[b],*P[b+1],K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(K(in0),*P[b],*P[b+1],K.reference()),cell,triangleListIntersectionNew); |
2172 |
} else { |
} else { |
2173 |
if(K.pointsIntersection[place2][1]==P[b]){ |
if(K.pointsIntersection[place2][1]==P[b]){ |
2174 |
P[b+1]=K.pointsIntersection[place2][0]; |
P[b+1]=K.pointsIntersection[place2][0]; |
|
//#warning Reference not set. |
|
2175 |
__addTriangle(Triangle(K(in0),*P[b],*P[b+1],K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(K(in0),*P[b],*P[b+1],K.reference()),cell,triangleListIntersectionNew); |
2176 |
} else { |
} else { |
2177 |
ffout(4)<<"pbs pbs\n"; |
ffout(3)<<"pbs pbs\n"; |
2178 |
ffout(4)<<*P[b]<<"\n"; |
ffout(3)<<*P[b]<<"\n"; |
2179 |
P[b+1]=K.pointsIntersection[place2][1]; |
P[b+1]=K.pointsIntersection[place2][1]; |
2180 |
//std::exit(0); |
//std::exit(0); |
2181 |
} |
} |
2182 |
} |
} |
2183 |
} else { |
} else { |
|
//#warning Reference not set. |
|
2184 |
__addTriangle(Triangle(K(in0),*P[b],*VV[1],K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(K(in0),*P[b],*VV[1],K.reference()),cell,triangleListIntersectionNew); |
2185 |
P[b+1]=VV[1]; |
P[b+1]=VV[1]; |
2186 |
} |
} |
2187 |
} else { |
} else { |
|
//#warning Reference not set. |
|
2188 |
__addTriangle(Triangle(K(in0),*P[b],*VV[0],K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(K(in0),*P[b],*VV[0],K.reference()),cell,triangleListIntersectionNew); |
2189 |
P[b+1]=VV[0]; |
P[b+1]=VV[0]; |
2190 |
} |
} |
2191 |
} else { |
} else { |
2192 |
ffout(4)<<"pbs 1 existe pas\n"; |
ffout(3)<<"pbs 1 existe pas\n"; |
2193 |
b=30; |
b=28; |
2194 |
} |
} |
2195 |
TinyVector<2,const Triangle*> T2; |
TinyVector<2,const Triangle*> T2; |
2196 |
|
|
2198 |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
T2[0]=(*vertexInTriangles.find(P[b+1])).second[0]; |
2199 |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
T2[1]=(*vertexInTriangles.find(P[b+1])).second[1]; |
2200 |
} else { |
} else { |
2201 |
ffout(4)<<"pbs tr existe pas\n"; |
ffout(3)<<"pbs tr existe pas\n"; |
2202 |
b=30; |
b=28; |
2203 |
} |
} |
2204 |
|
|
2205 |
if(T2[0]==T[b] and T2[1]==T[b]) { |
if(T2[0]==T[b] and T2[1]==T[b]) { |
2206 |
// ffout(4)<<"here0\n"; |
// ffout(3)<<"here0\n"; |
2207 |
//point edge |
//point edge |
2208 |
if(P[b+1]!=Pend) { |
if(P[b+1]!=Pend) { |
2209 |
if(K.pointsIntersection[place2][0]==P[b+1]) { |
if(K.pointsIntersection[place2][0]==P[b+1]) { |
2233 |
} |
} |
2234 |
++b; |
++b; |
2235 |
} |
} |
2236 |
|
if(b==29) ffout(3)<<"createbyedges b ="<<b<<"\n"; |
2237 |
} |
} |
2238 |
|
|
2239 |
void SurfaceMeshGenerator::Internals::__3pointsintersection(const TriangleCut& K,const Cell* cell, |
void SurfaceMeshGenerator::Internals::__3pointsintersection(const TriangleCut& K,const Cell* cell, |
2247 |
} |
} |
2248 |
if(V[0]!=V[1] and V[1]!=V[2] and V[2]!=V[0]) { |
if(V[0]!=V[1] and V[1]!=V[2] and V[2]!=V[0]) { |
2249 |
__addTriangle(Triangle(*V[0],*V[1],*V[2],K.reference()),cell,triangleListIntersectionNew); |
__addTriangle(Triangle(*V[0],*V[1],*V[2],K.reference()),cell,triangleListIntersectionNew); |
2250 |
ffout(4)<<"on comble le trou\n"<<std::flush; |
ffout(3)<<"on comble le trou\n"<<std::flush; |
2251 |
} else { |
} else { |
2252 |
ffout(4)<<"----- deux inter =\n"; |
ffout(3)<<"----- deux inter =\n"; |
2253 |
ffout(4)<<V[0]<<"\n"; |
ffout(3)<<V[0]<<"\n"; |
2254 |
ffout(4)<<V[1]<<"\n"; |
ffout(3)<<V[1]<<"\n"; |
2255 |
ffout(4)<<V[2]<<"\n"; |
ffout(3)<<V[2]<<"\n"; |
2256 |
} |
} |
2257 |
} |
} |
2258 |
template <typename booleanTest> |
template <typename booleanTest> |
2271 |
__constructionFinalMesh(O1,surfmesh); |
__constructionFinalMesh(O1,surfmesh); |
2272 |
Connectivity<Triangle> connect(nbcell); |
Connectivity<Triangle> connect(nbcell); |
2273 |
ConnectivityBuilder<SurfaceMeshOfTriangles> C(surfmesh,connect); |
ConnectivityBuilder<SurfaceMeshOfTriangles> C(surfmesh,connect); |
2274 |
//ffout(4)<<"numero "<<numobject<<" "<<objectNumber<<"\n"<<std::flush; |
//ffout(3)<<"numero "<<numobject<<" "<<objectNumber<<"\n"<<std::flush; |
2275 |
size_t objectNumber=0; |
size_t objectNumber=0; |
2276 |
if(numobject==0) |
if(numobject==0) |
2277 |
objectNumber=1; |
objectNumber=1; |
2332 |
} |
} |
2333 |
} |
} |
2334 |
|
|
2335 |
|
//put the reference of points |
2336 |
__putRefByFront(numobject,O1,O2,surfmesh,connect,toTreatHexahedra); |
__putRefByFront(numobject,O1,O2,surfmesh,connect,toTreatHexahedra); |
2337 |
|
|
2338 |
size_t nbinters=listVertexIntersectionNew.size(); |
size_t nbinters=listVertexIntersectionNew.size(); |
2339 |
ffout(4)<<"size listVertexIntersectionNew "<<nbinters<<"\n"<<std::flush; |
ffout(3)<<"size listVertexIntersectionNew "<<nbinters<<"\n"<<std::flush; |
2340 |
|
|
2341 |
for(std::set<const Cell*>::iterator i=toTreatHexahedra.begin(); |
for(std::set<const Cell*>::iterator i=toTreatHexahedra.begin(); |
2342 |
i!=toTreatHexahedra.end() ; ++i) { |
i!=toTreatHexahedra.end() ; ++i) { |
2377 |
switch (numberVertexInDomain) { |
switch (numberVertexInDomain) { |
2378 |
case 0: { |
case 0: { |
2379 |
if(K.edgecut[0]+K.edgecut[1]+K.edgecut[2]==3 and vertexInTriangles.size()<3) { |
if(K.edgecut[0]+K.edgecut[1]+K.edgecut[2]==3 and vertexInTriangles.size()<3) { |
2380 |
ffout(4)<<"tous les points d'inter ne sont pas dans la liste\n"; |
ffout(3)<<"tous les points d'inter ne sont pas dans la liste\n"; |
2381 |
__casePinterNotInList(K,*i, triangleListIntersectionNew); |
__casePinterNotInList(K,*i, triangleListIntersectionNew); |
2382 |
std::exit(1); |
std::exit(1); |
2383 |
} else if(K.edgecut[0]+K.edgecut[1]+K.edgecut[2]!=0) { |
} else if(K.edgecut[0]+K.edgecut[1]+K.edgecut[2]!=0) { |
2388 |
size_t numberEdgesCut=K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]; |
size_t numberEdgesCut=K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]; |
2389 |
if(vertexInTriangles.size()>3 and numberEdgesCut==1){ |
if(vertexInTriangles.size()>3 and numberEdgesCut==1){ |
2390 |
//one edge cut but twice |
//one edge cut but twice |
2391 |
ffout(4)<<"createNotIn\n"; |
ffout(3)<<"createNotIn\n"; |
2392 |
//POUR STEPH : createNotIn peut generer des tr plats |
//POUR STEPH : createNotIn peut generer des tr plats |
2393 |
__createNotIn(K,*i, triangleListIntersectionNew); |
__createNotIn(K,*i, triangleListIntersectionNew); |
2394 |
} else { |
} else { |
2395 |
if(vertexInTriangles.size()>3 and numberEdgesCut==2) { |
if(vertexInTriangles.size()>3 and numberEdgesCut==2) { |
2396 |
//two edge cut but twice |
//two edge cut but twice |
2397 |
ffout(4)<<"createNotIn2\n"; |
ffout(3)<<"createNotIn2\n"; |
2398 |
__createNotIn2(K,*i, triangleListIntersectionNew); |
__createNotIn2(K,*i, triangleListIntersectionNew); |
2399 |
} else { |
} else { |
2400 |
if(K.edgecut[0]!=0) { |
if(K.edgecut[0]!=0) { |
2401 |
if(K.pointsIntersection[0][0]==&V0 |
if(K.pointsIntersection[0][0]==&V0 |
2402 |
or K.pointsIntersection[0][0]==&V1 |
or K.pointsIntersection[0][0]==&V1 |
2403 |
or K.pointsIntersection[0][0]==&V2 or vertexInTriangles.size()==1) { |
or K.pointsIntersection[0][0]==&V2 or vertexInTriangles.size()==1) { |
2404 |
// ffout(4)<<"**********normal\n"; |
// ffout(3)<<"**********normal\n"; |
2405 |
} else { |
} else { |
2406 |
if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3 |
if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3 |
2407 |
and K.edgecut[0][1]+K.edgecut[1][1]+K.edgecut[2][1]==3) { |
and K.edgecut[0][1]+K.edgecut[1][1]+K.edgecut[2][1]==3) { |
2419 |
} |
} |
2420 |
if(vertexInTriangles.size()>3 and |
if(vertexInTriangles.size()>3 and |
2421 |
K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==2){ |
K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==2){ |
2422 |
ffout(4)<<"hhhhhhhh\n"; |
ffout(3)<<"hhhhhhhh\n"; |
2423 |
ffout(4)<<K(0)<<"\n"; |
ffout(3)<<K(0)<<"\n"; |
2424 |
ffout(4)<<K(1)<<"\n"; |
ffout(3)<<K(1)<<"\n"; |
2425 |
ffout(4)<<K(2)<<"\n"; |
ffout(3)<<K(2)<<"\n"; |
2426 |
__createNotIn2(K,*i,triangleListIntersectionNew); |
//__createNotIn2(K,*i,triangleListIntersectionNew); |
2427 |
} else { |
} else { |
2428 |
if(vertexInTriangles.size()>3 and |
if(vertexInTriangles.size()>3 and |
2429 |
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]==1) { |
2430 |
ffout(4)<<"case\n"; |
ffout(3)<<"case\n"; |
2431 |
__createNotIn(K,*i,triangleListIntersectionNew); |
__createNotIn(K,*i,triangleListIntersectionNew); |
2432 |
} |
} |
2433 |
} |
} |
2434 |
} else { |
} else { |
2435 |
if(vertexInTriangles.size()>=3) { |
if(vertexInTriangles.size()>=3) { |
2436 |
ffout(4)<<"triangle cut but outside1\n"; |
ffout(3)<<"triangle cut but outside1\n"; |
2437 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
2438 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
2439 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
2440 |
ffout(4)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
ffout(3)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
2441 |
} |
} |
2442 |
} |
} |
2443 |
} |
} |
2446 |
if(K.pointsIntersection[1][0]==&V0 |
if(K.pointsIntersection[1][0]==&V0 |
2447 |
or K.pointsIntersection[1][0]==&V1 |
or K.pointsIntersection[1][0]==&V1 |
2448 |
or K.pointsIntersection[1][0]==&V2 or vertexInTriangles.size()<3) { |
or K.pointsIntersection[1][0]==&V2 or vertexInTriangles.size()<3) { |
2449 |
// ffout(4)<<"**********normal\n"; |
// ffout(3)<<"**********normal\n"; |
2450 |
} else { |
} else { |
2451 |
ffout(4)<<"triangle cut but outside2\n"; |
ffout(3)<<"triangle cut but outside2\n"; |
2452 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
2453 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
2454 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
2455 |
ffout(4)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
ffout(3)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
2456 |
} |
} |
2457 |
} else { |
} else { |
2458 |
if(K.edgecut[2]!=0) { |
if(K.edgecut[2]!=0) { |
2459 |
if(K.pointsIntersection[2][0]==&V0 |
if(K.pointsIntersection[2][0]==&V0 |
2460 |
or K.pointsIntersection[2][0]==&V1 |
or K.pointsIntersection[2][0]==&V1 |
2461 |
or K.pointsIntersection[2][0]==&V2 or vertexInTriangles.size()<3) { |
or K.pointsIntersection[2][0]==&V2 or vertexInTriangles.size()<3) { |
2462 |
//ffout(4)<<"**********normal\n"; |
//ffout(3)<<"**********normal\n"; |
2463 |
} else { |
} else { |
2464 |
ffout(4)<<"triangle cut but outside3\n"; |
ffout(3)<<"triangle cut but outside3\n"; |
2465 |
ffout(4)<<V0<<"\n"; |
ffout(3)<<V0<<"\n"; |
2466 |
ffout(4)<<V1<<"\n"; |
ffout(3)<<V1<<"\n"; |
2467 |
ffout(4)<<V2<<"\n"; |
ffout(3)<<V2<<"\n"; |
2468 |
ffout(4)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
ffout(3)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
2469 |
} |
} |
2470 |
} |
} |
2471 |
} |
} |
2481 |
if(K.pointsIntersection[0][0]!=K.pointsIntersection[1][0] |
if(K.pointsIntersection[0][0]!=K.pointsIntersection[1][0] |
2482 |
and K.pointsIntersection[1][0]!=K.pointsIntersection[2][0] |
and K.pointsIntersection[1][0]!=K.pointsIntersection[2][0] |
2483 |
and K.pointsIntersection[2][0]!=K.pointsIntersection[0][0]) { |
and K.pointsIntersection[2][0]!=K.pointsIntersection[0][0]) { |
2484 |
ffout(4)<<"---------------- 3 edge cut \n"; |
ffout(3)<<"---------------- 3 edge cut \n"; |
2485 |
__createByEdges(K,*i,triangleListIntersectionNew); |
__createByEdges(K,*i,triangleListIntersectionNew); |
2486 |
} else { |
} else { |
2487 |
__createListTriangle(K,*i,triangleListIntersectionNew); |
__createListTriangle(K,*i,triangleListIntersectionNew); |
2500 |
__addTriangle(*T,*i,triangleListIntersectionNew); |
__addTriangle(*T,*i,triangleListIntersectionNew); |
2501 |
} else { |
} else { |
2502 |
if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3) { |
if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3) { |
2503 |
ffout(4)<<"cas a traiter-------------\n"; |
ffout(3)<<"cas a traiter-------------\n"; |
2504 |
} else { |
} else { |
2505 |
ffout(4)<<K.edgecut[0][0]<<" "<<K.edgecut[1][0]<<" "<<K.edgecut[2][0]<<"\n"; |
ffout(3)<<K.edgecut[0][0]<<" "<<K.edgecut[1][0]<<" "<<K.edgecut[2][0]<<"\n"; |
2506 |
ffout(4)<<"cas pas traite\n"; |
ffout(3)<<"cas pas traite\n"; |
2507 |
} |
} |
2508 |
} |
} |
2509 |
break; |
break; |
2510 |
} |
} |
2511 |
} |
} |
|
|
|
|
|
|
2512 |
////////////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////////////// |
2513 |
// // K.isInTriangle[i] vaut 1 si le point est a garder pour construire le maillage 0 sinon. |
// // K.isInTriangle[i] vaut 1 si le point est a garder pour construire le maillage 0 sinon. |
2514 |
// // K.edgecut[i] vaut 1 si l'arete est coupee |
// // K.edgecut[i] vaut 1 si l'arete est coupee |
2515 |
// if(K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]==0 |
|
|
// and K.edgecut[0]+K.edgecut[1]+K.edgecut[2]==3 and vertexInTriangles.size()<3) { |
|
|
// // K is outside but the 3 edges are cut "and there are less than 3 points in K" |
|
|
// |
|
|
// // On ne peut normalement pas se trouver ICI. |
|
|
// ffout(4)<<"tous les points d'inter ne sont pas dans la liste\n"; |
|
|
// __casePinterNotInList(K,*i, triangleListIntersectionNew); |
|
|
// std::exit(1); |
|
|
// } |
|
|
// |
|
|
// if(K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]==0 |
|
|
// 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],(*T).reference()),*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); |
|
|
// } else { |
|
|
// if(vertexInTriangles.size()>3 and |
|
|
// K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==2) { |
|
|
// //two edge cut but twice |
|
|
// ffout(4)<<"createNotIn2\n"; |
|
|
// __createNotIn2(K,*i, triangleListIntersectionNew); |
|
|
// } else { |
|
|
// if(K.edgecut[0]!=0) { |
|
|
// if(K.pointsIntersection[0][0]==&V0 |
|
|
// or K.pointsIntersection[0][0]==&V1 |
|
|
// or K.pointsIntersection[0][0]==&V2 or vertexInTriangles.size()==1) { |
|
|
// // ffout(4)<<"**********normal\n"; |
|
|
// } else { |
|
|
// if(K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==3 |
|
|
// and K.edgecut[0][1]+K.edgecut[1][1]+K.edgecut[2][1]==3) { |
|
|
// if(K.pointsIntersection[0][1]==K.pointsIntersection[0][0]) { |
|
|
// K.edgecut[0][0]=0; |
|
|
// K.edgecut[0][1]=0; |
|
|
// } |
|
|
// if(K.pointsIntersection[1][1]==K.pointsIntersection[1][0]) { |
|
|
// K.edgecut[1][0]=0; |
|
|
// K.edgecut[1][1]=0; |
|
|
// } |
|
|
// if(K.pointsIntersection[2][1]==K.pointsIntersection[2][0]) { |
|
|
// K.edgecut[2][0]=0; |
|
|
// K.edgecut[2][1]=0; |
|
|
// } |
|
|
// if(vertexInTriangles.size()>3 and |
|
|
// K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==2){ |
|
|
// ffout(4)<<"hhhhhhhh\n"; |
|
|
// __createNotIn2(K,*i,triangleListIntersectionNew); |
|
|
// } else { |
|
|
// if(vertexInTriangles.size()>3 and |
|
|
// K.edgecut[0][0]+K.edgecut[1][0]+K.edgecut[2][0]==1) { |
|
|
// ffout(4)<<"case\n"; |
|
|
// __createNotIn(K,*i,triangleListIntersectionNew); |
|
|
// } |
|
|
// } |
|
|
// } 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"; |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// } 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"; |
|
|
// } |
|
|
// } else { |
|
|
// if(K.edgecut[2]!=0) { |
|
|
// if(K.pointsIntersection[2][0]==&V0 |
|
|
// or K.pointsIntersection[2][0]==&V1 |
|
|
// or K.pointsIntersection[2][0]==&V2 or vertexInTriangles.size()<3) { |
|
|
// //ffout(4)<<"**********normal\n"; |
|
|
// } else { |
|
|
// ffout(4)<<"triangle cut but outside3\n"; |
|
|
// ffout(4)<<V0<<"\n"; |
|
|
// ffout(4)<<V1<<"\n"; |
|
|
// ffout(4)<<V2<<"\n"; |
|
|
// ffout(4)<<"nb points inter "<<vertexInTriangles.size()<<"\n"; |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// 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); |
|
|
// } else { |
|
|
// //ffout(4)<<"j ajoute le tr car pas d'intersection dans les 2 listes\n"; |
|
|
//#warning Reference not set. |
|
|
// __addTriangle(Triangle(V0,V1,V2,(*T).reference()),*i,triangleListIntersectionNew); |
|
|
// } |
|
|
// } |
|
|
// } |
|
2516 |
} |
} |
2517 |
} |
} |
2518 |
} |
} |
2882 |
++itcell; |
++itcell; |
2883 |
} |
} |
2884 |
} else { |
} else { |
2885 |
ffout(4)<<"------jobDone false\n"; |
ffout(3)<<"------jobDone false\n"; |
2886 |
SurfaceMeshGenerator::Internals::MotherCellList::iterator itcell |
SurfaceMeshGenerator::Internals::MotherCellList::iterator itcell |
2887 |
=cellList.begin(); |
=cellList.begin(); |
2888 |
for (EdgePairList::iterator t = localTriangleList.begin(); |
for (EdgePairList::iterator t = localTriangleList.begin(); |
3201 |
__marchingTetrahedra(SMesh, *o, 0); |
__marchingTetrahedra(SMesh, *o, 0); |
3202 |
|
|
3203 |
objectStack.push(o); |
objectStack.push(o); |
3204 |
ffout(4) << "Marching cube sur " << objectStack.top() << '\n'; |
ffout(3) << "Marching cube sur " << objectStack.top() << '\n'; |
3205 |
} |
} |
3206 |
} |
} |
3207 |
|
|
3360 |
sortie<<" \n"; |
sortie<<" \n"; |
3361 |
sortie<<"Triangles"<<"\n"; |
sortie<<"Triangles"<<"\n"; |
3362 |
sortie<<s_mesh.numberOfCells()<<"\n"; |
sortie<<s_mesh.numberOfCells()<<"\n"; |
3363 |
ffout(4)<<"fin ecriture vertex\n"; |
ffout(3)<<"fin ecriture vertex\n"; |
3364 |
for (size_t i=0; i<s_mesh.numberOfCells(); ++i) { |
for (size_t i=0; i<s_mesh.numberOfCells(); ++i) { |
3365 |
const Triangle& T = s_mesh.cell(i); |
const Triangle& T = s_mesh.cell(i); |
3366 |
// 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"; |
3367 |
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; |
3368 |
|
|
3369 |
// 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"; |
3375 |
// sortie<<" 4"<<"\n"; |
// sortie<<" 4"<<"\n"; |
3376 |
sortie << " " << T.reference() << '\n'; |
sortie << " " << T.reference() << '\n'; |
3377 |
} |
} |
3378 |
ffout(4)<<"fin ecriture triangles\n"; |
ffout(3)<<"fin ecriture triangles\n"; |
3379 |
sortie<<" \n"; |
sortie<<" \n"; |
3380 |
sortie<<"Hexahedra"<<"\n"; |
sortie<<"Hexahedra"<<"\n"; |
3381 |
sortie<<toTreatHexahedra.size()<<" \n"; |
sortie<<toTreatHexahedra.size()<<" \n"; |
3383 |
for(size_t i=0;i<toTreatHexahedra.size();i++) |
for(size_t i=0;i<toTreatHexahedra.size();i++) |
3384 |
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"; |
3385 |
sortie<<"End"<<" \n"; |
sortie<<"End"<<" \n"; |
3386 |
ffout(4)<<"fin ecriture intersection.mesh\n"; |
ffout(3)<<"fin ecriture intersection.mesh\n"; |
3387 |
} |
} |