1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0023765: The result of section operation contains redundant vertex.

Adding test case for this fix
Modified test cases regarding to 23765
This commit is contained in:
pkv
2013-04-17 15:29:29 +04:00
parent 06be28a4f1
commit 729d84d4f9
5 changed files with 71 additions and 19 deletions

View File

@@ -735,6 +735,7 @@ void IntTools_LineConstructor::TreatCircle(const Handle(IntPatch_Line)& aLine,
return;
}
//----------------------------------------
Standard_Boolean bFound;
Standard_Integer aNbVtx, aNbVtxWas, i;
Standard_Real aTolPC, aT, aT1, aT2, aTmid, aTwoPI, aTolPC1;
Standard_Real aU1, aV1, aU2, aV2;
@@ -747,6 +748,7 @@ void IntTools_LineConstructor::TreatCircle(const Handle(IntPatch_Line)& aLine,
aTwoPI=M_PI+M_PI;
aTolPC=Precision::PConfusion();
aNbVtxWas=GeomInt_LineTool::NbVertex(aLine);
aNbVtx=aNbVtxWas+2;
//-------------------------------------2
aTS1=myHS1->GetType();
@@ -761,7 +763,7 @@ void IntTools_LineConstructor::TreatCircle(const Handle(IntPatch_Line)& aLine,
pVtx=new IntTools_RealWithFlag [aNbVtx];
//
pVtx[0].SetValue(0.);
pVtx[1].SetValue(2.*M_PI);
pVtx[1].SetValue(aTwoPI);
//
for(i=1; i<=aNbVtxWas; ++i) {
aT=GeomInt_LineTool::Vertex(aLine, i).ParameterOnLine();
@@ -775,6 +777,27 @@ void IntTools_LineConstructor::TreatCircle(const Handle(IntPatch_Line)& aLine,
//
RejectDuplicates(aNbVtx, pVtx, aTolPC);
//
if ((aType==IntPatch_Circle || aType==IntPatch_Ellipse)&& aNbVtx>2) { // zz
bFound=Standard_False;
for(i=1; i<=aNbVtxWas; ++i) {
aT=GeomInt_LineTool::Vertex(aLine, i).ParameterOnLine();
if (fabs(aT) < aTolPC1 || fabs(aT-aTwoPI) < aTolPC1) {
bFound=!bFound;
break;
}
}
if (!bFound) {
aT=pVtx[1].Value()+aTwoPI;
pVtx[aNbVtx-1].SetValue(aT);
//
for(i=0; i<aNbVtx; ++i) {
aT=pVtx[i+1].Value();
pVtx[i].SetValue(aT);
}
--aNbVtx;
}
}
//
for(i=0; i<aNbVtx-1; ++i) {
aT1=pVtx[i].Value();
aT2=pVtx[i+1].Value();