Part: expose Geom2dCircle::getCircleCenter to Python and fix a regression

This commit is contained in:
wmayer
2022-02-05 16:07:00 +01:00
parent eecc2eacae
commit 2bec14b93a
3 changed files with 26 additions and 2 deletions

View File

@@ -932,7 +932,8 @@ Base::Vector2d Geom2dCircle::getCircleCenter (const Base::Vector2d &p1, const Ba
double vv = v*v;
double ww = w*w;
if (abs(uu * vv * ww) < Precision::Confusion())
double eps2 = Precision::SquareConfusion();
if (uu < eps2 || vv < eps2 || ww < eps2)
THROWM(Base::ValueError,"Two points are coincident");
double uv = -(u*v);
@@ -945,7 +946,7 @@ Base::Vector2d Geom2dCircle::getCircleCenter (const Base::Vector2d &p1, const Ba
double wx = w0 + w1 + w2;
if( abs(wx) < Precision::Confusion())
if (abs(wx) < Precision::Confusion())
THROWM(Base::ValueError,"Points are collinear");
double x = (w0*p1.x + w1*p2.x + w2*p3.x)/wx;