From: abv Date: Thu, 24 May 2012 05:51:11 +0000 (+0400) Subject: 0023170: Bug of creating a full sphere face X-Git-Tag: V6_5_4_beta1~172 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=5554ac6852bb6c82881df77349daf3d8c092f603 0023170: Bug of creating a full sphere face Method ElSLib::SphereVIso() is protected against creation of circle with negative radius when |V| > PI/2; now the circle on analytic continuation of sphere behind poles is returned in this case (thus always with positive or zero radius) --- diff --git a/src/ElSLib/ElSLib.cxx b/src/ElSLib/ElSLib.cxx index 27df296e4b..b741441520 100755 --- a/src/ElSLib/ElSLib.cxx +++ b/src/ElSLib/ElSLib.cxx @@ -1644,6 +1644,14 @@ gp_Circ ElSLib::SphereVIso(const gp_Ax3& Pos, Ve.Multiply(Radius * sin(V)); axes.Translate(Ve); Standard_Real radius = Radius * cos(V); + // #23170: if V is even slightly (e.g. by double epsilon) greater than PI/2, + // radius will become negative and constructor of gp_Circ will raise exception. + // Lets try to create correct isoline even on analytical continuation for |V| > PI/2... + if (radius < 0.) + { + axes.SetDirection (-axes.Direction()); + radius = -radius; + } gp_Circ Circ(axes,radius); return Circ; }