From f2a1716c844cb49f3a783dd1250217fc4c5cb9a9 Mon Sep 17 00:00:00 2001 From: Dmitrii Kulikov <164657232+AtheneNoctuaPt@users.noreply.github.com> Date: Thu, 4 Dec 2025 19:02:29 +0000 Subject: [PATCH] Modeling - BRepBuilderAPI_GTransform face stretch crash (#875) - 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 | 5 +++-- src/GeomAdaptor/GeomAdaptor_Curve.hxx | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx index 0ac96d8b2a..7bbc94bf1b 100644 --- a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx +++ b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -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(); } diff --git a/src/GeomAdaptor/GeomAdaptor_Curve.hxx b/src/GeomAdaptor/GeomAdaptor_Curve.hxx index fc217b612c..88d576c2d8 100644 --- a/src/GeomAdaptor/GeomAdaptor_Curve.hxx +++ b/src/GeomAdaptor/GeomAdaptor_Curve.hxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -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(); } -- 2.39.5