Răsfoiți Sursa

Fixed signed_distance function

Former-commit-id: 6204302f8427fcef22661c85fda55f9b1ef5bfb7
Sebastian Koch 9 ani în urmă
părinte
comite
fb530cb053

+ 1 - 1
python/py_igl/py_point_mesh_squared_distance.cpp

@@ -8,7 +8,7 @@ m.def("point_mesh_squared_distance", []
   Eigen::MatrixXd& C
 )
 {
-  assert_is_VectorX("I",I);
+//  assert_is_VectorX("I",I);
   return igl::point_mesh_squared_distance(P, V, Ele, sqrD, I, C);
 }, __doc_igl_point_mesh_squared_distance,
 py::arg("P"), py::arg("V"), py::arg("Ele"), py::arg("sqrD"), py::arg("I"), py::arg("C"));

+ 3 - 5
python/py_igl/py_signed_distance.cpp

@@ -21,12 +21,10 @@ m.def("signed_distance", []
 )
 {
   Eigen::VectorXd Sv;
-  if (S.size() != 0)
-    Sv = S;
   Eigen::VectorXi Iv;
-  if (I.size() != 0)
-    Iv = I;
-  return igl::signed_distance(P, V, F, sign_type, Sv, Iv, C, N);
+  igl::signed_distance(P, V, F, sign_type, Sv, Iv, C, N);
+  S = Sv;
+  I = Iv;
 }, __doc_igl_signed_distance,
 py::arg("P"), py::arg("V"), py::arg("F"), py::arg("sign_type"), py::arg("S"), py::arg("I"), py::arg("C"), py::arg("N"));