diff --git a/src/BRepOffset/BRepOffset_Tool.cxx b/src/BRepOffset/BRepOffset_Tool.cxx index 38f21f0988..af3ac106e1 100644 --- a/src/BRepOffset/BRepOffset_Tool.cxx +++ b/src/BRepOffset/BRepOffset_Tool.cxx @@ -1345,7 +1345,11 @@ static TopoDS_Edge AssembleEdge(const BOPDS_PDS& pDS, { TopoDS_Vertex CV, V11, V12, V21, V22; TopExp::CommonVertex( CurEdge, anEdge, CV ); - Standard_Boolean IsAutonomCV = IsAutonomVertex( CV, pDS, F1, F2 ); + Standard_Boolean IsAutonomCV = Standard_False; + if (!CV.IsNull()) + { + IsAutonomCV = IsAutonomVertex(CV, pDS, F1, F2); + } if (IsAutonomCV) { aGlueTol = BRep_Tool::Tolerance(CV); diff --git a/src/Extrema/Extrema_ExtCS.cxx b/src/Extrema/Extrema_ExtCS.cxx index c50a6b28c3..68cc4138d2 100644 --- a/src/Extrema/Extrema_ExtCS.cxx +++ b/src/Extrema/Extrema_ExtCS.cxx @@ -105,7 +105,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, mySqDist.Clear(); Standard_Integer i, j; Standard_Integer NbT, NbU, NbV; - NbT = NbU = NbV = 10; + NbT = 12; NbU = NbV = 10; GeomAbs_CurveType myCtype = C.GetType(); myDone = Standard_False; diff --git a/src/IntTools/IntTools_BeanFaceIntersector.cxx b/src/IntTools/IntTools_BeanFaceIntersector.cxx index cbae85db3e..5796905a3c 100644 --- a/src/IntTools/IntTools_BeanFaceIntersector.cxx +++ b/src/IntTools/IntTools_BeanFaceIntersector.cxx @@ -913,7 +913,17 @@ void IntTools_BeanFaceIntersector::ComputeUsingExtremum() } GeomAdaptor_Curve aGACurve(aCurve, anarg1, anarg2); - Extrema_ExtCS theExtCS(aGACurve, aGASurface, Tol, Tol); + Extrema_ExtCS theExtCS; + theExtCS.Initialize(aGASurface, myUMinParameter, myUMaxParameter, + myVMinParameter, myVMaxParameter, Tol, Tol); + Standard_Real first = aCurve->FirstParameter(), last = aCurve->LastParameter(); + if (aCurve->IsPeriodic() || + (anarg1 >= first - Precision::PConfusion() && anarg2 <= last + Precision::PConfusion())) + { + //Extrema_ExtCS theExtCS(aGACurve, aGASurface, Tol, Tol); + theExtCS.Perform(aGACurve, anarg1, anarg2); + } + myExtrema = theExtCS; if(myExtrema.IsDone() && (myExtrema.NbExt() || myExtrema.IsParallel())) { diff --git a/src/ProjLib/ProjLib_CompProjectedCurve.cxx b/src/ProjLib/ProjLib_CompProjectedCurve.cxx index 919db15608..6d5e6698aa 100644 --- a/src/ProjLib/ProjLib_CompProjectedCurve.cxx +++ b/src/ProjLib/ProjLib_CompProjectedCurve.cxx @@ -636,8 +636,8 @@ void ProjLib_CompProjectedCurve::Init() Standard_Boolean FromLastU = Standard_False, isSplitsComputed = Standard_False; - const Standard_Real aTol3D = Precision::Confusion(); - Extrema_ExtCS CExt(myCurve->Curve(), mySurface->Surface(), aTol3D, aTol3D); + const Standard_Real aTolExt = Precision::PConfusion(); + Extrema_ExtCS CExt(myCurve->Curve(), mySurface->Surface(), aTolExt, aTolExt); if (CExt.IsDone() && CExt.NbExt()) { // Search for the minimum solution. diff --git a/tests/bugs/modalg_5/bug25232_8 b/tests/bugs/modalg_5/bug25232_8 index 61892b8be4..49d0e7f63a 100644 --- a/tests/bugs/modalg_5/bug25232_8 +++ b/tests/bugs/modalg_5/bug25232_8 @@ -27,5 +27,5 @@ mkvolume result fcon3 fp checkprops result -s 1706.51 checkshape result -checknbshapes result -vertex 5 -edge 6 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 17 +checknbshapes result -vertex 4 -edge 5 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 15 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_7/bug27087 b/tests/bugs/modalg_7/bug27087 new file mode 100644 index 0000000000..c244d28763 --- /dev/null +++ b/tests/bugs/modalg_7/bug27087 @@ -0,0 +1,16 @@ +puts "========" +puts "OCC27087" +puts "========" +puts "" +####################################################### +# [Regression to OCCT 6.7.1] BRepExtrema_DistShapeShape gives wrong result +####################################################### + +smallview +restore [locate_data_file bug27087.brep] a +explode a +distmini r a_1 a_2 +if { [dval r_val] > 0.0001 } { puts "Error: too big deviation, should be 0!" } + +fit +checkview -screenshot -2d -path ${imagedir}/${test_image}.png