Ver Fonte

Updated python_shared template file

Former-commit-id: 37120c6558bfb5a3572ba4976a6da20290f24162
Sebastian Koch há 9 anos atrás
pai
commit
3f03a17e1e
3 ficheiros alterados com 75 adições e 51 exclusões
  1. 48 48
      python/py_doc.cpp
  2. 3 3
      python/py_doc.h
  3. 24 0
      python/scripts/python_shared.mako

+ 48 - 48
python/py_doc.cpp

@@ -66,29 +66,6 @@ const char *__doc_igl_signed_distance_winding_number = R"igl_Qu8mg5v7(// Inputs:
   //   hier  Winding number evaluation hierarchy
   //   q  Query point
   // Returns signed distance to mesh)igl_Qu8mg5v7";
-const char *__doc_igl_triangle_triangulate = R"igl_Qu8mg5v7(// Triangulate the interior of a polygon using the triangle library.
-    //
-    // Inputs:
-    //   V #V by 2 list of 2D vertex positions
-    //   E #E by 2 list of vertex ids forming unoriented edges of the boundary of the polygon
-    //   H #H by 2 coordinates of points contained inside holes of the polygon
-    //   flags  string of options pass to triangle (see triangle documentation)
-    // Outputs:
-    //   V2  #V2 by 2  coordinates of the vertives of the generated triangulation
-    //   F2  #F2 by 3  list of indices forming the faces of the generated triangulation
-    //
-    // TODO: expose the option to prevent Steiner points on the boundary
-    //)igl_Qu8mg5v7";
-const char *__doc_igl_embree_ambient_occlusion = R"igl_Qu8mg5v7(// Compute ambient occlusion per given point
-    //
-    // Inputs:
-    //    ei  EmbreeIntersector containing (V,F)
-    //    P  #P by 3 list of origin points
-    //    N  #P by 3 list of origin normals
-    // Outputs:
-    //    S  #P list of ambient occlusion values between 1 (fully occluded) and
-    //      0 (not occluded)
-    //)igl_Qu8mg5v7";
 const char *__doc_igl_cotmatrix = R"igl_Qu8mg5v7(// Constructs the cotangent stiffness matrix (discrete laplacian) for a given
   // mesh (V,F).
   //
@@ -480,25 +457,6 @@ const char *__doc_igl_setdiff = R"igl_Qu8mg5v7(// Set difference of elements of
   //   C  (k<=m)-long vector of unique elements appearing in A but not in B
   //   IA  (k<=m)-long list of indices into A so that C = A(IA)
   //)igl_Qu8mg5v7";
-const char *__doc_igl_copyleft_tetgen_tetrahedralize = R"igl_Qu8mg5v7(// Mesh the interior of a surface mesh (V,F) using tetgen
-      //
-      // Inputs:
-      //   V  #V by 3 vertex position list
-      //   F  #F list of polygon face indices into V (0-indexed)
-      //   switches  string of tetgen options (See tetgen documentation) e.g.
-      //     "pq1.414a0.01" tries to mesh the interior of a given surface with
-      //       quality and area constraints
-      //     "" will mesh the convex hull constrained to pass through V (ignores F)
-      // Outputs:
-      //   TV  #V by 3 vertex position list
-      //   TT  #T by 4 list of tet face indices
-      //   TF  #F by 3 list of triangle face indices
-      // Returns status:
-      //   0 success
-      //   1 tetgen threw exception
-      //   2 tetgen did not crash but could not create any tets (probably there are
-      //     holes, duplicate faces etc.)
-      //   -1 other error)igl_Qu8mg5v7";
 const char *__doc_igl_comb_frame_field = R"igl_Qu8mg5v7(// Inputs:
   //   V            #V by 3 eigen Matrix of mesh vertex 3D positions
   //   F            #F by 4 eigen Matrix of face (quad) indices
@@ -789,12 +747,12 @@ const char *__doc_igl_cross_field_missmatch = R"igl_Qu8mg5v7(// Inputs:
   //   Handle_MMatch    #F by 3 eigen Matrix containing the integer missmatch of the cross field
   //                    across all face edges
   //)igl_Qu8mg5v7";
-const char *__doc_igl_grad = R"igl_Qu8mg5v7(// Gradient of a scalar function defined on piecewise linear elements (mesh)
-  // is constant on each triangle i,j,k:
-  // grad(Xijk) = (Xj-Xi) * (Vi - Vk)^R90 / 2A + (Xk-Xi) * (Vj - Vi)^R90 / 2A
-  // where Xi is the scalar value at vertex i, Vi is the 3D position of vertex
-  // i, and A is the area of triangle (i,j,k). ^R90 represent a rotation of
-  // 90 degrees
+const char *__doc_igl_grad = R"igl_Qu8mg5v7(// Gradient of a scalar function defined on piecewise linear elements (mesh)
+  // is constant on each triangle i,j,k:
+  // grad(Xijk) = (Xj-Xi) * (Vi - Vk)^R90 / 2A + (Xk-Xi) * (Vj - Vi)^R90 / 2A
+  // where Xi is the scalar value at vertex i, Vi is the 3D position of vertex
+  // i, and A is the area of triangle (i,j,k). ^R90 represent a rotation of
+  // 90 degrees
   //)igl_Qu8mg5v7";
 const char *__doc_igl_slice_into = R"igl_Qu8mg5v7(// Act like the matlab Y(row_indices,col_indices) = X
   // 
@@ -891,6 +849,38 @@ const char *__doc_igl_readMESH = R"igl_Qu8mg5v7(// load a tetrahedral volume mes
   //   F  #F list of face indices into vertex positions
   //
   // Known bugs: Holes and regions are not supported)igl_Qu8mg5v7";
