From 785299a894d2c85624683761d25b2e99729f7762 Mon Sep 17 00:00:00 2001 From: Niklaus Johner <nij2003@med.cornell.edu> Date: Mon, 11 Nov 2013 10:56:56 -0500 Subject: [PATCH] Added wrapper function for the export of the Vec3List::FitCylinder function --- modules/geom/pymod/export_vec3.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/geom/pymod/export_vec3.cc b/modules/geom/pymod/export_vec3.cc index 1281b3008..8adf113fc 100644 --- a/modules/geom/pymod/export_vec3.cc +++ b/modules/geom/pymod/export_vec3.cc @@ -52,6 +52,11 @@ list vec3_data(const geom::Vec3& v) return nrvo; } +boost::python::tuple wrap_FitCylinder(const geom::Vec3List& vl,const geom::Vec3& initial_direction) { + std::pair<geom::Line3,Real> pair=vl.FitCylinder(initial_direction); + return boost::python::make_tuple<geom::Line3,Real>(pair.first,pair.second); +} + void export_Vec3() { using namespace geom; @@ -115,6 +120,6 @@ void export_Vec3() .add_property("inertia", &Vec3List::GetInertia) .add_property("principal_axes", &Vec3List::GetPrincipalAxes) .def("GetODRLine", &Vec3List::GetODRLine) - .def("FitCylinder", &Vec3List::FitCylinder) + .def("FitCylinder", wrap_FitCylinder,(arg("direction initial guess"))) ; } -- GitLab