Core: Datums: Make getDirection and getBasePoint aware of LCS position

This commit is contained in:
PaddleStroke
2025-08-29 11:36:56 +02:00
committed by Chris Hennes
parent a1be07569b
commit 00e6ce5f5e

View File

@@ -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;
}