fix(assembly): extend findPlacement() datum and origin handling (#55) #83

Merged
forbes merged 1 commits from fix/assembly-datum-placement into main 2026-02-09 02:11:51 +00:00
Owner

Extends the Assembly solver's findPlacement() function to properly handle datum and origin objects in joint constraints.

Problem: findPlacement() only handled App::Line (origin axes), PartDesign::Plane, and PartDesign::Point (with minimal logic). Missing types silently returned identity placement, making joints with those references non-functional.

Added support for:

  • App::Plane — XY/XZ/YZ origin planes with correct rotations
  • App::Point — origin point
  • PartDesign::Line — extracts edge midpoint and direction from datum shape, using the same Part.Plane(origin, direction).Rotation convention as Part::GeomLine edges
  • PartDesign::Point — extracts vertex position from shape geometry (was returning raw obj.Placement)

Fixes:

  • Added obj.Shape.isNull() validation to all PartDesign::* branches
  • PartDesign::Plane and PartDesign::Point now fall back to obj.Placement on invalid shape instead of identity

Closes #55

Extends the Assembly solver's `findPlacement()` function to properly handle datum and origin objects in joint constraints. **Problem:** `findPlacement()` only handled `App::Line` (origin axes), `PartDesign::Plane`, and `PartDesign::Point` (with minimal logic). Missing types silently returned identity placement, making joints with those references non-functional. **Added support for:** - `App::Plane` — XY/XZ/YZ origin planes with correct rotations - `App::Point` — origin point - `PartDesign::Line` — extracts edge midpoint and direction from datum shape, using the same `Part.Plane(origin, direction).Rotation` convention as `Part::GeomLine` edges - `PartDesign::Point` — extracts vertex position from shape geometry (was returning raw `obj.Placement`) **Fixes:** - Added `obj.Shape.isNull()` validation to all `PartDesign::*` branches - `PartDesign::Plane` and `PartDesign::Point` now fall back to `obj.Placement` on invalid shape instead of identity Closes #55
forbes added 1 commit 2026-02-09 01:54:05 +00:00
fix(assembly): extend findPlacement() datum and origin handling (#55)
Some checks failed
Build and Test / build (pull_request) Has been cancelled
b7374d7b1f
Add support for missing datum and origin object types in the Assembly
solver's findPlacement() function:

- App::Plane: handle XY/XZ/YZ origin planes with correct rotations
- App::Point: handle origin point (identity placement)
- PartDesign::Line: extract edge midpoint and direction from shape
- PartDesign::Point: extract vertex position from shape geometry
  instead of returning raw obj.Placement
- Add obj.Shape.isNull() validation to all PartDesign datum branches
- PartDesign::Plane falls back to obj.Placement on invalid shape
  instead of falling through to App.Placement()

Closes #55
forbes merged commit 6d828a6459 into main 2026-02-09 02:11:51 +00:00
forbes deleted branch fix/assembly-datum-placement 2026-02-09 02:12:00 +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#83