瀏覽代碼

Make adjacency_matrix available within python by adding required bindings.

Former-commit-id: 5350ef0cc16c476b8f178f6851625082232bbaf0
Nico Brügel 7 年之前
父節點
當前提交
4b26fb3799
共有 2 個文件被更改,包括 12 次插入0 次删除
  1. 2 0
      python/py_igl.cpp
  2. 10 0
      python/py_igl/py_adjacency_matrix.cpp

+ 2 - 0
python/py_igl.cpp

@@ -16,6 +16,7 @@
 #include <igl/SolverStatus.h>
 #include <igl/active_set.h>
 #include <igl/adjacency_list.h>
+#include <igl/adjacency_matrix.h>
 #include <igl/arap.h>
 #include <igl/avg_edge_length.h>
 #include <igl/barycenter.h>
@@ -114,6 +115,7 @@ void python_export_igl(py::module &m)
 #include "py_igl/py_SolverStatus.cpp"
 #include "py_igl/py_active_set.cpp"
 #include "py_igl/py_adjacency_list.cpp"
+#include "py_igl/py_adjacency_matrix.cpp"
 #include "py_igl/py_arap.cpp"
 #include "py_igl/py_avg_edge_length.cpp"
 #include "py_igl/py_barycenter.cpp"

+ 10 - 0
python/py_igl/py_adjacency_matrix.cpp

@@ -0,0 +1,10 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+//
+// Copyright (C) 2017 Sebastian Koch <s.koch@tu-berlin.de> and Daniele Panozzo <daniele.panozzo@gmail.com>
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
+// obtain one at http://mozilla.org/MPL/2.0/.
+m.def("adjacency_matrix", [](const Eigen::MatrixXi & F, Eigen::SparseMatrix<int>& A) {
+    igl::adjacency_matrix(F, A);
+}, py::arg("F"), py::arg("A"));