mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +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:
parent
33cc703b16
commit
1406e955b3
@ -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);
|
||||
|
||||
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);
|
||||
|
20
tests/bugs/modalg_6/bug28626_1
Normal file
20
tests/bugs/modalg_6/bug28626_1
Normal file
@ -0,0 +1,20 @@
|
||||
puts "========"
|
||||
puts "OCC28626"
|
||||
puts "========"
|
||||
puts ""
|
||||
####################################################################################
|
||||
## Boolean CUT operation fails due to exception while intersecting two conical faces
|
||||
####################################################################################
|
||||
|
||||
restore [locate_data_file bug28626_case1_shapes.brep] b
|
||||
explode b
|
||||
|
||||
bcut result b_1 b_2
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -solid 1 -shell 1 -face 10 -wire 10 -edge 20 -vertex 12
|
||||
|
||||
checkmaxtol result -ref 8.00001e-007
|
||||
|
||||
checkprops result -v 1.35999e+006
|
27
tests/bugs/modalg_6/bug28626_2
Normal file
27
tests/bugs/modalg_6/bug28626_2
Normal file
@ -0,0 +1,27 @@
|
||||
puts "========"
|
||||
puts "OCC28626"
|
||||
puts "========"
|
||||
puts ""
|
||||
####################################################################################
|
||||
## Boolean CUT operation fails due to exception while intersecting two conical faces
|
||||
####################################################################################
|
||||
|
||||
cone c1 0 0 0 0 -1 0 45 0
|
||||
cone c2 -23 -20 10 1 0 0 45 0
|
||||
trimv tc1 c1 0 42.4264068711929
|
||||
trimv tc2 c2 0 42.4264068711929
|
||||
mkface f1 tc1
|
||||
mkface f2 tc2
|
||||
donly f1 f2
|
||||
fit
|
||||
|
||||
bop f1 f2
|
||||
bopsection result
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -edge 2 -vertex 3
|
||||
|
||||
checkmaxtol result -ref 5.21731e-007
|
||||
|
||||
checkprops result -l 88.9692
|
27
tests/bugs/modalg_6/bug28626_3
Normal file
27
tests/bugs/modalg_6/bug28626_3
Normal file
@ -0,0 +1,27 @@
|
||||
puts "========"
|
||||
puts "OCC28626"
|
||||
puts "========"
|
||||
puts ""
|
||||
####################################################################################
|
||||
## Boolean CUT operation fails due to exception while intersecting two conical faces
|
||||
####################################################################################
|
||||
|
||||
cone c1 0 0 0 0 -1 0 45 0
|
||||
cone c2 -22 -20 10 1 0 0 45 0
|
||||
trimv tc1 c1 0 42.4264068711929
|
||||
trimv tc2 c2 0 42.4264068711929
|
||||
mkface f1 tc1
|
||||
mkface f2 tc2
|
||||
donly f1 f2
|
||||
fit
|
||||
|
||||
bop f1 f2
|
||||
bopsection result
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -edge 5 -vertex 6
|
||||
|
||||
checkmaxtol result -ref 6.02982e-007
|
||||
|
||||
checkprops result -l 94.3164
|
Loading…
x
Reference in New Issue
Block a user