- Move existing OndselSolver, GNN ML layer, and tooling into GNN/ directory for integration in later phases - Add Create addon scaffold: package.xml, Init.py - Add expression DAG with eval, symbolic diff, simplification - Add parameter table with fixed/free variable tracking - Add quaternion rotation as polynomial Expr trees - Add RigidBody entity (7 DOF: position + unit quaternion) - Add constraint classes: Coincident, DistancePointPoint, Fixed - Add Newton-Raphson solver with symbolic Jacobian + numpy lstsq - Add pre-solve passes: substitution + single-equation - Add DOF counting via Jacobian SVD rank - Add KindredSolver IKCSolver bridge for kcsolve integration - Add 82 unit tests covering all modules Registers as 'kindred' solver via kcsolve.register_solver() when loaded by Create's addon_loader.
54 lines
1.7 KiB
C++
54 lines
1.7 KiB
C++
/***************************************************************************
|
|
* Copyright (c) 2023 Ondsel, Inc. *
|
|
* *
|
|
* This file is part of OndselSolver. *
|
|
* *
|
|
* See LICENSE file for details about copyright. *
|
|
***************************************************************************/
|
|
|
|
#include "ASMTRefItem.h"
|
|
#include "CREATE.h"
|
|
#include <algorithm>
|
|
|
|
using namespace MbD;
|
|
|
|
void MbD::ASMTRefItem::addMarker(std::shared_ptr<ASMTMarker> marker)
|
|
{
|
|
markers->push_back(marker);
|
|
marker->owner = this;
|
|
}
|
|
|
|
void MbD::ASMTRefItem::readMarkers(std::vector<std::string>& lines)
|
|
{
|
|
assert(lines[0].find("Markers") != std::string::npos);
|
|
lines.erase(lines.begin());
|
|
markers->clear();
|
|
auto it = std::find_if(lines.begin(), lines.end(), [](const std::string& s) {
|
|
return s.find("RefPoint") != std::string::npos;
|
|
});
|
|
std::vector<std::string> markersLines(lines.begin(), it);
|
|
while (!markersLines.empty()) {
|
|
readMarker(markersLines);
|
|
}
|
|
lines.erase(lines.begin(), it);
|
|
}
|
|
|
|
void MbD::ASMTRefItem::readMarker(std::vector<std::string>& lines)
|
|
{
|
|
assert(lines[0].find("Marker") != std::string::npos);
|
|
lines.erase(lines.begin());
|
|
auto marker = CREATE<ASMTMarker>::With();
|
|
marker->parseASMT(lines);
|
|
markers->push_back(marker);
|
|
marker->owner = this;
|
|
}
|
|
|
|
void MbD::ASMTRefItem::storeOnLevel(std::ofstream& os, size_t level)
|
|
{
|
|
storeOnLevelString(os, level, "RefPoints");
|
|
ASMTSpatialItem::storeOnLevel(os, level+1);
|
|
for (auto& marker : *markers) {
|
|
marker->storeOnLevel(os, level);
|
|
}
|
|
}
|