fix(assembly): classify datum planes from all class hierarchies in Distance joints #318
Reference in New Issue
Block a user
Delete Branch "fix/datum-plane-classification-all-hierarchies"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The datum plane detection in
getDistanceType()only checkedisDerivedFrom<App::Plane>(), which catches origin planes (XY/XZ/YZ) andPart::DatumPlane. This missed two other class hierarchies:PartDesign::Plane— inheritsPart::Datum → Part::Feature, NOTApp::PlanePart::Planeprimitive — inheritsPart::Primitive → Part::Feature, referenced bare (no Face element)Both produce empty element types (sub-name ends with
.) but failed the type check, falling through toDistanceType::Other→ Planar fallback. This produced incorrect constraint geometry, causing conflicting constraints and solver failures.Symptoms
PartDesign::Planedatums logged:unhandled DistanceType Other, falling back to PlanarConstraint N is conflicting (redundant and unsatisfied)Solution
Add shape-based
isDatumPlane(),isDatumLine(),isDatumPoint()helper functions that cover all three class hierarchies by inspecting the actual OCCT geometry:App::Plane/App::Line/App::Point— fastisDerivedFromcheckPart::Datumsubclasses — check shape has a planar face / linear edge / vertexPart::Featurefallback — single planar face = datum plane (catchesPart::Planeprimitive bare refs)Extends
getDistanceType()to use these helpers for all datum-vs-datum and datum-vs-element combinations (planes, lines, points).Tests
Adds
TestDatumClassification.pywith tests for:PartDesign::Plane+ box Face → PlanePlanePartDesign::Plane+ box Vertex → PointPlanePartDesign::Plane+PartDesign::Plane→ PlanePlanePart::Planebare ref + box Face → PlanePlanePart::Planewith Face1 element (normal path)App::Plane+PartDesign::Planecross-hierarchy