From aa228f2b329793326589b760767e48f49cb7eb1c Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 14 Dec 2024 21:36:25 +0100 Subject: [PATCH] Core: Fix false-positive in migrateXAxisPlacement() Use a looser tolerance to compare the rotations of the axes and planes of the coordinate system --- src/App/Datums.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App/Datums.cpp b/src/App/Datums.cpp index 7421d4d6a1e2..ab972e35067d 100644 --- a/src/App/Datums.cpp +++ b/src/App/Datums.cpp @@ -306,6 +306,7 @@ void LocalCoordinateSystem::migrateOriginPoint() void LocalCoordinateSystem::migrateXAxisPlacement() { + constexpr const double tolerance = 1e-5; auto features = OriginFeatures.getValues(); migrated = false; @@ -317,10 +318,11 @@ void LocalCoordinateSystem::migrateXAxisPlacement() for (auto data : setupData) { // ensure the rotation is correct for the role if (std::strcmp(feature->Role.getValue(), data.role) == 0) { - if (!feature->Placement.getValue().getRotation().isSame(data.rot)) { + if (!feature->Placement.getValue().getRotation().isSame(data.rot, tolerance)) { feature->Placement.setValue(Base::Placement(Base::Vector3d(), data.rot)); migrated = true; } + break; } } }