From 558db30497800c765a81d9bb3f4b34158e43fa23 Mon Sep 17 00:00:00 2001 From: wandererfan Date: Sat, 17 Aug 2024 19:48:06 -0400 Subject: [PATCH] [TD]fix asCircle error calculation --- src/Mod/TechDraw/App/Geometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/TechDraw/App/Geometry.cpp b/src/Mod/TechDraw/App/Geometry.cpp index 749ba0d4ee..865ef3346d 100644 --- a/src/Mod/TechDraw/App/Geometry.cpp +++ b/src/Mod/TechDraw/App/Geometry.cpp @@ -1593,7 +1593,6 @@ bool GeometryUtils::getCircleParms(TopoDS_Edge occEdge, double& radius, Base::Ve sumCenter += DrawUtil::toVector3d(curveCenter); } catch (Standard_Failure&) { - // Base::Console().Error("OCC error. Could not interpret BSpline as Circle\n"); return false; } Base::Vector3d avgCenter = sumCenter/testCount; @@ -1601,7 +1600,7 @@ bool GeometryUtils::getCircleParms(TopoDS_Edge occEdge, double& radius, Base::Ve double avgCurve = sumCurvature/testCount; double errorCurve = 0; for (auto& cv: curvatures) { - errorCurve += fabs(avgCurve - cv); //fabs??? + errorCurve += avgCurve - cv; } errorCurve = errorCurve/testCount; @@ -1617,6 +1616,7 @@ bool GeometryUtils::getCircleParms(TopoDS_Edge occEdge, double& radius, Base::Ve //! make a circle or arc of circle Edge from BSpline Edge //! assumes the spline is generally circular but does not check +// ??? why does this not use getCircleParms to retrieve centre, radius, start/end, isArc TopoDS_Edge GeometryUtils::asCircle(TopoDS_Edge splineEdge, bool& arc) { BRepAdaptor_Curve curveAdapt(splineEdge);