101 |
static bool compute(const Cell& C) |
static bool compute(const Cell& C) |
102 |
{ |
{ |
103 |
for (size_t i=0; i<C.numberOfVertices(); ++i) { |
for (size_t i=0; i<C.numberOfVertices(); ++i) { |
104 |
if(C(i).Ref()==0) |
if(C(i).reference()==0) |
105 |
return false; |
return false; |
106 |
} |
} |
107 |
return true; |
return true; |
113 |
static bool compute(const Cell& C) |
static bool compute(const Cell& C) |
114 |
{ |
{ |
115 |
for (size_t i=0; i<C.numberOfVertices(); ++i) { |
for (size_t i=0; i<C.numberOfVertices(); ++i) { |
116 |
if(C(i).Ref()==2) { |
if(C(i).reference()==2) { |
117 |
return false; |
return false; |
118 |
} |
} |
119 |
} |
} |
514 |
int out = -1; // same thing for outside |
int out = -1; // same thing for outside |
515 |
|
|
516 |
for (int j=0; j<2; j++) { |
for (int j=0; j<2; j++) { |
517 |
if (e(j).Ref() != 1) { |
if (e(j).reference() != 1) { |
518 |
out = j; |
out = j; |
519 |
} else { |
} else { |
520 |
in = j; |
in = j; |
525 |
|
|
526 |
TinyVector<3> vi = e(in); |
TinyVector<3> vi = e(in); |
527 |
TinyVector<3> vo = e(out); |
TinyVector<3> vo = e(out); |
528 |
TinyVector<3> vs = (vi+vo)/2; |
TinyVector<3> vs = 0.5*(vi+vo); |
529 |
|
|
530 |
for (int l = 0; l<20; l++) { // 3% error after 5 iterations. |
for (int l = 0; l<20; l++) { // 3% error after 5 iterations. |
531 |
if(S.inside(vs)) { |
if(S.inside(vs)) { |
532 |
vi = vs; |
vi = vs; |
533 |
vs = (vo+vi)/2; |
vs = 0.5*(vo+vi); |
534 |
} else { |
} else { |
535 |
vo = vs; |
vo = vs; |
536 |
vs = (vo+vi)/2; |
vs = 0.5*(vo+vi); |
537 |
} |
} |
538 |
} |
} |
539 |
|
|
611 |
otherRef.resize(scene.nbObjects()); |
otherRef.resize(scene.nbObjects()); |
612 |
if (scene.object(n).reference() == ((*i).first)) { |
if (scene.object(n).reference() == ((*i).first)) { |
613 |
otherRef[n] = true; |
otherRef[n] = true; |
614 |
if (e(0).Ref() != e(1).Ref()) { |
if (e(0).reference() != e(1).reference()) { |
615 |
(*cutEdges[num]).push_back(&e); |
(*cutEdges[num]).push_back(&e); |
616 |
} |
} |
617 |
} |
} |
957 |
{ |
{ |
958 |
compt=0; |
compt=0; |
959 |
TinyVector<3,TinyVector<3,real_t> > triangleVector; |
TinyVector<3,TinyVector<3,real_t> > triangleVector; |
960 |
triangleVector[0]=-(*V[2]).Vector3() + (*V[0]).Vector3(); |
triangleVector[0]= -(*V[2]) + (*V[0]); |
961 |
triangleVector[1]= -(*V[2]).Vector3() + (*V[1]).Vector3(); |
triangleVector[1]= -(*V[2]) + (*V[1]); |
962 |
triangleVector[2]=P.Vector3()-(*V[2]).Vector3(); |
triangleVector[2]= P - (*V[2]); |
963 |
TinyVector<2,size_t> num; |
TinyVector<2,size_t> num; |
964 |
|
|
965 |
num[0]=0; |
num[0]=0; |
982 |
__EquationPlan(const TinyVector<3,const Vertex *> & V){ |
__EquationPlan(const TinyVector<3,const Vertex *> & V){ |
983 |
|
|
984 |
//equation of plan |
//equation of plan |
985 |
TinyVector<3> V01=(*V[1]).Vector3()-(*V[0]).Vector3(); |
TinyVector<3> V01=(*V[1])-(*V[0]); |
986 |
TinyVector<3> V12=(*V[2]).Vector3()-(*V[1]).Vector3(); |
TinyVector<3> V12=(*V[2])-(*V[1]); |
987 |
TinyVector<3> V02=(*V[2]).Vector3()-(*V[0]).Vector3(); |
TinyVector<3> V02=(*V[2])-(*V[0]); |
988 |
|
|
989 |
TinyVector<3> coeffo; |
TinyVector<3> coeffo; |
990 |
coeffo=V01^V02; |
coeffo=V01^V02; |
991 |
real_t d2 = -(coeffo*(*V[0]).Vector3()); |
real_t d2 = -(coeffo*(*V[0])); |
992 |
|
|
993 |
TinyVector<4> coeff; |
TinyVector<4> coeff; |
994 |
coeff[0]=coeffo[0]; |
coeff[0]=coeffo[0]; |
1019 |
coeff[2]=coeffo[2]; |
coeff[2]=coeffo[2]; |
1020 |
real_t d=coeffo[3]; |
real_t d=coeffo[3]; |
1021 |
|
|
1022 |
TinyVector<3> Vo01 = (*Vo1).Vector3() - (*Vo0).Vector3(); |
TinyVector<3> Vo01 = (*Vo1) - (*Vo0); |
1023 |
TinyVector<3> V01 = (*V[1]).Vector3() - (*V[0]).Vector3(); |
TinyVector<3> V01 = (*V[1]) - (*V[0]); |
1024 |
TinyVector<3> V12 = (*V[2]).Vector3() - (*V[1]).Vector3(); |
TinyVector<3> V12 = (*V[2]) - (*V[1]); |
1025 |
TinyVector<3> V02 = (*V[2]).Vector3() - (*V[0]).Vector3(); |
TinyVector<3> V02 = (*V[2]) - (*V[0]); |
1026 |
|
|
1027 |
real_t norm1=Norm(Vo01); |
real_t norm1=Norm(Vo01); |
1028 |
pscalar=coeff*Vo01; |
pscalar=coeff*Vo01; |
1029 |
num=0; |
num=0; |
1030 |
if(std::abs(pscalar)>1e-10) { |
if(std::abs(pscalar)>1e-10) { |
1031 |
k=-(coeff*(*Vo0).Vector3()+d)/pscalar; |
k=-(coeff*(*Vo0)+d)/pscalar; |
1032 |
P=(*Vo0)+k*Vo01; |
P=(*Vo0)+k*Vo01; |
1033 |
|
|
1034 |
TinyVector<3> V0P=P.Vector3()-(*V[0]).Vector3(); |
TinyVector<3> V0P=P-(*V[0]); |
1035 |
TinyVector<3> V1P=P.Vector3()-(*V[1]).Vector3(); |
TinyVector<3> V1P=P-(*V[1]); |
1036 |
TinyVector<3> V2P=P.Vector3()-(*V[2]).Vector3(); |
TinyVector<3> V2P=P-(*V[2]); |
1037 |
|
|
1038 |
real_t norm2=Norm(P.Vector3()-(*Vo0).Vector3()); |
real_t norm2=Norm(P-(*Vo0)); |
1039 |
real_t norm3=Norm(P.Vector3()-(*Vo1).Vector3()); |
real_t norm3=Norm(P-(*Vo1)); |
1040 |
real_t inV01=Norm(V01^V0P); |
real_t inV01=Norm(V01^V0P); |
1041 |
real_t inV12=Norm(V12^V1P); |
real_t inV12=Norm(V12^V1P); |
1042 |
real_t inV02=Norm(V02^V2P); |
real_t inV02=Norm(V02^V2P); |
1053 |
} else |
} else |
1054 |
if(listVertexIntersectionNew.find(pV)==listVertexIntersectionNew.end() |
if(listVertexIntersectionNew.find(pV)==listVertexIntersectionNew.end() |
1055 |
and listVertexIntersectionNew.find(pV2)==listVertexIntersectionNew.end()) { |
and listVertexIntersectionNew.find(pV2)==listVertexIntersectionNew.end()) { |
1056 |
listVertexIntersectionNew[pV][0]=new Vertex (P.Vector3()); |
listVertexIntersectionNew[pV][0]=new Vertex (P); |
1057 |
listVertexIntersectionNew[pV][1]=new Vertex (P.Vector3()); |
listVertexIntersectionNew[pV][1]=new Vertex (P); |
1058 |
Pinter.addPoint(listVertexIntersectionNew[pV][0]); |
Pinter.addPoint(listVertexIntersectionNew[pV][0]); |
1059 |
} else { |
} else { |
1060 |
if(listVertexIntersectionNew.find(pV)!=listVertexIntersectionNew.end()) { |
if(listVertexIntersectionNew.find(pV)!=listVertexIntersectionNew.end()) { |
1061 |
if(Norm((*(*listVertexIntersectionNew.find(pV)).second[0]).Vector3() |
if(Norm((*(*listVertexIntersectionNew.find(pV)).second[0]) |
1062 |
-P.Vector3())<1e-6) { |
-P)<1e-6) { |
1063 |
Pinter.addPoint((*listVertexIntersectionNew.find(pV)).second[0]); |
Pinter.addPoint((*listVertexIntersectionNew.find(pV)).second[0]); |
1064 |
} else |
} else |
1065 |
if(Norm((*(*listVertexIntersectionNew.find(pV)).second[1]).Vector3() |
if(Norm((*(*listVertexIntersectionNew.find(pV)).second[1]) |
1066 |
-P.Vector3())<1e-6) { |
-P)<1e-6) { |
1067 |
Pinter.addPoint((*listVertexIntersectionNew.find(pV)).second[1]); |
Pinter.addPoint((*listVertexIntersectionNew.find(pV)).second[1]); |
1068 |
} else { |
} else { |
1069 |
listVertexIntersectionNew[pV][1]=new Vertex (P.Vector3()); |
listVertexIntersectionNew[pV][1]=new Vertex (P); |
1070 |
Pinter.addPoint(listVertexIntersectionNew[pV][1]); |
Pinter.addPoint(listVertexIntersectionNew[pV][1]); |
1071 |
} |
} |
1072 |
} else { |
} else { |
1073 |
if(Norm((*(*listVertexIntersectionNew.find(pV2)).second[0]).Vector3() |
if(Norm((*(*listVertexIntersectionNew.find(pV2)).second[0]) |
1074 |
-P.Vector3())<1e-6) { |
-P)<1e-6) { |
1075 |
Pinter.addPoint((*listVertexIntersectionNew.find(pV2)).second[0]); |
Pinter.addPoint((*listVertexIntersectionNew.find(pV2)).second[0]); |
1076 |
} else |
} else |
1077 |
if(Norm((*(*listVertexIntersectionNew.find(pV2)).second[1]).Vector3() |
if(Norm((*(*listVertexIntersectionNew.find(pV2)).second[1]) |
1078 |
-P.Vector3())<1e-6) { |
-P)<1e-6) { |
1079 |
Pinter.addPoint((*listVertexIntersectionNew.find(pV2)).second[1]); |
Pinter.addPoint((*listVertexIntersectionNew.find(pV2)).second[1]); |
1080 |
} else { |
} else { |
1081 |
listVertexIntersectionNew[pV2][1]=new Vertex (P.Vector3()); |
listVertexIntersectionNew[pV2][1]=new Vertex (P); |
1082 |
Pinter.addPoint(listVertexIntersectionNew[pV2][1]); |
Pinter.addPoint(listVertexIntersectionNew[pV2][1]); |
1083 |
} |
} |
1084 |
} |
} |
1090 |
__InTriangle(P,V,num); |
__InTriangle(P,V,num); |
1091 |
if(num==3) { |
if(num==3) { |
1092 |
//ffout(0)<<"ajout du point cas 2\n"; |
//ffout(0)<<"ajout du point cas 2\n"; |
1093 |
//ffout(0)<<P.Vector3()[0]<<" "<<P.Vector3()[1]<<" "<<P.Vector3()[2]<<" \n"; |
//ffout(0)<<P[0]<<" "<<P[1]<<" "<<P[2]<<" \n"; |
1094 |
//listVertexIntersectionNew.push_back(new Vertex (P.Vector3())); |
//listVertexIntersectionNew.push_back(new Vertex (P)); |
1095 |
PIntersection PIn; |
PIntersection PIn; |
1096 |
if(!(norm2>epsilon)) { |
if(!(norm2>epsilon)) { |
1097 |
Pinter.addPoint(Vo0); |
Pinter.addPoint(Vo0); |
1101 |
} else { |
} else { |
1102 |
if(listVertexIntersectionNew.find(pV)==listVertexIntersectionNew.end() |
if(listVertexIntersectionNew.find(pV)==listVertexIntersectionNew.end() |
1103 |
and listVertexIntersectionNew.find(pV2)==listVertexIntersectionNew.end()) { |
and listVertexIntersectionNew.find(pV2)==listVertexIntersectionNew.end()) { |
1104 |
listVertexIntersectionNew[pV][0]=new Vertex (P.Vector3()); |
listVertexIntersectionNew[pV][0]=new Vertex (P); |
1105 |
listVertexIntersectionNew[pV][1]=new Vertex (P.Vector3()); |
listVertexIntersectionNew[pV][1]=new Vertex (P); |
1106 |
Pinter.addPoint(listVertexIntersectionNew[pV][0]); |
Pinter.addPoint(listVertexIntersectionNew[pV][0]); |
1107 |
} else { |
} else { |
1108 |
if(listVertexIntersectionNew.find(pV)!=listVertexIntersectionNew.end()) { |
if(listVertexIntersectionNew.find(pV)!=listVertexIntersectionNew.end()) { |
1109 |
if(Norm((*(*listVertexIntersectionNew.find(pV)).second[0]).Vector3() |
if(Norm((*(*listVertexIntersectionNew.find(pV)).second[0]) |
1110 |
-P.Vector3())<1e-6) { |
-P)<1e-6) { |
1111 |
Pinter.addPoint((*listVertexIntersectionNew.find(pV)).second[0]); |
Pinter.addPoint((*listVertexIntersectionNew.find(pV)).second[0]); |
1112 |
} else { |
} else { |
1113 |
if(Norm((*(*listVertexIntersectionNew.find(pV)).second[1]).Vector3() |
if(Norm((*(*listVertexIntersectionNew.find(pV)).second[1]) |
1114 |
-P.Vector3())<1e-6) { |
-P)<1e-6) { |
1115 |
Pinter.addPoint((*listVertexIntersectionNew.find(pV)).second[1]); |
Pinter.addPoint((*listVertexIntersectionNew.find(pV)).second[1]); |
1116 |
} else { |
} else { |
1117 |
listVertexIntersectionNew[pV][1]=new Vertex (P.Vector3()); |
listVertexIntersectionNew[pV][1]=new Vertex (P); |
1118 |
Pinter.addPoint(listVertexIntersectionNew[pV][1]); |
Pinter.addPoint(listVertexIntersectionNew[pV][1]); |
1119 |
} |
} |
1120 |
} |
} |
1121 |
} else { |
} else { |
1122 |
if(Norm((*(*listVertexIntersectionNew.find(pV2)).second[0]).Vector3() |
if(Norm((*(*listVertexIntersectionNew.find(pV2)).second[0]) |
1123 |
-P.Vector3())<1e-6) { |
-P)<1e-6) { |
1124 |
Pinter.addPoint((*listVertexIntersectionNew.find(pV2)).second[0]); |
Pinter.addPoint((*listVertexIntersectionNew.find(pV2)).second[0]); |
1125 |
} else { |
} else { |
1126 |
if(Norm((*(*listVertexIntersectionNew.find(pV2)).second[1]).Vector3() |
if(Norm((*(*listVertexIntersectionNew.find(pV2)).second[1]) |
1127 |
-P.Vector3())<1e-6) { |
-P)<1e-6) { |
1128 |
Pinter.addPoint((*listVertexIntersectionNew.find(pV2)).second[1]); |
Pinter.addPoint((*listVertexIntersectionNew.find(pV2)).second[1]); |
1129 |
} else { |
} else { |
1130 |
listVertexIntersectionNew[pV2][1]=new Vertex (P.Vector3()); |
listVertexIntersectionNew[pV2][1]=new Vertex (P); |
1131 |
Pinter.addPoint(listVertexIntersectionNew[pV2][1]); |
Pinter.addPoint(listVertexIntersectionNew[pV2][1]); |
1132 |
} |
} |
1133 |
} |
} |
1185 |
|
|
1186 |
if(refVertex0+refVertex1==4 and edgeCut==1) { |
if(refVertex0+refVertex1==4 and edgeCut==1) { |
1187 |
ffout(1)<<"warning edge ref 2 cut \n"; |
ffout(1)<<"warning edge ref 2 cut \n"; |
1188 |
ffout(1)<<(*V0).Vector3()[0]<<" "<<(*V0).Vector3()[1]<<" "<<(*V0).Vector3()[2]<<" \n"; |
ffout(1)<<(*V0)[0]<<" "<<(*V0)[1]<<" "<<(*V0)[2]<<" \n"; |
1189 |
ffout(1)<<(*V1).Vector3()[0]<<" "<<(*V1).Vector3()[1]<<" "<<(*V1).Vector3()[2]<<" \n"; |
ffout(1)<<(*V1)[0]<<" "<<(*V1)[1]<<" "<<(*V1)[2]<<" \n"; |
1190 |
refVertex0=0; |
refVertex0=0; |
1191 |
refVertex1=0; |
refVertex1=0; |
1192 |
} else { |
} else { |
1241 |
const Vertex& Vo2 = To(2); |
const Vertex& Vo2 = To(2); |
1242 |
const Vertex& P=*(pairTriangleToIntersectionPoints[pTriangle].listofPoints[i]); |
const Vertex& P=*(pairTriangleToIntersectionPoints[pTriangle].listofPoints[i]); |
1243 |
|
|
1244 |
real_t Vo01=Norm(Vo1.Vector3()-Vo0.Vector3()); |
real_t Vo01=Norm(Vo1-Vo0); |
1245 |
real_t Vo12=Norm(Vo2.Vector3()-Vo1.Vector3()); |
real_t Vo12=Norm(Vo2-Vo1); |
1246 |
real_t Vo02=Norm(Vo2.Vector3()-Vo0.Vector3()); |
real_t Vo02=Norm(Vo2-Vo0); |
1247 |
real_t norm0=Norm(P.Vector3()-Vo0.Vector3()); |
real_t norm0=Norm(P-Vo0); |
1248 |
real_t norm1=Norm(P.Vector3()-Vo1.Vector3()); |
real_t norm1=Norm(P-Vo1); |
1249 |
real_t norm2=Norm(P.Vector3()-Vo2.Vector3()); |
real_t norm2=Norm(P-Vo2); |
1250 |
//for filter points |
//for filter points |
1251 |
//real_t eps=1e-10; |
//real_t eps=1e-10; |
1252 |
if(/*norm0>eps and norm1>eps and*/ std::abs((norm0+norm1)-Vo01)<epsilon) { |
if(/*norm0>eps and norm1>eps and*/ std::abs((norm0+norm1)-Vo01)<epsilon) { |
1353 |
__addTriangle(A,B,C,cell); |
__addTriangle(A,B,C,cell); |
1354 |
} else { |
} else { |
1355 |
ffout(0) <<"pbs 10\n"<<std::flush; |
ffout(0) <<"pbs 10\n"<<std::flush; |
1356 |
ffout(0)<<V0.Vector3()<<"\n"; |
ffout(0)<<V0<<"\n"; |
1357 |
ffout(0)<<V1.Vector3()<<"\n"; |
ffout(0)<<V1<<"\n"; |
1358 |
ffout(0)<<V2.Vector3()<<"\n"; |
ffout(0)<<V2<<"\n"; |
1359 |
} |
} |
1360 |
} else { |
} else { |
1361 |
if(edgesCut[1]==1) { |
if(edgesCut[1]==1) { |
1362 |
ffout(0)<<"pbs 11\n"<<std::flush; |
ffout(0)<<"pbs 11\n"<<std::flush; |
1363 |
ffout(0)<<V0.Vector3()<<"\n"; |
ffout(0)<<V0<<"\n"; |
1364 |
ffout(0)<<V1.Vector3()<<"\n"; |
ffout(0)<<V1<<"\n"; |
1365 |
ffout(0)<<V2.Vector3()<<"\n"; |
ffout(0)<<V2<<"\n"; |
1366 |
ffout(0)<<ncase<<"\n"; |
ffout(0)<<ncase<<"\n"; |
1367 |
ffout(0)<<__determinateNumber(vertexNum[1],pointsIntersection)<<"\n"; |
ffout(0)<<__determinateNumber(vertexNum[1],pointsIntersection)<<"\n"; |
1368 |
} else { |
} else { |
1382 |
__addTriangle(A,D,C,cell); |
__addTriangle(A,D,C,cell); |
1383 |
} else { |
} else { |
1384 |
ffout(0)<<"-------- warning trou in 0\n"<<std::flush; |
ffout(0)<<"-------- warning trou in 0\n"<<std::flush; |
1385 |
ffout(0)<<V0.Vector3()<<"\n"; |
ffout(0)<<V0<<"\n"; |
1386 |
ffout(0)<<V1.Vector3()<<"\n"; |
ffout(0)<<V1<<"\n"; |
1387 |
ffout(0)<<V2.Vector3()<<"\n"; |
ffout(0)<<V2<<"\n"; |
1388 |
__addTriangle(A,B,D,cell); |
__addTriangle(A,B,D,cell); |
1389 |
} |
} |
1390 |
} else { |
} else { |
1403 |
//a faire si plus d' 1 point d'intersection pas dans le triangle |
//a faire si plus d' 1 point d'intersection pas dans le triangle |
1404 |
ffout(0) << numberPointsInterior<<" be careful 1\n"<<std::flush; |
ffout(0) << numberPointsInterior<<" be careful 1\n"<<std::flush; |
1405 |
//POUR STEPH : peut generer des tr plats |
//POUR STEPH : peut generer des tr plats |
1406 |
// ffout(0)<<V0.Vector3()<<"\n"; |
// ffout(0)<<V0<<"\n"; |
1407 |
// ffout(0)<<V1.Vector3()<<"\n"; |
// ffout(0)<<V1<<"\n"; |
1408 |
// ffout(0)<<V2.Vector3()<<"\n"; |
// ffout(0)<<V2<<"\n"; |
1409 |
__createByEdges(K,cell); |
__createByEdges(K,cell); |
1410 |
} |
} |
1411 |
} |
} |
1477 |
__addTriangle(A,B,C,cell); |
__addTriangle(A,B,C,cell); |
1478 |
} else { |
} else { |
1479 |
ffout(0) <<"pbs 21\n"<<std::flush; |
ffout(0) <<"pbs 21\n"<<std::flush; |
1480 |
ffout(0)<<V0.Vector3()<<"\n"; |
ffout(0)<<V0<<"\n"; |
1481 |
ffout(0)<<V1.Vector3()<<"\n"; |
ffout(0)<<V1<<"\n"; |
1482 |
ffout(0)<<V2.Vector3()<<"\n"; |
ffout(0)<<V2<<"\n"; |
1483 |
} |
} |
1484 |
} |
} |
1485 |
break; |
break; |
1513 |
default: { |
default: { |
1514 |
//POUR STEPH : peut generer des tr plats |
//POUR STEPH : peut generer des tr plats |
1515 |
ffout(0) << numberPointsInterior <<"be careful 2\n"<<std::flush; |
ffout(0) << numberPointsInterior <<"be careful 2\n"<<std::flush; |
1516 |
// ffout(0)<<V0.Vector3()<<"\n"; |
// ffout(0)<<V0<<"\n"; |
1517 |
// ffout(0)<<V1.Vector3()<<"\n"; |
// ffout(0)<<V1<<"\n"; |
1518 |
// ffout(0)<<V2.Vector3()<<"\n"; |
// ffout(0)<<V2<<"\n"; |
1519 |
TinyVector<10,const Vertex*> P,Ptemp; |
TinyVector<10,const Vertex*> P,Ptemp; |
1520 |
size_t i=0; |
size_t i=0; |
1521 |
for(std::map<const Vertex*,const Vertex*>::const_iterator it=pointsInterior.begin(); |
for(std::map<const Vertex*,const Vertex*>::const_iterator it=pointsInterior.begin(); |
1537 |
size_t size=numberPointsInterior+1; |
size_t size=numberPointsInterior+1; |
1538 |
for(size_t boucle=0 ; boucle<numberPointsInterior-1 ; ++boucle) { |
for(size_t boucle=0 ; boucle<numberPointsInterior-1 ; ++boucle) { |
1539 |
size_t num=1; |
size_t num=1; |
1540 |
real_t norm=Norm((*P[0]).Vector3()-(*P[1]).Vector3()); |
real_t norm=Norm((*P[0])-(*P[1])); |
1541 |
for(size_t i=2 ; i<size ; ++i) { |
for(size_t i=2 ; i<size ; ++i) { |
1542 |
real_t normtemp=Norm((*P[0]).Vector3()-(*P[i]).Vector3()); |
real_t normtemp=Norm((*P[0])-(*P[i])); |
1543 |
if(normtemp<=norm) { |
if(normtemp<=norm) { |
1544 |
norm=normtemp; |
norm=normtemp; |
1545 |
Ptemp[i-1]=P[num]; |
Ptemp[i-1]=P[num]; |
2169 |
for (std::set<const Cell*>::iterator icell = hexaListIn.begin(); icell != hexaListIn.end(); ++icell) { |
for (std::set<const Cell*>::iterator icell = hexaListIn.begin(); icell != hexaListIn.end(); ++icell) { |
2170 |
Cell& C = const_cast<Cell&>(*(*icell)); |
Cell& C = const_cast<Cell&>(*(*icell)); |
2171 |
for (size_t i=0; i<C.numberOfVertices(); ++i) { |
for (size_t i=0; i<C.numberOfVertices(); ++i) { |
2172 |
C(i).Ref() = ((*O1.shape()).inside(C(i))?1:0) |
C(i).reference() = ((*O1.shape()).inside(C(i))?1:0) |
2173 |
+ ((*O2.shape()).inside(C(i))?1:0); |
+ ((*O2.shape()).inside(C(i))?1:0); |
2174 |
} |
} |
2175 |
|
|
2266 |
TinyVector<3> B(-0.0263158, 0.319152, -0.187573); |
TinyVector<3> B(-0.0263158, 0.319152, -0.187573); |
2267 |
TinyVector<3> C(0.0315867, 0.179403, -0.0627097); |
TinyVector<3> C(0.0315867, 0.179403, -0.0627097); |
2268 |
real_t ee=1e-5; |
real_t ee=1e-5; |
2269 |
if((Norm(V0.Vector3()-A)<=ee or Norm(V1.Vector3()-A)<=ee or Norm(V2.Vector3()-A)<=ee) |
if((Norm(V0-A)<=ee or Norm(V1-A)<=ee or Norm(V2-A)<=ee) |
2270 |
and (Norm(V0.Vector3()-B)<=ee or Norm(V1.Vector3()-B)<=ee or Norm(V2.Vector3()-B)<=ee) |
and (Norm(V0-B)<=ee or Norm(V1-B)<=ee or Norm(V2-B)<=ee) |
2271 |
and (Norm(V0.Vector3()-C)<=ee or Norm(V1.Vector3()-C)<=ee or Norm(V2.Vector3()-C)<=ee)) { |
and (Norm(V0-C)<=ee or Norm(V1-C)<=ee or Norm(V2-C)<=ee)) { |
2272 |
ffout(0)<<"*****************\n"; |
ffout(0)<<"*****************\n"; |
2273 |
ffout(0)<<V0<<"\n"; |
ffout(0)<<V0<<"\n"; |
2274 |
ffout(0)<<V1<<"\n"; |
ffout(0)<<V1<<"\n"; |
2458 |
std::vector<TinyVector<3> > V(cutEdges.size()); |
std::vector<TinyVector<3> > V(cutEdges.size()); |
2459 |
for(size_t i=0; i<cutEdges.size(); ++i) { |
for(size_t i=0; i<cutEdges.size(); ++i) { |
2460 |
const Edge& e = *cutEdges[i]; |
const Edge& e = *cutEdges[i]; |
2461 |
if(e(0).Ref() == 1) { |
if(e(0).reference() == 1) { |
2462 |
V[i] = (e(0).Vector3() - e(1).Vector3()); |
V[i] = (e(0) - e(1)); |
2463 |
} else { |
} else { |
2464 |
V[i] = (e(1).Vector3() - e(0).Vector3()); |
V[i] = (e(1) - e(0)); |
2465 |
} |
} |
2466 |
} |
} |
2467 |
|
|
2502 |
std::map<Edge::Pair, const Edge*>::iterator currentCutEdge=cutEdgesMap.begin(); |
std::map<Edge::Pair, const Edge*>::iterator currentCutEdge=cutEdgesMap.begin(); |
2503 |
for (size_t i=0; i<V.size(); ++i) { |
for (size_t i=0; i<V.size(); ++i) { |
2504 |
const Edge& e = *(*currentCutEdge).second; |
const Edge& e = *(*currentCutEdge).second; |
2505 |
if(e(0).Ref() == 1) { |
if(e(0).reference() == 1) { |
2506 |
V[i] = (e(0).Vector3() - e(1).Vector3()); |
V[i] = (e(0) - e(1)); |
2507 |
} else { |
} else { |
2508 |
V[i] = (e(1).Vector3() - e(0).Vector3()); |
V[i] = (e(1) - e(0)); |
2509 |
} |
} |
2510 |
++currentCutEdge; |
++currentCutEdge; |
2511 |
} |
} |
2574 |
for (size_t i = 0; i<SMesh.nbEdges(); i++) { |
for (size_t i = 0; i<SMesh.nbEdges(); i++) { |
2575 |
Edge& e = SMesh.edge(i); |
Edge& e = SMesh.edge(i); |
2576 |
#warning THIS TEST IS NOT ENOUGH! THINK TO THE BORDER! |
#warning THIS TEST IS NOT ENOUGH! THINK TO THE BORDER! |
2577 |
if(e(0).Ref() != e(1).Ref()) { |
if(e(0).reference() != e(1).reference()) { |
2578 |
verticesListes[e] = new Vertex(__splitEdge(e, S)); |
verticesListes[e] = new Vertex(__splitEdge(e, S)); |
2579 |
edgesRef[e] = 1; |
edgesRef[e] = 1; |
2580 |
} |
} |
2670 |
*(currentAddedEdge) = Edge(currentCell(TverticesList[i1]), |
*(currentAddedEdge) = Edge(currentCell(TverticesList[i1]), |
2671 |
currentCell(TverticesList[i2+1])); |
currentCell(TverticesList[i2+1])); |
2672 |
Edge& e = (*currentAddedEdge); |
Edge& e = (*currentAddedEdge); |
2673 |
if (e(0).Ref() != e(1).Ref()) { |
if (e(0).reference() != e(1).reference()) { |
2674 |
e.Ref() = 1; |
e.reference() = 1; |
2675 |
edgesRef[e] = 1; |
edgesRef[e] = 1; |
2676 |
} |
} |
2677 |
currentAddedEdge++; |
currentAddedEdge++; |