From a2f331e0d232ca6cadb73ca9ebbd2c04219d2d93 Mon Sep 17 00:00:00 2001 From: hlorus <64740362+hlorus@users.noreply.github.com> Date: Mon, 10 Jun 2024 17:02:15 +0200 Subject: [PATCH] Measure: Fix MeasureLength failure when measuring circles/arcs --- src/Mod/Part/App/MeasureClient.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Mod/Part/App/MeasureClient.cpp b/src/Mod/Part/App/MeasureClient.cpp index 002ad7581b..b2f514ace0 100644 --- a/src/Mod/Part/App/MeasureClient.cpp +++ b/src/Mod/Part/App/MeasureClient.cpp @@ -268,17 +268,7 @@ MeasureLengthInfoPtr MeasureLengthHandler(const App::SubObjectT& subject) BRepGProp::LinearProperties(shape, gprops); auto origin = gprops.CentreOfMass(); - // Get rotation of line - auto edge = TopoDS::Edge(shape); - ShapeAnalysis_Edge edgeAnalyzer; - gp_Pnt firstPoint = BRep_Tool::Pnt(edgeAnalyzer.FirstVertex(edge)); - gp_Pnt lastPoint = BRep_Tool::Pnt(edgeAnalyzer.LastVertex(edge)); - auto dir = (lastPoint.XYZ() - firstPoint.XYZ()).Normalized(); - Base::Vector3d elementDirection(dir.X(), dir.Y(), dir.Z()); - Base::Vector3d axisUp(0.0, 0.0, 1.0); - Base::Rotation rot(axisUp, elementDirection); - - Base::Placement placement(Base::Vector3d(origin.X(), origin.Y(), origin.Z()), rot); + Base::Placement placement(Base::Vector3d(origin.X(), origin.Y(), origin.Z()), Base::Rotation()); return std::make_shared(true, getLength(shape), placement); }