diff --git a/python/py_doc.cpp b/python/py_doc.cpp index 190aff6f6..8f4320162 100644 --- a/python/py_doc.cpp +++ b/python/py_doc.cpp @@ -1470,3 +1470,33 @@ const char *__doc_igl_readPLY= R"igl_Qu8mg5v7(// Read a mesh from an ascii ply f // N double matrix of corner normals #N by 3 // UV #V by 2 texture coordinates // Returns true on success, false on errors)igl_Qu8mg5v7"; +const char *__doc_igl_seam_edges=R"igl_Qu8mg5v7(// Finds all UV-space boundaries of a mesh. + // + // Inputs: + // V #V by dim list of positions of the input mesh. + // TC #TC by 2 list of 2D texture coordinates of the input mesh + // F #F by 3 list of triange indices into V representing a + // manifold-with-boundary triangle mesh + // FTC #F by 3 list of indices into TC for each corner + // Outputs: + // seams Edges where the forwards and backwards directions have different + // texture coordinates, as a #seams-by-4 matrix of indices. Each row is + // organized as [ forward_face_index, forward_face_vertex_index, + // backwards_face_index, backwards_face_vertex_index ] such that one side + // of the seam is the edge: + // F[ seams( i, 0 ), seams( i, 1 ) ], F[ seams( i, 0 ), (seams( i, 1 ) + 1) % 3 ] + // and the other side is the edge: + // F[ seams( i, 2 ), seams( i, 3 ) ], F[ seams( i, 2 ), (seams( i, 3 ) + 1) % 3 ] + // boundaries Edges with only one incident triangle, as a #boundaries-by-2 + // matrix of indices. Each row is organized as + // [ face_index, face_vertex_index ] + // such that the edge is: + // F[ boundaries( i, 0 ), boundaries( i, 1 ) ], F[ boundaries( i, 0 ), (boundaries( i, 1 ) + 1) % 3 ] + // foldovers Edges where the two incident triangles fold over each other + // in UV-space, as a #foldovers-by-4 matrix of indices. + // Each row is organized as [ forward_face_index, forward_face_vertex_index, + // backwards_face_index, backwards_face_vertex_index ] + // such that one side of the foldover is the edge: + // F[ foldovers( i, 0 ), foldovers( i, 1 ) ], F[ foldovers( i, 0 ), (foldovers( i, 1 ) + 1) % 3 ] + // and the other side is the edge: + // F[ foldovers( i, 2 ), foldovers( i, 3 ) ], F[ foldovers( i, 2 ), (foldovers( i, 3 ) + 1) % 3 ])igl_Qu8mg5v7"; diff --git a/python/py_doc.h b/python/py_doc.h index f4e8e2b26..f6f91ea6c 100644 --- a/python/py_doc.h +++ b/python/py_doc.h @@ -127,3 +127,4 @@ extern const char *__doc_igl_writeMESH; extern const char *__doc_igl_writeOBJ; extern const char *__doc_igl_writePLY; extern const char *__doc_igl_readPLY; +extern const char *__doc_igl_seam_edges; diff --git a/python/py_igl.cpp b/python/py_igl.cpp index 38c7f127a..5ec827282 100644 --- a/python/py_igl.cpp +++ b/python/py_igl.cpp @@ -103,6 +103,7 @@ #include #include #include +#include void python_export_igl(py::module &m) { @@ -201,4 +202,5 @@ void python_export_igl(py::module &m) #include "py_igl/py_writeOBJ.cpp" #include "py_igl/py_writePLY.cpp" #include "py_igl/py_readPLY.cpp" +#include "py_igl/py_seam_edges.cpp" } diff --git a/python/py_igl/py_seam_edges.cpp b/python/py_igl/py_seam_edges.cpp new file mode 100755 index 000000000..c3464012b --- /dev/null +++ b/python/py_igl/py_seam_edges.cpp @@ -0,0 +1,21 @@ +m.def("seam_edges", [] +( + const Eigen::MatrixXd& V, + const Eigen::MatrixXd& TC, + const Eigen::MatrixXi& F, + const Eigen::MatrixXi& FTC, + Eigen::MatrixXi& seams, + Eigen::MatrixXi& boundaries, + Eigen::MatrixXi& foldovers +) +{ +return igl::seam_edges( V, TC, F, FTC, seams, boundaries, foldovers); +}, __doc_igl_seam_edges, +py::arg("V"), +py::arg("TC"), +py::arg("F"), +py::arg("FTC"), +py::arg("seams"), +py::arg("boundaries"), +py::arg("foldovers")); +