Files
create/src
forbes ddefb23652 Fix Assembly solver ignoring PartDesign datum plane references
When a PartDesign::Plane (including ZTools datums like ZPlane_Mid,
ZPlane_Offset) is used as a reference in an Assembly joint,
findPlacement() returns an all-zero placement, making the joint
constraint degenerate and ineffective.

Root cause: getElementName() strips the terminal '.Plane' suffix
because it matches the hardcoded set for App::LocalCoordinateSystem
datum elements ({X, Y, Z, Point, Line, Plane}). This is correct
behavior — the issue is that findPlacement()'s 'whole part' branch
only handled App::Line objects and returned App.Placement() (zeros)
for everything else, including PartDesign::Plane datums.

The fix extends the 'whole part' branch in findPlacement() to
compute a proper placement for PartDesign::Plane objects by
extracting the plane's center-of-gravity and surface rotation from
its Shape, then converting to object-local coordinates. This matches
the existing convention used for Face elements elsewhere in the
function.

Also adds handling for PartDesign::Point datums, which hit the same
empty-element code path.

Existing App::Plane origin references (XY_Plane, etc.) are unaffected
since isDerivedFrom('PartDesign::Plane') does not match App::Plane.
2026-01-30 20:46:40 -06:00
..
2026-01-19 08:10:24 +01:00