1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

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)
This commit is contained in:
abv 2012-05-24 09:51:11 +04:00 committed by bugmaster
parent 86fa64d971
commit 5554ac6852

View File

@ -1644,6 +1644,14 @@ gp_Circ ElSLib::SphereVIso(const gp_Ax3& Pos,
Ve.Multiply(Radius * sin(V)); Ve.Multiply(Radius * sin(V));
axes.Translate(Ve); axes.Translate(Ve);
Standard_Real radius = Radius * cos(V); 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); gp_Circ Circ(axes,radius);
return Circ; return Circ;
} }