feat(solver): refactor AssemblyObject to use IKCSolver interface (#295)
Rewire AssemblyObject to call through KCSolve::IKCSolver instead of directly manipulating OndselSolver ASMT types. Key changes: - Remove all 30+ #include <OndselSolver/*> from AssemblyObject.cpp - Remove MbDPartData, objectPartMap, mbdAssembly members - Add solver_ (IKCSolver), lastResult_ (SolveResult), partIdToObjs_ maps - New buildSolveContext() builds SolveContext from FreeCAD document objects with JointType/DistanceType -> BaseJointKind decomposition - New computeMarkerTransform() replaces handleOneSideOfJoint() - New computeRackPinionMarkers() replaces getRackPinionMarkers() - Rewrite solve/preDrag/doDragStep/postDrag/generateSimulation to call through IKCSolver interface - Rewrite setNewPlacements/validateNewPlacements to use SolveResult - Rewrite updateSolveStatus to use ConstraintDiagnostic - Add export_native() to IKCSolver for ASMT export support - Register OndselAdapter at Assembly module init in AppAssembly.cpp - Remove OndselSolver from Assembly_LIBS (linked transitively via KCSolve) Assembly module now has zero OndselSolver includes. All solver coupling is confined to KCSolve/OndselAdapter.cpp.
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include <Base/Interpreter.h>
|
||||
#include <Base/PyObjectBase.h>
|
||||
|
||||
#include <Mod/Assembly/Solver/OndselAdapter.h>
|
||||
|
||||
#include "AssemblyObject.h"
|
||||
#include "AssemblyLink.h"
|
||||
#include "BomObject.h"
|
||||
@@ -54,6 +56,10 @@ PyMOD_INIT_FUNC(AssemblyApp)
|
||||
}
|
||||
|
||||
PyObject* mod = Assembly::initModule();
|
||||
|
||||
// Register the built-in OndselSolver adapter with the solver registry.
|
||||
KCSolve::OndselAdapter::register_solver();
|
||||
|
||||
Base::Console().log("Loading Assembly module... done\n");
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user