#include "openGJK/openGJK.h" #include #include namespace py = pybind11; PYBIND11_MODULE(opengjkc, m) { m.def("gjk", [](Eigen::Array& arr1, Eigen::Array& arr2) -> double { struct simplex s; struct bd bd1; struct bd bd2; bd1.numpoints = arr1.rows(); std::vector arr1_rows(arr1.rows()); for (int i = 0; i < arr1.rows(); ++i) arr1_rows[i] = arr1.row(i).data(); bd1.coord = arr1_rows.data(); bd2.numpoints = arr2.rows(); std::vector arr2_rows(arr2.rows()); for (int i = 0; i < arr2.rows(); ++i) arr2_rows[i] = arr2.row(i).data(); bd2.coord = arr2_rows.data(); double a = gjk(bd1, bd2, &s); return a; }); }