]> OCCT Git - occt.git/commitdiff
Modeling - BRepBuilderAPI_GTransform face stretch crash (#875)
authorDmitrii Kulikov <164657232+AtheneNoctuaPt@users.noreply.github.com>
Thu, 4 Dec 2025 19:02:29 +0000 (19:02 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Fri, 5 Dec 2025 22:48:05 +0000 (22:48 +0000)
- Modified parameter validation to allow curves where `theUFirst > theULast` within `Precision::Confusion()` tolerance
- Updated documentation to reflect the new tolerance-based validation
- Added comprehensive test suites for both 2D and 3D curve adaptors

src/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx
src/GeomAdaptor/GeomAdaptor_Curve.hxx

index 0ac96d8b2a14a8b8992174bd54b1bbb0b8f0bd7f..7bbc94bf1b3cdd4264da1129be2a0e3702f41172 100644 (file)
@@ -24,6 +24,7 @@
 #include <GeomAbs_CurveType.hxx>
 #include <GeomAbs_Shape.hxx>
 #include <gp_Pnt2d.hxx>
+#include <Precision.hxx>
 #include <Standard_NullObject.hxx>
 #include <TColStd_Array1OfReal.hxx>
 
@@ -71,7 +72,7 @@ public:
     load(theCurve, theCurve->FirstParameter(), theCurve->LastParameter());
   }
 
-  //! Standard_ConstructionError is raised if theUFirst>theULast
+  //! Standard_ConstructionError is raised if theUFirst > theULast + Precision::PConfusion()
   void Load(const Handle(Geom2d_Curve)& theCurve,
             const Standard_Real         theUFirst,
             const Standard_Real         theULast)
@@ -80,7 +81,7 @@ public:
     {
       throw Standard_NullObject();
     }
-    if (theUFirst > theULast)
+    if (theUFirst > theULast + Precision::Confusion())
     {
       throw Standard_ConstructionError();
     }
index fc217b612c389301faff191dc38bfa5b94ba2ff1..88d576c2d8107f474e60e98eb7ffa31f022d11c7 100644 (file)
@@ -22,6 +22,7 @@
 #include <Geom_Curve.hxx>
 #include <GeomAbs_Shape.hxx>
 #include <GeomEvaluator_Curve.hxx>
+#include <Precision.hxx>
 #include <Standard_NullObject.hxx>
 #include <Standard_ConstructionError.hxx>
 
@@ -47,7 +48,7 @@ public:
 
   GeomAdaptor_Curve(const Handle(Geom_Curve)& theCurve) { Load(theCurve); }
 
-  //! Standard_ConstructionError is raised if theUFirst>theULast
+  //! Standard_ConstructionError is raised if theUFirst > theULast + Precision::PConfusion()
   GeomAdaptor_Curve(const Handle(Geom_Curve)& theCurve,
                     const Standard_Real       theUFirst,
                     const Standard_Real       theULast)
@@ -70,7 +71,7 @@ public:
     load(theCurve, theCurve->FirstParameter(), theCurve->LastParameter());
   }
 
-  //! Standard_ConstructionError is raised if theUFirst>theULast
+  //! Standard_ConstructionError is raised if theUFirst > theULast + Precision::PConfusion()
   void Load(const Handle(Geom_Curve)& theCurve,
             const Standard_Real       theUFirst,
             const Standard_Real       theULast)
@@ -79,7 +80,7 @@ public:
     {
       throw Standard_NullObject();
     }
-    if (theUFirst > theULast)
+    if (theUFirst > theULast + Precision::Confusion())
     {
       throw Standard_ConstructionError();
     }