fix(assembly): classify datum plane references in Distance joints #316

Merged
forbes merged 1 commits from fix/distance-datum-plane-classification into main 2026-02-22 20:21:09 +00:00
Owner

When a Distance joint references a datum plane (XY_Plane, XZ_Plane, YZ_Plane), getDistanceType() failed to recognize it because datum plane sub-names yield an empty element type. This caused the fallback to DistanceType::Other → BaseJointKind::Planar, which adds spurious parallel-normal residuals that overconstrain the system.

For example, three vertex-to-datum-plane Distance joints produced 10 residuals (3×Planar) with 6 mutually contradictory orientation constraints, causing the solver to find garbage least-squares solutions.

Fix

Add early detection of App::Plane datum objects before the main geometry classification chain in getDistanceType(). Datum planes are now correctly mapped:

  • Vertex + DatumPlane → PointPlane → PointInPlane (1 residual) — datum on Reference2 so PointInPlaneConstraint reads the correct plane normal from marker_j
  • Edge + DatumPlane → LinePlane → LineInPlane
  • Face + DatumPlane → PlanePlane → Planar — no swap needed since PlanarConstraint is symmetric
When a Distance joint references a datum plane (XY_Plane, XZ_Plane, YZ_Plane), getDistanceType() failed to recognize it because datum plane sub-names yield an empty element type. This caused the fallback to DistanceType::Other → BaseJointKind::Planar, which adds spurious parallel-normal residuals that overconstrain the system. For example, three vertex-to-datum-plane Distance joints produced 10 residuals (3×Planar) with 6 mutually contradictory orientation constraints, causing the solver to find garbage least-squares solutions. ### Fix Add early detection of App::Plane datum objects before the main geometry classification chain in getDistanceType(). Datum planes are now correctly mapped: - Vertex + DatumPlane → PointPlane → PointInPlane (1 residual) — datum on Reference2 so PointInPlaneConstraint reads the correct plane normal from marker_j - Edge + DatumPlane → LinePlane → LineInPlane - Face + DatumPlane → PlanePlane → Planar — no swap needed since PlanarConstraint is symmetric
forbes added 1 commit 2026-02-22 20:11:49 +00:00
fix(assembly): classify datum plane references in Distance joints
Some checks failed
Build and Test / build (pull_request) Has been cancelled
49cc89e8ca
When a Distance joint references a datum plane (XY_Plane, XZ_Plane,
YZ_Plane), getDistanceType() failed to recognize it because datum
plane sub-names yield an empty element type. This caused the fallback
to DistanceType::Other → BaseJointKind::Planar, which adds spurious
parallel-normal residuals that overconstrain the system.

For example, three vertex-to-datum-plane Distance joints produced
10 residuals (3×Planar) with 6 mutually contradictory orientation
constraints, causing the solver to find garbage least-squares
solutions.

Add early detection of App::Plane datum objects before the main
geometry classification chain. Datum planes are now correctly mapped:
- Vertex + DatumPlane → PointPlane → PointInPlane (1 residual)
- Edge + DatumPlane → LinePlane → LineInPlane
- Face/DatumPlane + DatumPlane → PlanePlane → Planar
forbes force-pushed fix/distance-datum-plane-classification from 49cc89e8ca to b961037b18 2026-02-22 20:14:17 +00:00 Compare
forbes force-pushed fix/distance-datum-plane-classification from b961037b18 to b4835e1b05 2026-02-22 20:19:19 +00:00 Compare
forbes merged commit 50dc8c8ea1 into main 2026-02-22 20:21:09 +00:00
forbes deleted branch fix/distance-datum-plane-classification 2026-02-22 20:21:09 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#316