]> OCCT Git - occt.git/commitdiff
Modeling - Bounding BSpline periodic tolerance issue #468
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Mon, 31 Mar 2025 10:29:38 +0000 (11:29 +0100)
committerGitHub <noreply@github.com>
Mon, 31 Mar 2025 10:29:38 +0000 (11:29 +0100)
Update BndLib_Add3dCurve to check the periodic case u1-u2 matching with period

src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx
tests/bugs/modalg_6/bug27079_3
tests/bugs/modalg_8/bug_gh466 [new file with mode: 0644]

index 7af8bc9e22613b1b780bb6326331e0590e80dc53..5508a13268ac9715fea6553a047f9952402c315c 100644 (file)
@@ -215,9 +215,13 @@ void BndLib_Add3dCurve::Add(const Adaptor3d_Curve& C,
             u2 = Bsaux->LastParameter();
           //  modified by NIZHNY-EAP Fri Dec  3 14:29:18 1999 ___END___
         }
+        const Standard_Real anU2Periodic =
+          Bsaux->IsPeriodic() ? (u2 - (Bsaux->LastParameter() - Bsaux->FirstParameter())) : u2;
         Standard_Real aSegmentTol = 2. * Precision::PConfusion();
-        if (Abs(u2 - u1) < aSegmentTol)
-          aSegmentTol = Abs(u2 - u1) * 0.01;
+        if (Abs((anU2Periodic - u1) < aSegmentTol))
+        {
+          aSegmentTol = Abs(anU2Periodic - u1) * 0.01;
+        }
         Bsaux->Segment(u1, u2, aSegmentTol);
         Bs = Bsaux;
       }
index db7200a31d4434ea1552fc3d6300bfc469474fbf..8162441ce415e744f26c90f285f1ad7e4edad810 100644 (file)
@@ -20,6 +20,6 @@ bop f1 f2
 bopsection result
 
 checkprops result -l 13.7747
-checknbshapes result -vertex 4 -edge 3
+checknbshapes result -vertex 3 -edge 2
 
 checkview -screenshot -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/modalg_8/bug_gh466 b/tests/bugs/modalg_8/bug_gh466
new file mode 100644 (file)
index 0000000..492a206
--- /dev/null
@@ -0,0 +1,10 @@
+puts "========================================================================="
+puts "GH466: BRepBndLib::AddClose crashes"
+puts "========================================================================="
+puts ""
+
+pload QAcommands
+
+restore [locate_data_file bug_gh466.brep] result
+
+OCC566 result