mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0028626: Boolean CUT operation fails due to exception while intersecting two conical faces
1. Modification in static function IntersectionWithAnArc of IntPatch_ImpImpIntersection : small offset <du> was hardcoded as 1.e-9, now it is adapted to parametric step. 2. Removal of duplicated points of IntPatch_WLine is corrected.
This commit is contained in:
@@ -561,7 +561,7 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
||||
theALine->SituationS1(),
|
||||
theALine->SituationS2());
|
||||
}
|
||||
if(theALine->TransitionOnS1() == IntSurf_Undecided) {
|
||||
else if(theALine->TransitionOnS1() == IntSurf_Undecided) {
|
||||
aWLine = new IntPatch_WLine(aLinOn2S, theALine->IsTangent());
|
||||
}
|
||||
else {
|
||||
@@ -578,10 +578,14 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
||||
|
||||
aWLine->SetPeriod(anArrPeriods[0],anArrPeriods[1],anArrPeriods[2],anArrPeriods[3]);
|
||||
|
||||
//the method ComputeVertexParameters can reduce the number of points in <aWLine>
|
||||
aWLine->ComputeVertexParameters(myTol3D);
|
||||
|
||||
aWLine->EnablePurging(Standard_False);
|
||||
theLines.Append(aWLine);
|
||||
if (aWLine->NbPnts() > 1)
|
||||
{
|
||||
aWLine->EnablePurging(Standard_False);
|
||||
theLines.Append(aWLine);
|
||||
}
|
||||
}//while(aParameter < theLPar)
|
||||
}
|
||||
|
||||
|
@@ -111,6 +111,8 @@ Standard_Boolean IntersectionWithAnArc(gp_Pnt& PSurf,
|
||||
//-- recherche bete du point le plus proche de thearc->Value(...)
|
||||
dtheta = (u1alin-u0alin)*0.01;
|
||||
Standard_Real du=0.000000001;
|
||||
if (du >= dtheta)
|
||||
du = dtheta/2;
|
||||
Standard_Real distmin = RealLast();
|
||||
|
||||
Standard_Real thetamin = 0.;
|
||||
|
@@ -591,8 +591,13 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
|
||||
if(wline->NbVertex() == 0) {
|
||||
IntPatch_Point vtx;
|
||||
@@ -735,8 +740,13 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
|
||||
if(wline->NbVertex() == 0) {
|
||||
IntPatch_Point vtx;
|
||||
@@ -999,7 +1009,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
vtx.SetParameter(wline->NbPnts());
|
||||
wline->SetPoint(wline->NbPnts(),vtx);
|
||||
}
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf1,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
if(wline->NbVertex() == 0) {
|
||||
IntPatch_Point vtx;
|
||||
IntSurf_PntOn2S POn2S = PW.Line()->Value(1);
|
||||
@@ -1173,7 +1186,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
wline->SetPoint(wline->NbPnts(),vtx);
|
||||
}
|
||||
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf1,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
|
||||
if(wline->NbVertex() == 0) {
|
||||
IntPatch_Point vtx;
|
||||
@@ -1773,8 +1789,13 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
if (RestrictLine){
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
}
|
||||
|
||||
if(wline->NbVertex() == 0) {
|
||||
@@ -1921,8 +1942,13 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_HSurface)& S
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
return;
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
return;
|
||||
|
||||
//---------------
|
||||
if(wline->NbVertex() == 0) {
|
||||
@@ -1945,9 +1971,9 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_HSurface)& S
|
||||
//---------------
|
||||
SLin.Append(wline);
|
||||
empt = Standard_False;
|
||||
}
|
||||
}
|
||||
}
|
||||
} //if(PW.NbPoints()>2)
|
||||
} //if(PW.IsDone())
|
||||
} //if(HasStartPoint)
|
||||
}
|
||||
//==================================================================================
|
||||
// function : AdjustOnPeriodic
|
||||
@@ -2450,8 +2476,13 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
wline->EnablePurging(!hasBeenAdded);
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
if(wline->NbVertex() == 0)
|
||||
{
|
||||
IntPatch_Point vtx;
|
||||
@@ -2659,8 +2690,13 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
wline->EnablePurging(!hasBeenAdded);
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
|
||||
//---------------
|
||||
if(wline->NbVertex() == 0)
|
||||
@@ -2850,8 +2886,13 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
continue;
|
||||
|
||||
//---------------
|
||||
if(wline->NbVertex() == 0)
|
||||
|
@@ -580,7 +580,7 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol)
|
||||
if (Substitution)
|
||||
{
|
||||
Standard_Integer ind_point;
|
||||
for(ind_point = 2; (ind_point <= nbponline && nbponline > 2); ind_point++) {
|
||||
for(ind_point = 2; (ind_point <= nbponline && nbponline > 1); ind_point++) {
|
||||
Standard_Real d = (curv->Value(ind_point-1).Value()).SquareDistance((curv->Value(ind_point).Value()));
|
||||
if(d < dmini) {
|
||||
curv->RemovePoint(ind_point);
|
||||
|
Reference in New Issue
Block a user