From 00e6ce5f5ec6560f4cfacfe787c34a1f8d4af357 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Fri, 29 Aug 2025 11:36:56 +0200 Subject: [PATCH] Core: Datums: Make getDirection and getBasePoint aware of LCS position --- src/App/Datums.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/App/Datums.cpp b/src/App/Datums.cpp index cb8bbeb865..318203f821 100644 --- a/src/App/Datums.cpp +++ b/src/App/Datums.cpp @@ -92,8 +92,14 @@ bool DatumElement::isOriginFeature() const Base::Vector3d DatumElement::getBasePoint() const { - Base::Placement plc = Placement.getValue(); - return plc.getPosition(); + Base::Vector3d pos = Placement.getValue().getPosition(); + + const auto* lcs = getLCS(); + if (lcs && !lcs->isOrigin()) { + pos += lcs->Placement.getValue().getPosition(); + } + + return pos; } Base::Vector3d DatumElement::getDirection() const @@ -102,6 +108,13 @@ Base::Vector3d DatumElement::getDirection() const Base::Placement plc = Placement.getValue(); Base::Rotation rot = plc.getRotation(); rot.multVec(dir, dir); + + const auto* lcs = getLCS(); + if (lcs && !lcs->isOrigin()) { + Base::Rotation lcsRot = lcs->Placement.getValue().getRotation(); + lcsRot.multVec(dir, dir); + } + return dir; }