From: eap Date: Wed, 16 Mar 2011 07:47:10 +0000 (+0000) Subject: report error when a major radius is less that a minor one X-Git-Tag: Start_BR_19998_21191~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e403b95e1b6f4613dcf9564c3d720d25dbcde8ef;p=modules%2Fgeom.git report error when a major radius is less that a minor one --- 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 {