+const char *__doc_igl_triangle_triangulate = R"igl_Qu8mg5v7(// Triangulate the interior of a polygon using the triangle library.
+    //
+    // Inputs:
+    //   V #V by 2 list of 2D vertex positions
+    //   E #E by 2 list of vertex ids forming unoriented edges of the boundary of the polygon
+    //   H #H by 2 coordinates of points contained inside holes of the polygon
+    //   flags  string of options pass to triangle (see triangle documentation)
+    // Outputs:
+    //   V2  #V2 by 2  coordinates of the vertives of the generated triangulation
+    //   F2  #F2 by 3  list of indices forming the faces of the generated triangulation
+    //
+    // TODO: expose the option to prevent Steiner points on the boundary
+    //)igl_Qu8mg5v7";
+const char *__doc_igl_copyleft_tetgen_tetrahedralize = R"igl_Qu8mg5v7(// Mesh the interior of a surface mesh (V,F) using tetgen
+      //
+      // Inputs:
+      //   V  #V by 3 vertex position list
+      //   F  #F list of polygon face indices into V (0-indexed)
+      //   switches  string of tetgen options (See tetgen documentation) e.g.
+      //     "pq1.414a0.01" tries to mesh the interior of a given surface with
+      //       quality and area constraints
+      //     "" will mesh the convex hull constrained to pass through V (ignores F)
+      // Outputs:
+      //   TV  #V by 3 vertex position list
+      //   TT  #T by 4 list of tet face indices
+      //   TF  #F by 3 list of triangle face indices
+      // Returns status:
+      //   0 success
+      //   1 tetgen threw exception
+      //   2 tetgen did not crash but could not create any tets (probably there are
+      //     holes, duplicate faces etc.)
+      //   -1 other error)igl_Qu8mg5v7";
 const char *__doc_igl_copyleft_comiso_miq = R"igl_Qu8mg5v7(// Inputs:
     //   V              #V by 3 list of mesh vertex 3D positions
     //   F              #F by 3 list of faces indices in V
@@ -929,3 +919,13 @@ const char *__doc_igl_copyleft_comiso_nrosy = R"igl_Qu8mg5v7(// Generate a N-RoS
     // Outputs:
     //   R       #F by 3 the representative vectors of the interpolated field
     //   S       #V by 1 the singularity index for each vertex (0 = regular))igl_Qu8mg5v7";
+const char *__doc_igl_embree_ambient_occlusion = R"igl_Qu8mg5v7(// Compute ambient occlusion per given point
+    //
+    // Inputs:
+    //    ei  EmbreeIntersector containing (V,F)
+    //    P  #P by 3 list of origin points
+    //    N  #P by 3 list of origin normals
+    // Outputs:
+    //    S  #P list of ambient occlusion values between 1 (fully occluded) and
+    //      0 (not occluded)
+    //)igl_Qu8mg5v7";

+ 3 - 3
python/py_doc.h

@@ -3,8 +3,6 @@ extern const char *__doc_igl_local_basis;
 extern const char *__doc_igl_signed_distance;
 extern const char *__doc_igl_signed_distance_pseudonormal;
 extern const char *__doc_igl_signed_distance_winding_number;
-extern const char *__doc_igl_triangle_triangulate;
-extern const char *__doc_igl_embree_ambient_occlusion;
 extern const char *__doc_igl_cotmatrix;
 extern const char *__doc_igl_floor;
 extern const char *__doc_igl_slice;
@@ -38,7 +36,6 @@ extern const char *__doc_igl_slice_mask;
 extern const char *__doc_igl_point_mesh_squared_distance;
 extern const char *__doc_igl_parula;
 extern const char *__doc_igl_setdiff;
-extern const char *__doc_igl_copyleft_tetgen_tetrahedralize;
 extern const char *__doc_igl_comb_frame_field;
 extern const char *__doc_igl_map_vertices_to_circle;
 extern const char *__doc_igl_writeOBJ;
@@ -73,5 +70,8 @@ extern const char *__doc_igl_polar_svd;
 extern const char *__doc_igl_comb_cross_field;
 extern const char *__doc_igl_invert_diag;
 extern const char *__doc_igl_readMESH;
+extern const char *__doc_igl_triangle_triangulate;
+extern const char *__doc_igl_copyleft_tetgen_tetrahedralize;
 extern const char *__doc_igl_copyleft_comiso_miq;
 extern const char *__doc_igl_copyleft_comiso_nrosy;
+extern const char *__doc_igl_embree_ambient_occlusion;

+ 24 - 0
python/scripts/python_shared.mako

@@ -14,6 +14,18 @@ extern void python_export_igl_viewer(py::module &);
 extern void python_export_igl_comiso(py::module &);
 #endif
 
+#ifdef PY_TETGEN
+extern void python_export_igl_tetgen(py::module &);
+#endif
+
+#ifdef PY_EMBREE
+extern void python_export_igl_embree(py::module &);
+#endif
+
+#ifdef PY_TRIANGLE
+extern void python_export_igl_triangle(py::module &);
+#endif
+
 PYBIND11_PLUGIN(pyigl) {
     py::module m("pyigl", R"pyigldoc(
         Python wrappers for libigl
@@ -42,5 +54,17 @@ PYBIND11_PLUGIN(pyigl) {
     python_export_igl_comiso(m);
     #endif
 
+    #ifdef PY_TETGEN
+    python_export_igl_tetgen(m);
+    #endif
+
+    #ifdef PY_EMBREE
+    python_export_igl_embree(m);
+    #endif
+
+    #ifdef PY_TRIANGLE
+    python_export_igl_triangle(m);
+    #endif
+
     return m.ptr();
 }