]> OCCT Git - occt.git/commitdiff
26920 fix exception call in fillet(wrong choice of face) CR26920_1
authormgerus <maksim.gerus@opencascade.com>
Fri, 30 Sep 2022 07:57:43 +0000 (10:57 +0300)
committermgerus <maksim.gerus@opencascade.com>
Fri, 30 Sep 2022 07:57:43 +0000 (10:57 +0300)
src/ChFi3d/ChFi3d_Builder_C1.cxx
tests/bugs/modalg_7/bug26920 [new file with mode: 0644]

index da727d1a35efa006d647c9c995d6a9791ad64e2a..c03de12f42a9eb3d0321fadb722dd0a1c5256dc3 100644 (file)
@@ -2708,7 +2708,14 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
             TopoDS_Edge aLocalEdge = edgesau;
             if (edgesau.Orientation() != orient)
               aLocalEdge.Reverse();
-            C2dint1 = BRep_Tool::CurveOnSurface(aLocalEdge,Face[0],ubid,vbid);
+            C2dint1 = BRep_Tool::CurveOnSurface(aLocalEdge, Face[0], ubid, vbid);
+
+            if (C2dint1.IsNull())
+            {
+              //std::swap(Face[0], facesau);
+              C2dint1 = BRep_Tool::CurveOnSurface(aLocalEdge, facesau, ubid, vbid);
+
+            }
           }
         }
         else {
@@ -2718,7 +2725,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
        //// for periodic 3d curves ////
        if (cad.IsPeriodic())
        {
-         gp_Pnt2d P2d = BRep_Tool::Parameters( Vtx, Face[0] );
+          gp_Pnt2d P2d = BRep_Tool::Parameters(Vtx, facesau);
          Geom2dAPI_ProjectPointOnCurve Projector( P2d, C2dint1 );
          par = Projector.LowerDistanceParameter();
          Standard_Real shift = par-ParVtx;
diff --git a/tests/bugs/modalg_7/bug26920 b/tests/bugs/modalg_7/bug26920
new file mode 100644 (file)
index 0000000..cda142a
--- /dev/null
@@ -0,0 +1,13 @@
+puts "========"
+puts "0026920: BRepBuidlerAPI_MakeFillet crash 2"
+puts "========"
+
+restore C:/WORK/opencascade/bugs/CR26920/bug26920.brep b1
+explode b1 e
+fillet result b1 0.25 b1_15
+
+checkprops result -s 1653.78
+checkshape result
+
+checknbshapes result -vertex 20 -edge 31 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 80
+checkview -display result -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file