feat(assembly): pluggable solver system — Phase 1 (#287) #297
Reference in New Issue
Block a user
Delete Branch "feat/solver-api-types"
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?
Summary
Introduces the KCSolve pluggable solver abstraction layer for the Assembly module, decoupling AssemblyObject from direct OndselSolver dependency. This is Phase 1 of the solver plugin system described in #287.
After this PR, OndselSolver is accessed exclusively through the
KCSolve::IKCSolverinterface andKCSolve::SolverRegistry. No OndselSolver headers are included anywhere inMod/Assembly/ApporMod/Assembly/Gui.Commits (5 phases)
47e6c14Types.h(Transform, BaseJointKind, SolveContext, SolveResult, etc.),IKCSolver.h(abstract solver interface with solve/drag/simulation/diagnostics),KCSolveGlobal.h(export macro)76b9196joints_for()capability queries,scan()/scan_default_paths()for dlopen-based plugin discovery32dbe20IKCSolverwrapping OndselSolver's ASMT API. Translates KCSolve types ↔ ASMTAssembly/ASMTPart/ASMTJoint. All OndselSolver#includes confined toOndselAdapter.cpp5c33aacIKCSolverexclusively. Removes 30+ OndselSolver includes, replacesmbdAssembly/objectPartMapwithsolver_/partIdToObjs_/objToPartId_. NewbuildSolveContext()method builds solver-agnostic input934cdf5Architecture
KCSolveshared library (src/Mod/Assembly/Solver/) — standalone, links onlyFreeCADBase+OndselSolverAssemblymodule linksKCSolveinstead ofOndselSolverdirectlyIKCSolverand register viaSolverRegistryKey design decisions
(w,x,y,z)quaternion convention (mathematical standard); adapter layer handles swap to/fromBase::Rotation(x,y,z,w)registerPart()in AssemblyObject — multiple FreeCAD objects map to a single solver part ID with offsets stored inpartIdToObjs_dlopen/LoadLibraryscanning directories forkcsolve_create()+kcsolve_api_version()exports (Phase 2+ usage)Testing
KCSolve_tests_run): all passAssembly_tests_run): still passes (no regressions)TestSolverIntegration): registered for FreeCAD test runnerFiles changed
src/Mod/Assembly/Solver/andtests/src/Mod/Assembly/Solver/AssemblyObject.h/.cpp(rewritten),AppAssembly.cpp, Assembly CMakeListstests/CMakeLists.txt,TestAssemblyWorkbench.py, AssemblyCMakeLists.txtCloses #292, closes #293, closes #294, closes #295, closes #296