From e403b95e1b6f4613dcf9564c3d720d25dbcde8ef Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 16 Mar 2011 07:47:10 +0000 Subject: [PATCH] report error when a major radius is less that a minor one --- src/GEOMImpl/GEOMImpl_EllipseDriver.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/GEOMImpl/GEOMImpl_EllipseDriver.cxx b/src/GEOMImpl/GEOMImpl_EllipseDriver.cxx index 68235edd7..a4dd29145 100644 --- a/src/GEOMImpl/GEOMImpl_EllipseDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_EllipseDriver.cxx @@ -133,9 +133,18 @@ Standard_Integer GEOMImpl_EllipseDriver::Execute(TFunction_Logbook& log) const anAxes = gp_Ax2 (aP, aV, aVM); } } + // Radiuses + double radiusMaj = aCI.GetRMajor(); + double radiusMin = aCI.GetRMinor(); + if ( radiusMaj < radiusMin ) + Standard_ConstructionError::Raise + ("Ellipse creation aborted: a major radius is less that a minor one"); + if ( radiusMin < 0.0 ) + Standard_ConstructionError::Raise + ("Ellipse creation aborted: raduis must be positive"); // Ellipse - gp_Elips anEll (anAxes, aCI.GetRMajor(), aCI.GetRMinor()); + gp_Elips anEll (anAxes, radiusMaj, radiusMin); aShape = BRepBuilderAPI_MakeEdge(anEll).Edge(); } else { -- 2.39.2