Эх сурвалжийг харах

add wrapper for readPLY

Former-commit-id: 46385dc442e6eaf9bb708da179a776fbe883242a
Hasnain Vohra 8 жил өмнө
parent
commit
f5313e23f3

+ 10 - 0
python/py_doc.cpp

@@ -1436,3 +1436,13 @@ const char *__doc_igl_writePLY = R"igl_Qu8mg5v7(// Write a mesh in an ascii ply
   //   N  #V by 3 normal vectors
   //   UV #V by 2 texture coordinates
   // Returns true on success, false on error)igl_Qu8mg5v7";
+const char *__doc_igl_readPLY= R"igl_Qu8mg5v7(// Read a mesh from an ascii ply file, filling in vertex positions,
+  // mesh indices, normals and texture coordinates
+  // Inputs:
+  //  str path to .obj file
+  // Outputs:
+  //   V  double matrix of vertex positions  #V by 3
+  //   F  #F list of face indices into vertex positions
+  //   N  double matrix of corner normals #N by 3
+  //   UV #V by 2 texture coordinates
+  // Returns true on success, false on errors)igl_Qu8mg5v7";

+ 1 - 0
python/py_doc.h

@@ -118,3 +118,4 @@ extern const char *__doc_igl_winding_number_2;
 extern const char *__doc_igl_writeMESH;
 extern const char *__doc_igl_writeOBJ;
 extern const char *__doc_igl_writePLY;
+extern const char *__doc_igl_readPLY;

+ 2 - 2
python/py_igl.cpp

@@ -94,7 +94,7 @@
 #include <igl/writeMESH.h>
 #include <igl/writeOBJ.h>
 #include <igl/writePLY.h>
-
+#include <igl/readPLY.h>
 
 void python_export_igl(py::module &m)
 {
@@ -191,5 +191,5 @@ void python_export_igl(py::module &m)
 #include "py_igl/py_writeMESH.cpp"
 #include "py_igl/py_writeOBJ.cpp"
 #include "py_igl/py_writePLY.cpp"
-
+#include "py_igl/py_readPLY.cpp"
 }

+ 12 - 0
python/py_igl/py_readPLY.cpp

@@ -0,0 +1,12 @@
+m.def("readPLY", []
+(
+  const std::string str,
+  Eigen::MatrixXd& V,
+  Eigen::MatrixXi& F,
+  Eigen::MatrixXd& N,
+  Eigen::MatrixXd& UV
+)
+{
+  return igl::readPLY(str,V,F,N,UV);
+}, __doc_igl_readPLY,
+py::arg("str"), py::arg("V"), py::arg("F"), py::arg("N"), py::arg("UV"));

+ 1 - 0
python/python_shared.cpp

@@ -153,6 +153,7 @@ PYBIND11_PLUGIN(pyigl) {
            writeMESH
            writeOBJ
            writePLY
+           readPLY
 
     )pyigldoc");