Skip to content

Commit

Permalink
Core: Fix false-positive in migrateXAxisPlacement()
Browse files Browse the repository at this point in the history
Use a looser tolerance to compare the rotations of the axes and planes of the coordinate system
  • Loading branch information
wwmayer committed Dec 15, 2024
1 parent e458526 commit aa228f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/App/Datums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ void LocalCoordinateSystem::migrateOriginPoint()

void LocalCoordinateSystem::migrateXAxisPlacement()
{
constexpr const double tolerance = 1e-5;
auto features = OriginFeatures.getValues();

migrated = false;
Expand All @@ -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;
}
}
}
Expand Down

0 comments on commit aa228f2

Please sign in to comment.