diff --git a/python/py_doc.cpp b/python/py_doc.cpp index 78d5ed273..df74a8b1b 100644 --- a/python/py_doc.cpp +++ b/python/py_doc.cpp @@ -1,492 +1,3 @@ -const char *__doc_igl_principal_curvature = R"igl_Qu8mg5v7(// Compute the principal curvature directions and magnitude of the given triangle mesh - // DerivedV derived from vertex positions matrix type: i.e. MatrixXd - // DerivedF derived from face indices matrix type: i.e. MatrixXi - // Inputs: - // V eigen matrix #V by 3 - // F #F by 3 list of mesh faces (must be triangles) - // radius controls the size of the neighbourhood used, 1 = average edge lenght - // - // Outputs: - // PD1 #V by 3 maximal curvature direction for each vertex. - // PD2 #V by 3 minimal curvature direction for each vertex. - // PV1 #V by 1 maximal curvature value for each vertex. - // PV2 #V by 1 minimal curvature value for each vertex. - // - // See also: average_onto_faces, average_onto_vertices - // - // This function has been developed by: Nikolas De Giorgis, Luigi Rocca and Enrico Puppo. - // The algorithm is based on: - // Efficient Multi-scale Curvature and Crease Estimation - // Daniele Panozzo, Enrico Puppo, Luigi Rocca - // GraVisMa, 2010)igl_Qu8mg5v7"; -const char *__doc_igl_local_basis = R"igl_Qu8mg5v7(// Compute a local orthogonal reference system for each triangle in the given mesh - // Templates: - // DerivedV derived from vertex positions matrix type: i.e. MatrixXd - // DerivedF derived from face indices matrix type: i.e. MatrixXi - // Inputs: - // V eigen matrix #V by 3 - // F #F by 3 list of mesh faces (must be triangles) - // Outputs: - // B1 eigen matrix #F by 3, each vector is tangent to the triangle - // B2 eigen matrix #F by 3, each vector is tangent to the triangle and perpendicular to B1 - // B3 eigen matrix #F by 3, normal of the triangle - // - // See also: adjacency_matrix)igl_Qu8mg5v7"; -const char *__doc_igl_signed_distance = R"igl_Qu8mg5v7(// Computes signed distance to a mesh - // - // Inputs: - // P #P by 3 list of query point positions - // V #V by 3 list of vertex positions - // F #F by ss list of triangle indices, ss should be 3 unless sign_type == - // SIGNED_DISTANCE_TYPE_UNSIGNED - // sign_type method for computing distance _sign_ S - // Outputs: - // S #P list of smallest signed distances - // I #P list of facet indices corresponding to smallest distances - // C #P by 3 list of closest points - // N #P by 3 list of closest normals (only set if - // sign_type=SIGNED_DISTANCE_TYPE_PSEUDONORMAL) - // - // Known bugs: This only computes distances to triangles. So unreferenced - // vertices and degenerate triangles are ignored.)igl_Qu8mg5v7"; -const char *__doc_igl_signed_distance_pseudonormal = R"igl_Qu8mg5v7(// Computes signed distance to mesh - // - // Inputs: - // tree AABB acceleration tree (see AABB.h) - // F #F by 3 list of triangle indices - // FN #F by 3 list of triangle normals - // VN #V by 3 list of vertex normals (ANGLE WEIGHTING) - // EN #E by 3 list of edge normals (UNIFORM WEIGHTING) - // EMAP #F*3 mapping edges in F to E - // q Query point - // Returns signed distance to mesh - //)igl_Qu8mg5v7"; -const char *__doc_igl_signed_distance_winding_number = R"igl_Qu8mg5v7(// Inputs: - // tree AABB acceleration tree (see cgal/point_mesh_squared_distance.h) - // hier Winding number evaluation hierarchy - // q Query point - // Returns signed distance to mesh)igl_Qu8mg5v7"; -const char *__doc_igl_cotmatrix = R"igl_Qu8mg5v7(// Constructs the cotangent stiffness matrix (discrete laplacian) for a given - // mesh (V,F). - // - // Templates: - // DerivedV derived type of eigen matrix for V (e.g. derived from - // MatrixXd) - // DerivedF derived type of eigen matrix for F (e.g. derived from - // MatrixXi) - // Scalar scalar type for eigen sparse matrix (e.g. double) - // Inputs: - // V #V by dim list of mesh vertex positions - // F #F by simplex_size list of mesh faces (must be triangles) - // Outputs: - // L #V by #V cotangent matrix, each row i corresponding to V(i,:) - // - // See also: adjacency_matrix - // - // Note: This Laplacian uses the convention that diagonal entries are - // **minus** the sum of off-diagonal entries. The diagonal entries are - // therefore in general negative and the matrix is **negative** semi-definite - // (immediately, -L is **positive** semi-definite) - // - // Known bugs: off by 1e-16 on regular grid. I think its a problem of - // arithmetic order in cotmatrix_entries.h: C(i,e) = (arithmetic)/dblA/4)igl_Qu8mg5v7"; -const char *__doc_igl_floor = R"igl_Qu8mg5v7(// Floor a given matrix to nearest integers - // - // Inputs: - // X m by n matrix of scalars - // Outputs: - // Y m by n matrix of floored integers)igl_Qu8mg5v7"; -const char *__doc_igl_slice = R"igl_Qu8mg5v7(// Act like the matlab X(row_indices,col_indices) operator, where - // row_indices, col_indices are non-negative integer indices. - // - // Inputs: - // X m by n matrix - // R list of row indices - // C list of column indices - // Output: - // Y #R by #C matrix - // - // See also: slice_mask)igl_Qu8mg5v7"; -const char *__doc_igl_per_face_normals = R"igl_Qu8mg5v7(// Compute face normals via vertex position list, face list - // Inputs: - // V #V by 3 eigen Matrix of mesh vertex 3D positions - // F #F by 3 eigen Matrix of face (triangle) indices - // Z 3 vector normal given to faces with degenerate normal. - // Output: - // N #F by 3 eigen Matrix of mesh face (triangle) 3D normals - // - // Example: - // // Give degenerate faces (1/3,1/3,1/3)^0.5 - // per_face_normals(V,F,Vector3d(1,1,1).normalized(),N);)igl_Qu8mg5v7"; -const char *__doc_igl_per_face_normals_stable = R"igl_Qu8mg5v7(// Special version where order of face indices is guaranteed not to effect - // output.)igl_Qu8mg5v7"; -const char *__doc_igl_quad_planarity = R"igl_Qu8mg5v7(// Compute planarity of the faces of a quad mesh - // Inputs: - // V #V by 3 eigen Matrix of mesh vertex 3D positions - // F #F by 4 eigen Matrix of face (quad) indices - // Output: - // P #F by 1 eigen Matrix of mesh face (quad) planarities - //)igl_Qu8mg5v7"; -const char *__doc_igl_readOFF = R"igl_Qu8mg5v7(// Read a mesh from an ascii obj file, filling in vertex positions, normals - // and texture coordinates. Mesh may have faces of any number of degree - // - // Templates: - // Scalar type for positions and vectors (will be read as double and cast - // to Scalar) - // Index type for indices (will be read as int and cast to Index) - // 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 - // TC double matrix of texture coordinats #TC by 2 - // FTC #F list of face indices into vertex texture coordinates - // N double matrix of corner normals #N by 3 - // FN #F list of face indices into vertex normals - // Returns true on success, false on errors)igl_Qu8mg5v7"; -const char *__doc_igl_per_vertex_normals = R"igl_Qu8mg5v7(// Compute vertex normals via vertex position list, face list - // Inputs: - // V #V by 3 eigen Matrix of mesh vertex 3D positions - // F #F by 3 eigne Matrix of face (triangle) indices - // weighting Weighting type - // Output: - // N #V by 3 eigen Matrix of mesh vertex 3D normals)igl_Qu8mg5v7"; -const char *__doc_igl_sortrows = R"igl_Qu8mg5v7(// Act like matlab's [Y,I] = sortrows(X) - // - // Templates: - // DerivedX derived scalar type, e.g. MatrixXi or MatrixXd - // DerivedI derived integer type, e.g. MatrixXi - // Inputs: - // X m by n matrix whose entries are to be sorted - // ascending sort ascending (true, matlab default) or descending (false) - // Outputs: - // Y m by n matrix whose entries are sorted (**should not** be same - // reference as X) - // I m list of indices so that - // Y = X(I,:);)igl_Qu8mg5v7"; -const char *__doc_igl_barycenter = R"igl_Qu8mg5v7(// Computes the barycenter of every simplex - // - // Inputs: - // V #V x dim matrix of vertex coordinates - // F #F x simplex_size matrix of indices of simplex corners into V - // Output: - // BC #F x dim matrix of 3d vertices - //)igl_Qu8mg5v7"; -const char *__doc_igl_jet = R"igl_Qu8mg5v7(// JET like MATLAB's jet - // - // Inputs: - // m number of colors - // Outputs: - // J m by list of RGB colors between 0 and 1 - // -//#ifndef IGL_NO_EIGEN -// void jet(const int m, Eigen::MatrixXd & J); -//#endif - // Wrapper for directly computing [r,g,b] values for a given factor f between - // 0 and 1 - // - // Inputs: - // f factor determining color value as if 0 was min and 1 was max - // Outputs: - // r red value - // g green value - // b blue value)igl_Qu8mg5v7"; -const char *__doc_igl_cat = R"igl_Qu8mg5v7(// Perform concatenation of a two matrices along a single dimension - // If dim == 1, then C = [A;B]. If dim == 2 then C = [A B] - // - // Template: - // Scalar scalar data type for sparse matrices like double or int - // Mat matrix type for all matrices (e.g. MatrixXd, SparseMatrix) - // MatC matrix type for ouput matrix (e.g. MatrixXd) needs to support - // resize - // Inputs: - // A first input matrix - // B second input matrix - // dim dimension along which to concatenate, 0 or 1 - // Outputs: - // C output matrix - // )igl_Qu8mg5v7"; -const char *__doc_igl_eigs = R"igl_Qu8mg5v7(See eigs for the documentation.)igl_Qu8mg5v7"; -const char *__doc_igl_per_corner_normals = R"igl_Qu8mg5v7(// Compute vertex normals via vertex position list, face list - // Inputs: - // V #V by 3 eigen Matrix of mesh vertex 3D positions - // F #F by 3 eigne Matrix of face (triangle) indices - // corner_threshold threshold in degrees on sharp angles - // Output: - // CN #F*3 by 3 eigen Matrix of mesh vertex 3D normals, where the normal - // for corner F(i,j) is at CN(i*3+j,:) )igl_Qu8mg5v7"; -const char *__doc_igl_massmatrix = R"igl_Qu8mg5v7(// Constructs the mass (area) matrix for a given mesh (V,F). - // - // Templates: - // DerivedV derived type of eigen matrix for V (e.g. derived from - // MatrixXd) - // DerivedF derived type of eigen matrix for F (e.g. derived from - // MatrixXi) - // Scalar scalar type for eigen sparse matrix (e.g. double) - // Inputs: - // V #V by dim list of mesh vertex positions - // F #F by simplex_size list of mesh faces (must be triangles) - // type one of the following ints: - // MASSMATRIX_TYPE_BARYCENTRIC barycentric - // MASSMATRIX_TYPE_VORONOI voronoi-hybrid {default} - // MASSMATRIX_TYPE_FULL full {not implemented} - // Outputs: - // M #V by #V mass matrix - // - // See also: adjacency_matrix - //)igl_Qu8mg5v7"; -const char *__doc_igl_unproject_onto_mesh = R"igl_Qu8mg5v7(// Unproject a screen location (using current opengl viewport, projection, and - // model view) to a 3D position _onto_ a given mesh, if the ray through the - // given screen location (x,y) _hits_ the mesh. - // - // Inputs: - // pos screen space coordinates - // model model matrix - // proj projection matrix - // viewport vieweport vector - // V #V by 3 list of mesh vertex positions - // F #F by 3 list of mesh triangle indices into V - // Outputs: - // fid id of the first face hit - // bc barycentric coordinates of hit - // Returns true if there's a hit)igl_Qu8mg5v7"; -const char *__doc_igl_colon = R"igl_Qu8mg5v7(// Colon operator like matlab's colon operator. Enumerats values between low - // and hi with step step. - // Templates: - // L should be a eigen matrix primitive type like int or double - // S should be a eigen matrix primitive type like int or double - // H should be a eigen matrix primitive type like int or double - // T should be a eigen matrix primitive type like int or double - // Inputs: - // low starting value if step is valid then this is *always* the first - // element of I - // step step difference between sequential elements returned in I, - // remember this will be cast to template T at compile time. If lowhi then step must be negative. - // Otherwise I will be set to empty. - // hi ending value, if (hi-low)%step is zero then this will be the last - // element in I. If step is positive there will be no elements greater - // than hi, vice versa if hihi then step must be negative. + // Otherwise I will be set to empty. + // hi ending value, if (hi-low)%step is zero then this will be the last + // element in I. If step is positive there will be no elements greater + // than hi, vice versa if hi smoothness only, 1->constraints only) + // 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_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_cotmatrix = R"igl_Qu8mg5v7(// Constructs the cotangent stiffness matrix (discrete laplacian) for a given + // mesh (V,F). // // Templates: - // DerivedV derived from vertex positions matrix type: i.e. MatrixXd - // DerivedF derived from face indices matrix type: i.e. MatrixXi - // DerivedL derived from edge lengths matrix type: i.e. MatrixXd + // DerivedV derived type of eigen matrix for V (e.g. derived from + // MatrixXd) + // DerivedF derived type of eigen matrix for F (e.g. derived from + // MatrixXi) + // Scalar scalar type for eigen sparse matrix (e.g. double) // Inputs: - // V eigen matrix #V by 3 - // F #F by 2 list of mesh edges - // or - // F #F by 3 list of mesh faces (must be triangles) - // or - // T #T by 4 list of mesh elements (must be tets) + // V #V by dim list of mesh vertex positions + // F #F by simplex_size list of mesh faces (must be triangles) + // Outputs: + // L #V by #V cotangent matrix, each row i corresponding to V(i,:) + // + // See also: adjacency_matrix + // + // Note: This Laplacian uses the convention that diagonal entries are + // **minus** the sum of off-diagonal entries. The diagonal entries are + // therefore in general negative and the matrix is **negative** semi-definite + // (immediately, -L is **positive** semi-definite) + // + // Known bugs: off by 1e-16 on regular grid. I think its a problem of + // arithmetic order in cotmatrix_entries.h: C(i,e) = (arithmetic)/dblA/4)igl_Qu8mg5v7"; +const char *__doc_igl_covariance_scatter_matrix = R"igl_Qu8mg5v7(// Construct the covariance scatter matrix for a given arap energy + // Inputs: + // V #V by Vdim list of initial domain positions + // F #F by 3 list of triangle indices into V + // energy ARAPEnergyType enum value defining which energy is being used. + // See ARAPEnergyType.h for valid options and explanations. // Outputs: - // L #F by {1|3|6} list of edge lengths - // for edges, column of lengths - // for triangles, columns correspond to edges [1,2],[2,0],[0,1] - // for tets, columns correspond to edges - // [3 0],[3 1],[3 2],[1 2],[2 0],[0 1] + // CSM dim*#V/#F by dim*#V sparse matrix containing special laplacians along + // the diagonal so that when multiplied by V gives covariance matrix + // elements, can be used to speed up covariance matrix computation)igl_Qu8mg5v7"; +const char *__doc_igl_cross_field_missmatch = R"igl_Qu8mg5v7(// Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigen Matrix of face (quad) indices + // PD1 #F by 3 eigen Matrix of the first per face cross field vector + // PD2 #F by 3 eigen Matrix of the second per face cross field vector + // isCombed boolean, specifying whether the field is combed (i.e. matching has been precomputed. + // If not, the field is combed first. + // Output: + // 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_readOBJ = R"igl_Qu8mg5v7(// Read a mesh from an ascii obj file, filling in vertex positions, normals - // and texture coordinates. Mesh may have faces of any number of degree - // - // Templates: - // Scalar type for positions and vectors (will be read as double and cast - // to Scalar) - // Index type for indices (will be read as int and cast to Index) - // Inputs: - // str path to .obj file - // Outputs: - // V double matrix of vertex positions #V by 3 - // TC double matrix of texture coordinats #TC by 2 - // N double matrix of corner normals #N by 3 - // F #F list of face indices into vertex positions - // FTC #F list of face indices into vertex texture coordinates - // FN #F list of face indices into vertex normals - // Returns true on success, false on errors)igl_Qu8mg5v7"; const char *__doc_igl_cut_mesh_from_singularities = R"igl_Qu8mg5v7(// Given a mesh (V,F) and the integer mismatch of a cross field per edge // (MMatch), finds the cut_graph connecting the singularities (seams) and the // degree of the singularities singularity_index @@ -615,7 +295,6 @@ const char *__doc_igl_cut_mesh_from_singularities = R"igl_Qu8mg5v7(// Given a me // seams #F by 3 list of per corner booleans that denotes if an edge is a // seam or not //)igl_Qu8mg5v7"; -const char *__doc_igl_readDMAT = R"igl_Qu8mg5v7(See readDMAT for the documentation.)igl_Qu8mg5v7"; const char *__doc_igl_doublearea = R"igl_Qu8mg5v7(// DOUBLEAREA computes twice the area for each input triangle[quad] // // Templates: @@ -644,6 +323,190 @@ const char *__doc_igl_doublearea_quad = R"igl_Qu8mg5v7(// DOUBLEAREA_QUAD comput // Outputs: // dblA #F list of quadrilateral double areas //)igl_Qu8mg5v7"; +const char *__doc_igl_edge_lengths = R"igl_Qu8mg5v7(// Constructs a list of lengths of edges opposite each index in a face + // (triangle/tet) list + // + // Templates: + // DerivedV derived from vertex positions matrix type: i.e. MatrixXd + // DerivedF derived from face indices matrix type: i.e. MatrixXi + // DerivedL derived from edge lengths matrix type: i.e. MatrixXd + // Inputs: + // V eigen matrix #V by 3 + // F #F by 2 list of mesh edges + // or + // F #F by 3 list of mesh faces (must be triangles) + // or + // T #T by 4 list of mesh elements (must be tets) + // Outputs: + // L #F by {1|3|6} list of edge lengths + // for edges, column of lengths + // for triangles, columns correspond to edges [1,2],[2,0],[0,1] + // for tets, columns correspond to edges + // [3 0],[3 1],[3 2],[1 2],[2 0],[0 1] + //)igl_Qu8mg5v7"; +const char *__doc_igl_eigs = R"igl_Qu8mg5v7(See eigs for the documentation.)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_find_cross_field_singularities = R"igl_Qu8mg5v7(// Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigen Matrix of face (quad) indices + // Handle_MMatch #F by 3 eigen Matrix containing the integer missmatch of the cross field + // across all face edges + // Output: + // isSingularity #V by 1 boolean eigen Vector indicating the presence of a singularity on a vertex + // singularityIndex #V by 1 integer eigen Vector containing the singularity indices + //)igl_Qu8mg5v7"; +const char *__doc_igl_fit_rotations = R"igl_Qu8mg5v7(// Known issues: This seems to be implemented in Eigen/Geometry: + // Eigen::umeyama + // + // FIT_ROTATIONS Given an input mesh and new positions find rotations for + // every covariance matrix in a stack of covariance matrices + // + // Inputs: + // S nr*dim by dim stack of covariance matrices + // single_precision whether to use single precision (faster) + // Outputs: + // R dim by dim * nr list of rotations + //)igl_Qu8mg5v7"; +const char *__doc_igl_fit_rotations_planar = R"igl_Qu8mg5v7(// FIT_ROTATIONS Given an input mesh and new positions find 2D rotations for + // every vertex that best maps its one ring to the new one ring + // + // Inputs: + // S nr*dim by dim stack of covariance matrices, third column and every + // third row will be ignored + // Outputs: + // R dim by dim * nr list of rotations, third row and third column of each + // rotation will just be identity + //)igl_Qu8mg5v7"; +const char *__doc_igl_fit_rotations_SSE = R"igl_Qu8mg5v7(See fit_rotations_SSE for the documentation.)igl_Qu8mg5v7"; +const char *__doc_igl_floor = R"igl_Qu8mg5v7(// Floor a given matrix to nearest integers + // + // Inputs: + // X m by n matrix of scalars + // Outputs: + // Y m by n matrix of floored integers)igl_Qu8mg5v7"; +const char *__doc_igl_gaussian_curvature = R"igl_Qu8mg5v7(// Compute discrete local integral gaussian curvature (angle deficit, without + // averaging by local area). + // + // Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigen Matrix of face (triangle) indices + // Output: + // K #V by 1 eigen Matrix of discrete gaussian curvature values + //)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 + //)igl_Qu8mg5v7"; +const char *__doc_igl_harmonic = R"igl_Qu8mg5v7(// Compute k-harmonic weight functions "coordinates". + // + // + // Inputs: + // V #V by dim vertex positions + // F #F by simplex-size list of element indices + // b #b boundary indices into V + // bc #b by #W list of boundary values + // k power of harmonic operation (1: harmonic, 2: biharmonic, etc) + // Outputs: + // W #V by #W list of weights + //)igl_Qu8mg5v7"; +const char *__doc_igl_invert_diag = R"igl_Qu8mg5v7(// Templates: + // T should be a eigen sparse matrix primitive type like int or double + // Inputs: + // X an m by n sparse matrix + // Outputs: + // Y an m by n sparse matrix)igl_Qu8mg5v7"; +const char *__doc_igl_jet = R"igl_Qu8mg5v7(// JET like MATLAB's jet + // + // Inputs: + // m number of colors + // Outputs: + // J m by list of RGB colors between 0 and 1 + // +//#ifndef IGL_NO_EIGEN +// void jet(const int m, Eigen::MatrixXd & J); +//#endif + // Wrapper for directly computing [r,g,b] values for a given factor f between + // 0 and 1 + // + // Inputs: + // f factor determining color value as if 0 was min and 1 was max + // Outputs: + // r red value + // g green value + // b blue value)igl_Qu8mg5v7"; +const char *__doc_igl_local_basis = R"igl_Qu8mg5v7(// Compute a local orthogonal reference system for each triangle in the given mesh + // Templates: + // DerivedV derived from vertex positions matrix type: i.e. MatrixXd + // DerivedF derived from face indices matrix type: i.e. MatrixXi + // Inputs: + // V eigen matrix #V by 3 + // F #F by 3 list of mesh faces (must be triangles) + // Outputs: + // B1 eigen matrix #F by 3, each vector is tangent to the triangle + // B2 eigen matrix #F by 3, each vector is tangent to the triangle and perpendicular to B1 + // B3 eigen matrix #F by 3, normal of the triangle + // + // See also: adjacency_matrix)igl_Qu8mg5v7"; +const char *__doc_igl_lscm = R"igl_Qu8mg5v7(// Compute a Least-squares conformal map parametrization (equivalently + // derived in "Intrinsic Parameterizations of Surface Meshes" [Desbrun et al. + // 2002] and "Least Squares Conformal Maps for Automatic Texture Atlas + // Generation" [Lévy et al. 2002]), though this implementation follows the + // derivation in: "Spectral Conformal Parameterization" [Mullen et al. 2008] + // (note, this does **not** implement the Eigen-decomposition based method in + // [Mullen et al. 2008], which is not equivalent). Input should be a manifold + // mesh (also no unreferenced vertices) and "boundary" (fixed vertices) `b` + // should contain at least two vertices per connected component. + // + // Inputs: + // V #V by 3 list of mesh vertex positions + // F #F by 3 list of mesh faces (must be triangles) + // b #b boundary indices into V + // bc #b by 3 list of boundary values + // Outputs: + // UV #V by 2 list of 2D mesh vertex positions in UV space + // Returns true only on solver success. + //)igl_Qu8mg5v7"; +const char *__doc_igl_map_vertices_to_circle = R"igl_Qu8mg5v7(// Map the vertices whose indices are in a given boundary loop (bnd) on the + // unit circle with spacing proportional to the original boundary edge + // lengths. + // + // Inputs: + // V #V by dim list of mesh vertex positions + // b #W list of vertex ids + // Outputs: + // UV #W by 2 list of 2D position on the unit circle for the vertices in b)igl_Qu8mg5v7"; +const char *__doc_igl_massmatrix = R"igl_Qu8mg5v7(// Constructs the mass (area) matrix for a given mesh (V,F). + // + // Templates: + // DerivedV derived type of eigen matrix for V (e.g. derived from + // MatrixXd) + // DerivedF derived type of eigen matrix for F (e.g. derived from + // MatrixXi) + // Scalar scalar type for eigen sparse matrix (e.g. double) + // Inputs: + // V #V by dim list of mesh vertex positions + // F #F by simplex_size list of mesh faces (must be triangles) + // type one of the following ints: + // MASSMATRIX_TYPE_BARYCENTRIC barycentric + // MASSMATRIX_TYPE_VORONOI voronoi-hybrid {default} + // MASSMATRIX_TYPE_FULL full {not implemented} + // Outputs: + // M #V by #V mass matrix + // + // See also: adjacency_matrix + //)igl_Qu8mg5v7"; const char *__doc_igl_min_quad_with_fixed_precompute = R"igl_Qu8mg5v7(// Known Bugs: rows of Aeq **should probably** be linearly independent. // During precomputation, the rows of a Aeq are checked via QR. But in case // they're not then resulting probably will no longer be sparse: it will be @@ -688,18 +551,325 @@ const char *__doc_igl_min_quad_with_fixed_solve = R"igl_Qu8mg5v7(// Solves a sys // sol #unknowns+#lagrange by cols solution to linear system // Returns true on success, false on error)igl_Qu8mg5v7"; const char *__doc_igl_min_quad_with_fixed = R"igl_Qu8mg5v7(See min_quad_with_fixed for the documentation.)igl_Qu8mg5v7"; -const char *__doc_igl_writeMESH = R"igl_Qu8mg5v7(// save a tetrahedral volume mesh to a .mesh file +const char *__doc_igl_n_polyvector = R"igl_Qu8mg5v7(// Inputs: + // v0, v1 the two #3 by 1 vectors + // normalized boolean, if false, then the vectors are normalized prior to the calculation + // Output: + // 3 by 3 rotation matrix that takes v0 to v1 + //)igl_Qu8mg5v7"; +const char *__doc_igl_parula = R"igl_Qu8mg5v7(// PARULA like MATLAB's parula + // + // Inputs: + // m number of colors + // Outputs: + // J m by list of RGB colors between 0 and 1 + // + // Wrapper for directly computing [r,g,b] values for a given factor f between + // 0 and 1 + // + // Inputs: + // f factor determining color value as if 0 was min and 1 was max + // Outputs: + // r red value + // g green value + // b blue value)igl_Qu8mg5v7"; +const char *__doc_igl_per_corner_normals = R"igl_Qu8mg5v7(// Compute vertex normals via vertex position list, face list + // Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigne Matrix of face (triangle) indices + // corner_threshold threshold in degrees on sharp angles + // Output: + // CN #F*3 by 3 eigen Matrix of mesh vertex 3D normals, where the normal + // for corner F(i,j) is at CN(i*3+j,:) )igl_Qu8mg5v7"; +const char *__doc_igl_per_edge_normals = R"igl_Qu8mg5v7(// Compute face normals via vertex position list, face list + // Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigen Matrix of face (triangle) indices + // weight weighting type + // FN #F by 3 matrix of 3D face normals per face + // Output: + // N #2 by 3 matrix of mesh edge 3D normals per row + // E #E by 2 matrix of edge indices per row + // EMAP #E by 1 matrix of indices from all edges to E + //)igl_Qu8mg5v7"; +const char *__doc_igl_per_face_normals = R"igl_Qu8mg5v7(// Compute face normals via vertex position list, face list + // Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigen Matrix of face (triangle) indices + // Z 3 vector normal given to faces with degenerate normal. + // Output: + // N #F by 3 eigen Matrix of mesh face (triangle) 3D normals + // + // Example: + // // Give degenerate faces (1/3,1/3,1/3)^0.5 + // per_face_normals(V,F,Vector3d(1,1,1).normalized(),N);)igl_Qu8mg5v7"; +const char *__doc_igl_per_face_normals_stable = R"igl_Qu8mg5v7(// Special version where order of face indices is guaranteed not to effect + // output.)igl_Qu8mg5v7"; +const char *__doc_igl_per_vertex_normals = R"igl_Qu8mg5v7(// Compute vertex normals via vertex position list, face list + // Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 3 eigne Matrix of face (triangle) indices + // weighting Weighting type + // Output: + // N #V by 3 eigen Matrix of mesh vertex 3D normals)igl_Qu8mg5v7"; +const char *__doc_igl_planarize_quad_mesh = R"igl_Qu8mg5v7(// Inputs: + // Vin #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 4 eigen Matrix of face (quad) indices + // maxIter maximum numbers of iterations + // threshold minimum allowed threshold for non-planarity + // Output: + // Vout #V by 3 eigen Matrix of planar mesh vertex 3D positions + //)igl_Qu8mg5v7"; +const char *__doc_igl_point_mesh_squared_distance = R"igl_Qu8mg5v7(// Compute distances from a set of points P to a triangle mesh (V,F) + // + // Inputs: + // P #P by 3 list of query point positions + // V #V by 3 list of vertex positions + // Ele #Ele by (3|2|1) list of (triangle|edge|point) indices + // Outputs: + // sqrD #P list of smallest squared distances + // I #P list of primitive indices corresponding to smallest distances + // C #P by 3 list of closest points + // + // Known bugs: This only computes distances to given primitivess. So + // unreferenced vertices are ignored. However, degenerate primitives are + // handled correctly: triangle [1 2 2] is treated as a segment [1 2], and + // triangle [1 1 1] is treated as a point. So one _could_ add extra + // combinatorially degenerate rows to Ele for all unreferenced vertices to + // also get distances to points.)igl_Qu8mg5v7"; +const char *__doc_igl_polar_svd = R"igl_Qu8mg5v7(// Computes the polar decomposition (R,T) of a matrix A using SVD singular + // value decomposition + // + // Inputs: + // A 3 by 3 matrix to be decomposed + // Outputs: + // R 3 by 3 rotation matrix part of decomposition (**always rotataion**) + // T 3 by 3 stretch matrix part of decomposition + // U 3 by 3 left-singular vectors + // S 3 by 1 singular values + // V 3 by 3 right-singular vectors + // + //)igl_Qu8mg5v7"; +const char *__doc_igl_principal_curvature = R"igl_Qu8mg5v7(// Compute the principal curvature directions and magnitude of the given triangle mesh + // DerivedV derived from vertex positions matrix type: i.e. MatrixXd + // DerivedF derived from face indices matrix type: i.e. MatrixXi + // Inputs: + // V eigen matrix #V by 3 + // F #F by 3 list of mesh faces (must be triangles) + // radius controls the size of the neighbourhood used, 1 = average edge lenght + // + // Outputs: + // PD1 #V by 3 maximal curvature direction for each vertex. + // PD2 #V by 3 minimal curvature direction for each vertex. + // PV1 #V by 1 maximal curvature value for each vertex. + // PV2 #V by 1 minimal curvature value for each vertex. + // + // See also: average_onto_faces, average_onto_vertices + // + // This function has been developed by: Nikolas De Giorgis, Luigi Rocca and Enrico Puppo. + // The algorithm is based on: + // Efficient Multi-scale Curvature and Crease Estimation + // Daniele Panozzo, Enrico Puppo, Luigi Rocca + // GraVisMa, 2010)igl_Qu8mg5v7"; +const char *__doc_igl_quad_planarity = R"igl_Qu8mg5v7(// Compute planarity of the faces of a quad mesh + // Inputs: + // V #V by 3 eigen Matrix of mesh vertex 3D positions + // F #F by 4 eigen Matrix of face (quad) indices + // Output: + // P #F by 1 eigen Matrix of mesh face (quad) planarities + //)igl_Qu8mg5v7"; +const char *__doc_igl_readDMAT = R"igl_Qu8mg5v7(See readDMAT for the documentation.)igl_Qu8mg5v7"; +const char *__doc_igl_readMESH = R"igl_Qu8mg5v7(// load a tetrahedral volume mesh from a .mesh file // // Templates: - // Scalar type for positions and vectors (will be cast as double) - // Index type for indices (will be cast to int) + // Scalar type for positions and vectors (will be read as double and cast + // to Scalar) + // Index type for indices (will be read as int and cast to Index) // Input: // mesh_file_name path of .mesh file + // Outputs: // V double matrix of vertex positions #V by 3 // T #T list of tet indices into vertex positions // F #F list of face indices into vertex positions // // Known bugs: Holes and regions are not supported)igl_Qu8mg5v7"; +const char *__doc_igl_readOBJ = R"igl_Qu8mg5v7(// Read a mesh from an ascii obj file, filling in vertex positions, normals + // and texture coordinates. Mesh may have faces of any number of degree + // + // Templates: + // Scalar type for positions and vectors (will be read as double and cast + // to Scalar) + // Index type for indices (will be read as int and cast to Index) + // Inputs: + // str path to .obj file + // Outputs: + // V double matrix of vertex positions #V by 3 + // TC double matrix of texture coordinats #TC by 2 + // N double matrix of corner normals #N by 3 + // F #F list of face indices into vertex positions + // FTC #F list of face indices into vertex texture coordinates + // FN #F list of face indices into vertex normals + // Returns true on success, false on errors)igl_Qu8mg5v7"; +const char *__doc_igl_readOFF = R"igl_Qu8mg5v7(// Read a mesh from an ascii obj file, filling in vertex positions, normals + // and texture coordinates. Mesh may have faces of any number of degree + // + // Templates: + // Scalar type for positions and vectors (will be read as double and cast + // to Scalar) + // Index type for indices (will be read as int and cast to Index) + // 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 + // TC double matrix of texture coordinats #TC by 2 + // FTC #F list of face indices into vertex texture coordinates + // N double matrix of corner normals #N by 3 + // FN #F list of face indices into vertex normals + // Returns true on success, false on errors)igl_Qu8mg5v7"; +const char *__doc_igl_read_triangle_mesh = R"igl_Qu8mg5v7(// read mesh from an ascii file with automatic detection of file format. + // supported: obj, off, stl, wrl, ply, mesh) + // + // Templates: + // Scalar type for positions and vectors (will be read as double and cast + // to Scalar) + // Index type for indices (will be read as int and cast to Index) + // Inputs: + // str path to file + // Outputs: + // V eigen double matrix #V by 3 + // F eigen int matrix #F by 3 + // Returns true iff success)igl_Qu8mg5v7"; +const char *__doc_igl_rotate_vectors = R"igl_Qu8mg5v7(// Rotate the vectors V by A radiants on the tangent plane spanned by B1 and + // B2 + // + // Inputs: + // V #V by 3 eigen Matrix of vectors + // A #V eigen vector of rotation angles or a single angle to be applied + // to all vectors + // B1 #V by 3 eigen Matrix of base vector 1 + // B2 #V by 3 eigen Matrix of base vector 2 + // + // Output: + // Returns the rotated vectors + //)igl_Qu8mg5v7"; +const char *__doc_igl_setdiff = R"igl_Qu8mg5v7(// Set difference of elements of matrices + // + // Inputs: + // A m-long vector of indices + // B n-long vector of indices + // Outputs: + // 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_signed_distance = R"igl_Qu8mg5v7(// Computes signed distance to a mesh + // + // Inputs: + // P #P by 3 list of query point positions + // V #V by 3 list of vertex positions + // F #F by ss list of triangle indices, ss should be 3 unless sign_type == + // SIGNED_DISTANCE_TYPE_UNSIGNED + // sign_type method for computing distance _sign_ S + // Outputs: + // S #P list of smallest signed distances + // I #P list of facet indices corresponding to smallest distances + // C #P by 3 list of closest points + // N #P by 3 list of closest normals (only set if + // sign_type=SIGNED_DISTANCE_TYPE_PSEUDONORMAL) + // + // Known bugs: This only computes distances to triangles. So unreferenced + // vertices and degenerate triangles are ignored.)igl_Qu8mg5v7"; +const char *__doc_igl_signed_distance_pseudonormal = R"igl_Qu8mg5v7(// Computes signed distance to mesh + // + // Inputs: + // tree AABB acceleration tree (see AABB.h) + // F #F by 3 list of triangle indices + // FN #F by 3 list of triangle normals + // VN #V by 3 list of vertex normals (ANGLE WEIGHTING) + // EN #E by 3 list of edge normals (UNIFORM WEIGHTING) + // EMAP #F*3 mapping edges in F to E + // q Query point + // Returns signed distance to mesh + //)igl_Qu8mg5v7"; +const char *__doc_igl_signed_distance_winding_number = R"igl_Qu8mg5v7(// Inputs: + // tree AABB acceleration tree (see cgal/point_mesh_squared_distance.h) + // hier Winding number evaluation hierarchy + // q Query point + // Returns signed distance to mesh)igl_Qu8mg5v7"; +const char *__doc_igl_slice = R"igl_Qu8mg5v7(// Act like the matlab X(row_indices,col_indices) operator, where + // row_indices, col_indices are non-negative integer indices. + // + // Inputs: + // X m by n matrix + // R list of row indices + // C list of column indices + // Output: + // Y #R by #C matrix + // + // See also: slice_mask)igl_Qu8mg5v7"; +const char *__doc_igl_slice_into = R"igl_Qu8mg5v7(// Act like the matlab Y(row_indices,col_indices) = X + // + // Inputs: + // X xm by xn rhs matrix + // R list of row indices + // C list of column indices + // Y ym by yn lhs matrix + // Output: + // Y ym by yn lhs matrix, same as input but Y(R,C) = X)igl_Qu8mg5v7"; +const char *__doc_igl_slice_mask = R"igl_Qu8mg5v7(// Act like the matlab X(row_mask,col_mask) operator, where + // row_mask, col_mask are non-negative integer indices. + // + // Inputs: + // X m by n matrix + // R m list of row bools + // C n list of column bools + // Output: + // Y #trues-in-R by #trues-in-C matrix + // + // See also: slice_mask)igl_Qu8mg5v7"; +const char *__doc_igl_slice_tets = R"igl_Qu8mg5v7(// SLICE_TETS Slice through a tet mesh (V,T) along a given plane (via its + // implicit equation). + // + // Inputs: + // V #V by 3 list of tet mesh vertices + // T #T by 4 list of tet indices into V + // plane list of 4 coefficients in the plane equation: [x y z 1]'*plane = 0 + // Optional: + // 'Manifold' followed by whether to stitch together triangles into a + // manifold mesh {true}: results in more compact U but slightly slower. + // Outputs: + // U #U by 3 list of triangle mesh vertices along slice + // G #G by 3 list of triangles indices into U + // J #G list of indices into T revealing from which tet each faces comes + // BC #U by #V list of barycentric coordinates (or more generally: linear + // interpolation coordinates) so that U = BC*V + // )igl_Qu8mg5v7"; +const char *__doc_igl_sortrows = R"igl_Qu8mg5v7(// Act like matlab's [Y,I] = sortrows(X) + // + // Templates: + // DerivedX derived scalar type, e.g. MatrixXi or MatrixXd + // DerivedI derived integer type, e.g. MatrixXi + // Inputs: + // X m by n matrix whose entries are to be sorted + // ascending sort ascending (true, matlab default) or descending (false) + // Outputs: + // Y m by n matrix whose entries are sorted (**should not** be same + // reference as X) + // I m list of indices so that + // Y = X(I,:);)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_unique = R"igl_Qu8mg5v7(// Act like matlab's [C,IA,IC] = unique(X) // // Templates: @@ -722,210 +892,58 @@ const char *__doc_igl_unique_rows = R"igl_Qu8mg5v7(// Act like matlab's [C,IA,IC // C #C vector of unique rows in A // IA #C index vector so that C = A(IA,:); // IC #A index vector so that A = C(IC,:);)igl_Qu8mg5v7"; -const char *__doc_igl_arap_precomputation = R"igl_Qu8mg5v7(// Compute necessary information to start using an ARAP deformation +const char *__doc_igl_unproject_onto_mesh = R"igl_Qu8mg5v7(// Unproject a screen location (using current opengl viewport, projection, and + // model view) to a 3D position _onto_ a given mesh, if the ray through the + // given screen location (x,y) _hits_ the mesh. // // Inputs: - // V #V by dim list of mesh positions - // F #F by simplex-size list of triangle|tet indices into V - // dim dimension being used at solve time. For deformation usually dim = - // V.cols(), for surface parameterization V.cols() = 3 and dim = 2 - // b #b list of "boundary" fixed vertex indices into V + // pos screen space coordinates + // model model matrix + // proj projection matrix + // viewport vieweport vector + // V #V by 3 list of mesh vertex positions + // F #F by 3 list of mesh triangle indices into V // Outputs: - // data struct containing necessary precomputation)igl_Qu8mg5v7"; -const char *__doc_igl_arap_solve = R"igl_Qu8mg5v7(// Inputs: - // bc #b by dim list of boundary conditions - // data struct containing necessary precomputation and parameters - // U #V by dim initial guess)igl_Qu8mg5v7"; -const char *__doc_igl_cross_field_missmatch = R"igl_Qu8mg5v7(// Inputs: - // V #V by 3 eigen Matrix of mesh vertex 3D positions - // F #F by 3 eigen Matrix of face (quad) indices - // PD1 #F by 3 eigen Matrix of the first per face cross field vector - // PD2 #F by 3 eigen Matrix of the second per face cross field vector - // isCombed boolean, specifying whether the field is combed (i.e. matching has been precomputed. - // If not, the field is combed first. - // Output: - // 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 - //)igl_Qu8mg5v7"; -const char *__doc_igl_slice_into = R"igl_Qu8mg5v7(// Act like the matlab Y(row_indices,col_indices) = X + // fid id of the first face hit + // bc barycentric coordinates of hit + // Returns true if there's a hit)igl_Qu8mg5v7"; +const char *__doc_igl_upsample = R"igl_Qu8mg5v7(// Subdivide a mesh without moving vertices: loop subdivision but odd + // vertices stay put and even vertices are just edge midpoints // + // Templates: + // MatV matrix for vertex positions, e.g. MatrixXd + // MatF matrix for vertex positions, e.g. MatrixXi // Inputs: - // X xm by xn rhs matrix - // R list of row indices - // C list of column indices - // Y ym by yn lhs matrix - // Output: - // Y ym by yn lhs matrix, same as input but Y(R,C) = X)igl_Qu8mg5v7"; -const char *__doc_igl_slice_tets = R"igl_Qu8mg5v7(// SLICE_TETS Slice through a tet mesh (V,T) along a given plane (via its - // implicit equation). - // - // Inputs: - // V #V by 3 list of tet mesh vertices - // T #T by 4 list of tet indices into V - // plane list of 4 coefficients in the plane equation: [x y z 1]'*plane = 0 - // Optional: - // 'Manifold' followed by whether to stitch together triangles into a - // manifold mesh {true}: results in more compact U but slightly slower. + // V #V by dim mesh vertices + // F #F by 3 mesh triangles // Outputs: - // U #U by 3 list of triangle mesh vertices along slice - // G #G by 3 list of triangles indices into U - // J #G list of indices into T revealing from which tet each faces comes - // BC #U by #V list of barycentric coordinates (or more generally: linear - // interpolation coordinates) so that U = BC*V - // )igl_Qu8mg5v7"; -const char *__doc_igl_n_polyvector = R"igl_Qu8mg5v7(// Inputs: - // v0, v1 the two #3 by 1 vectors - // normalized boolean, if false, then the vectors are normalized prior to the calculation - // Output: - // 3 by 3 rotation matrix that takes v0 to v1 - //)igl_Qu8mg5v7"; -const char *__doc_igl_harmonic = R"igl_Qu8mg5v7(// Compute k-harmonic weight functions "coordinates". + // NV new vertex positions, V is guaranteed to be at top + // NF new list of face indices // + // NOTE: V should not be the same as NV, + // NOTE: F should not be the same as NF, use other proto // - // Inputs: - // V #V by dim vertex positions - // F #F by simplex-size list of element indices - // b #b boundary indices into V - // bc #b by #W list of boundary values - // k power of harmonic operation (1: harmonic, 2: biharmonic, etc) - // Outputs: - // W #V by #W list of weights - //)igl_Qu8mg5v7"; -const char *__doc_igl_boundary_loop = R"igl_Qu8mg5v7(// Compute list of ordered boundary loops for a manifold mesh. + // Known issues: + // - assumes (V,F) is edge-manifold.)igl_Qu8mg5v7"; +const char *__doc_igl_writeMESH = R"igl_Qu8mg5v7(// save a tetrahedral volume mesh to a .mesh file // // Templates: - // Index index type - // Inputs: - // F #V by dim list of mesh faces - // Outputs: - // L list of loops where L[i] = ordered list of boundary vertices in loop i - //)igl_Qu8mg5v7"; -const char *__doc_igl_polar_svd = R"igl_Qu8mg5v7(// Computes the polar decomposition (R,T) of a matrix A using SVD singular - // value decomposition - // - // Inputs: - // A 3 by 3 matrix to be decomposed - // Outputs: - // R 3 by 3 rotation matrix part of decomposition (**always rotataion**) - // T 3 by 3 stretch matrix part of decomposition - // U 3 by 3 left-singular vectors - // S 3 by 1 singular values - // V 3 by 3 right-singular vectors - // - //)igl_Qu8mg5v7"; -const char *__doc_igl_comb_cross_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 - // PD1in #F by 3 eigen Matrix of the first per face cross field vector - // PD2in #F by 3 eigen Matrix of the second per face cross field vector - // Output: - // PD1out #F by 3 eigen Matrix of the first combed cross field vector - // PD2out #F by 3 eigen Matrix of the second combed cross field vector - //)igl_Qu8mg5v7"; -const char *__doc_igl_invert_diag = R"igl_Qu8mg5v7(// Templates: - // T should be a eigen sparse matrix primitive type like int or double - // Inputs: - // X an m by n sparse matrix - // Outputs: - // Y an m by n sparse matrix)igl_Qu8mg5v7"; -const char *__doc_igl_readMESH = R"igl_Qu8mg5v7(// load a tetrahedral volume mesh from a .mesh file - // - // Templates: - // Scalar type for positions and vectors (will be read as double and cast - // to Scalar) - // Index type for indices (will be read as int and cast to Index) + // Scalar type for positions and vectors (will be cast as double) + // Index type for indices (will be cast to int) // Input: // mesh_file_name path of .mesh file - // Outputs: // V double matrix of vertex positions #V by 3 // T #T list of tet indices into vertex positions // 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 - // PD1 #V by 3 first line of the Jacobian per triangle - // PD2 #V by 3 second line of the Jacobian per triangle - // (optional, if empty it will be a vector in the tangent plane orthogonal to PD1) - // scale global scaling for the gradient (controls the quads resolution) - // stiffness weight for the stiffness iterations - // direct_round greedily round all integer variables at once (greatly improves optimization speed but lowers quality) - // iter stiffness iterations (0 = no stiffness) - // local_iter number of local iterations for the integer rounding - // do_round enables the integer rounding (disabling it could be useful for debugging) - // round_vertices id of additional vertices that should be snapped to integer coordinates - // hard_features #H by 2 list of pairs of vertices that belongs to edges that should be snapped to integer coordinates - // - // Output: - // UV #UV by 2 list of vertices in 2D - // FUV #FUV by 3 list of face indices in UV - // - // TODO: rename the parameters name in the cpp consistenly - // improve the handling of hard_features, right now it might fail in difficult cases)igl_Qu8mg5v7"; -const char *__doc_igl_copyleft_comiso_nrosy = R"igl_Qu8mg5v7(// Generate a N-RoSy field from a sparse set of constraints - // - // Inputs: - // V #V by 3 list of mesh vertex coordinates - // F #F by 3 list of mesh faces (must be triangles) - // b #B by 1 list of constrained face indices - // bc #B by 3 list of representative vectors for the constrained - // faces - // b_soft #S by 1 b for soft constraints - // w_soft #S by 1 weight for the soft constraints (0-1) - // bc_soft #S by 3 bc for soft constraints - // N the degree of the N-RoSy vector field - // soft the strenght of the soft contraints w.r.t. smoothness - // (0 -> smoothness only, 1->constraints only) - // 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"; +const char *__doc_igl_writeOBJ = R"igl_Qu8mg5v7(// Write a mesh in an ascii obj file + // Inputs: + // str path to outputfile + // V #V by 3 mesh vertex positions + // F #F by 3|4 mesh indices into V + // CN #CN by 3 normal vectors + // FN #F by 3|4 corner normal indices into CN + // TC #TC by 2|3 texture coordinates + // FTC #F by 3|4 corner texture coord indices into TC + // Returns true on success, false on error)igl_Qu8mg5v7"; diff --git a/python/py_doc.h b/python/py_doc.h index 59e75a3af..4c1df1ce9 100644 --- a/python/py_doc.h +++ b/python/py_doc.h @@ -1,77 +1,78 @@ -extern const char *__doc_igl_principal_curvature; -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_cotmatrix; -extern const char *__doc_igl_floor; -extern const char *__doc_igl_slice; -extern const char *__doc_igl_per_face_normals; -extern const char *__doc_igl_per_face_normals_stable; -extern const char *__doc_igl_quad_planarity; -extern const char *__doc_igl_readOFF; -extern const char *__doc_igl_per_vertex_normals; -extern const char *__doc_igl_sortrows; -extern const char *__doc_igl_barycenter; -extern const char *__doc_igl_jet; -extern const char *__doc_igl_cat; -extern const char *__doc_igl_eigs; -extern const char *__doc_igl_per_corner_normals; -extern const char *__doc_igl_massmatrix; -extern const char *__doc_igl_unproject_onto_mesh; -extern const char *__doc_igl_colon; -extern const char *__doc_igl_fit_rotations; -extern const char *__doc_igl_fit_rotations_planar; -extern const char *__doc_igl_fit_rotations_SSE; -extern const char *__doc_igl_rotate_vectors; -extern const char *__doc_igl_read_triangle_mesh; -extern const char *__doc_igl_gaussian_curvature; -extern const char *__doc_igl_planarize_quad_mesh; -extern const char *__doc_igl_avg_edge_length; -extern const char *__doc_igl_barycentric_coordinates; -extern const char *__doc_igl_lscm; -extern const char *__doc_igl_find_cross_field_singularities; -extern const char *__doc_igl_upsample; -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_comb_frame_field; -extern const char *__doc_igl_map_vertices_to_circle; -extern const char *__doc_igl_writeOBJ; extern const char *__doc_igl_active_set; -extern const char *__doc_igl_per_edge_normals; -extern const char *__doc_igl_covariance_scatter_matrix; +extern const char *__doc_igl_arap_precomputation; +extern const char *__doc_igl_arap_solve; +extern const char *__doc_igl_avg_edge_length; +extern const char *__doc_igl_barycenter; +extern const char *__doc_igl_barycentric_coordinates; extern const char *__doc_igl_boundary_facets; +extern const char *__doc_igl_boundary_loop; +extern const char *__doc_igl_cat; +extern const char *__doc_igl_colon; +extern const char *__doc_igl_comb_cross_field; +extern const char *__doc_igl_comb_frame_field; extern const char *__doc_igl_compute_frame_field_bisectors; -extern const char *__doc_igl_edge_lengths; -extern const char *__doc_igl_readOBJ; +extern const char *__doc_igl_copyleft_cgal_mesh_boolean; +extern const char *__doc_igl_copyleft_comiso_miq; +extern const char *__doc_igl_copyleft_comiso_nrosy; +extern const char *__doc_igl_copyleft_tetgen_tetrahedralize; +extern const char *__doc_igl_cotmatrix; +extern const char *__doc_igl_covariance_scatter_matrix; +extern const char *__doc_igl_cross_field_missmatch; extern const char *__doc_igl_cut_mesh_from_singularities; -extern const char *__doc_igl_readDMAT; extern const char *__doc_igl_doublearea; extern const char *__doc_igl_doublearea_single; extern const char *__doc_igl_doublearea_quad; +extern const char *__doc_igl_edge_lengths; +extern const char *__doc_igl_eigs; +extern const char *__doc_igl_embree_ambient_occlusion; +extern const char *__doc_igl_find_cross_field_singularities; +extern const char *__doc_igl_fit_rotations; +extern const char *__doc_igl_fit_rotations_planar; +extern const char *__doc_igl_fit_rotations_SSE; +extern const char *__doc_igl_floor; +extern const char *__doc_igl_gaussian_curvature; +extern const char *__doc_igl_grad; +extern const char *__doc_igl_harmonic; +extern const char *__doc_igl_invert_diag; +extern const char *__doc_igl_jet; +extern const char *__doc_igl_local_basis; +extern const char *__doc_igl_lscm; +extern const char *__doc_igl_map_vertices_to_circle; +extern const char *__doc_igl_massmatrix; extern const char *__doc_igl_min_quad_with_fixed_precompute; extern const char *__doc_igl_min_quad_with_fixed_solve; extern const char *__doc_igl_min_quad_with_fixed; -extern const char *__doc_igl_writeMESH; +extern const char *__doc_igl_n_polyvector; +extern const char *__doc_igl_parula; +extern const char *__doc_igl_per_corner_normals; +extern const char *__doc_igl_per_edge_normals; +extern const char *__doc_igl_per_face_normals; +extern const char *__doc_igl_per_face_normals_stable; +extern const char *__doc_igl_per_vertex_normals; +extern const char *__doc_igl_planarize_quad_mesh; +extern const char *__doc_igl_point_mesh_squared_distance; +extern const char *__doc_igl_polar_svd; +extern const char *__doc_igl_principal_curvature; +extern const char *__doc_igl_quad_planarity; +extern const char *__doc_igl_readDMAT; +extern const char *__doc_igl_readMESH; +extern const char *__doc_igl_readOBJ; +extern const char *__doc_igl_readOFF; +extern const char *__doc_igl_read_triangle_mesh; +extern const char *__doc_igl_rotate_vectors; +extern const char *__doc_igl_setdiff; +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_slice; +extern const char *__doc_igl_slice_into; +extern const char *__doc_igl_slice_mask; +extern const char *__doc_igl_slice_tets; +extern const char *__doc_igl_sortrows; +extern const char *__doc_igl_triangle_triangulate; extern const char *__doc_igl_unique; extern const char *__doc_igl_unique_rows; -extern const char *__doc_igl_arap_precomputation; -extern const char *__doc_igl_arap_solve; -extern const char *__doc_igl_cross_field_missmatch; -extern const char *__doc_igl_grad; -extern const char *__doc_igl_slice_into; -extern const char *__doc_igl_slice_tets; -extern const char *__doc_igl_n_polyvector; -extern const char *__doc_igl_harmonic; -extern const char *__doc_igl_boundary_loop; -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; +extern const char *__doc_igl_unproject_onto_mesh; +extern const char *__doc_igl_upsample; +extern const char *__doc_igl_writeMESH; +extern const char *__doc_igl_writeOBJ; diff --git a/python/py_igl.cpp b/python/py_igl.cpp index c6f1db510..b2244b59f 100644 --- a/python/py_igl.cpp +++ b/python/py_igl.cpp @@ -2,141 +2,139 @@ #include "python_shared.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -//#include +#include +#include +#include void python_export_igl(py::module &m) { -#include "py_igl/py_readOFF.cpp" -#include "py_igl/py_writeOBJ.cpp" -#include "py_igl/py_per_face_normals.cpp" -#include "py_igl/py_per_corner_normals.cpp" -#include "py_igl/py_per_vertex_normals.cpp" -#include "py_igl/py_gaussian_curvature.cpp" -#include "py_igl/py_jet.cpp" -#include "py_igl/py_read_triangle_mesh.cpp" -#include "py_igl/py_cotmatrix.cpp" -#include "py_igl/py_massmatrix.cpp" -#include "py_igl/py_invert_diag.cpp" -#include "py_igl/py_principal_curvature.cpp" -#include "py_igl/py_parula.cpp" -#include "py_igl/py_readDMAT.cpp" -#include "py_igl/py_grad.cpp" -#include "py_igl/py_avg_edge_length.cpp" -#include "py_igl/py_barycenter.cpp" -#include "py_igl/py_doublearea.cpp" -#include "py_igl/py_floor.cpp" -#include "py_igl/py_slice.cpp" -#include "py_igl/py_slice_into.cpp" -#include "py_igl/py_sortrows.cpp" -#include "py_igl/py_colon.cpp" -#include "py_igl/py_boundary_facets.cpp" -#include "py_igl/py_unique.cpp" -#include "py_igl/py_setdiff.cpp" -#include "py_igl/py_min_quad_with_fixed.cpp" +#include "py_igl/py_AABB.cpp" +#include "py_igl/py_ARAPEnergyType.cpp" +#include "py_igl/py_MeshBooleanType.cpp" #include "py_igl/py_SolverStatus.cpp" #include "py_igl/py_active_set.cpp" -#include "py_igl/py_eigs.cpp" -#include "py_igl/py_readOBJ.cpp" -#include "py_igl/py_harmonic.cpp" -#include "py_igl/py_ARAPEnergyType.cpp" #include "py_igl/py_arap.cpp" -#include "py_igl/py_boundary_loop.cpp" -#include "py_igl/py_map_vertices_to_circle.cpp" -#include "py_igl/py_lscm.cpp" -#include "py_igl/py_local_basis.cpp" -#include "py_igl/py_rotate_vectors.cpp" -#include "py_igl/py_compute_frame_field_bisectors.cpp" -#include "py_igl/py_comb_cross_field.cpp" -#include "py_igl/py_cross_field_missmatch.cpp" -#include "py_igl/py_find_cross_field_singularities.cpp" -#include "py_igl/py_cut_mesh_from_singularities.cpp" -#include "py_igl/py_comb_frame_field.cpp" -#include "py_igl/py_n_polyvector.cpp" - -#include "py_igl/py_point_mesh_squared_distance.cpp" -#include "py_igl/py_AABB.cpp" -#include "py_igl/py_readMESH.cpp" -#include "py_igl/py_writeMESH.cpp" -#include "py_igl/py_slice_tets.cpp" -#include "py_igl/py_edge_lengths.cpp" -#include "py_igl/py_upsample.cpp" -#include "py_igl/py_cat.cpp" -#include "py_igl/py_per_edge_normals.cpp" +#include "py_igl/py_avg_edge_length.cpp" +#include "py_igl/py_barycenter.cpp" #include "py_igl/py_barycentric_coordinates.cpp" -#include "py_igl/py_fit_rotations.cpp" -#include "py_igl/py_polar_svd.cpp" +#include "py_igl/py_boundary_facets.cpp" +#include "py_igl/py_boundary_loop.cpp" +#include "py_igl/py_cat.cpp" +#include "py_igl/py_colon.cpp" +#include "py_igl/py_comb_cross_field.cpp" +#include "py_igl/py_comb_frame_field.cpp" +#include "py_igl/py_compute_frame_field_bisectors.cpp" +#include "py_igl/py_cotmatrix.cpp" #include "py_igl/py_covariance_scatter_matrix.cpp" -#include "py_igl/py_slice_mask.cpp" -#include "py_igl/py_signed_distance.cpp" -#include "py_igl/py_quad_planarity.cpp" +#include "py_igl/py_cross_field_missmatch.cpp" +#include "py_igl/py_cut_mesh_from_singularities.cpp" +#include "py_igl/py_doublearea.cpp" +#include "py_igl/py_edge_lengths.cpp" +#include "py_igl/py_eigs.cpp" +#include "py_igl/py_find_cross_field_singularities.cpp" +#include "py_igl/py_fit_rotations.cpp" +#include "py_igl/py_floor.cpp" +#include "py_igl/py_gaussian_curvature.cpp" +#include "py_igl/py_grad.cpp" +#include "py_igl/py_harmonic.cpp" +#include "py_igl/py_invert_diag.cpp" +#include "py_igl/py_jet.cpp" +#include "py_igl/py_local_basis.cpp" +#include "py_igl/py_lscm.cpp" +#include "py_igl/py_map_vertices_to_circle.cpp" +#include "py_igl/py_massmatrix.cpp" +#include "py_igl/py_min_quad_with_fixed.cpp" +#include "py_igl/py_n_polyvector.cpp" +#include "py_igl/py_parula.cpp" +#include "py_igl/py_per_corner_normals.cpp" +#include "py_igl/py_per_edge_normals.cpp" +#include "py_igl/py_per_face_normals.cpp" +#include "py_igl/py_per_vertex_normals.cpp" #include "py_igl/py_planarize_quad_mesh.cpp" +#include "py_igl/py_point_mesh_squared_distance.cpp" +#include "py_igl/py_polar_svd.cpp" +#include "py_igl/py_principal_curvature.cpp" +#include "py_igl/py_quad_planarity.cpp" +#include "py_igl/py_readDMAT.cpp" +#include "py_igl/py_readMESH.cpp" +#include "py_igl/py_readOBJ.cpp" +#include "py_igl/py_readOFF.cpp" +#include "py_igl/py_read_triangle_mesh.cpp" +#include "py_igl/py_rotate_vectors.cpp" +#include "py_igl/py_setdiff.cpp" +#include "py_igl/py_signed_distance.cpp" +#include "py_igl/py_slice.cpp" +#include "py_igl/py_slice_into.cpp" +#include "py_igl/py_slice_mask.cpp" +#include "py_igl/py_slice_tets.cpp" +#include "py_igl/py_sortrows.cpp" +#include "py_igl/py_unique.cpp" #include "py_igl/py_unproject_onto_mesh.cpp" -//#include "py_igl/py_.cpp" +#include "py_igl/py_upsample.cpp" +#include "py_igl/py_writeMESH.cpp" +#include "py_igl/py_writeOBJ.cpp" } diff --git a/python/scripts/generate_docstrings.py b/python/scripts/generate_docstrings.py index 1680548c6..23aecaaf0 100755 --- a/python/scripts/generate_docstrings.py +++ b/python/scripts/generate_docstrings.py @@ -21,6 +21,7 @@ def get_filepaths(directory): it yields a 3-tuple (dirpath, dirnames, filenames). """ file_paths = [] # List which will store all of the full filepaths. + root_file_paths = [] # Walk the tree. for root, directories, files in os.walk(directory): @@ -29,7 +30,10 @@ def get_filepaths(directory): filepath = os.path.join(root, filename) file_paths.append(filepath) # Add it to the list. - return file_paths # Self-explanatory. + if root.endswith(directory): # Add only the files in the root directory + root_file_paths.append(filepath) + + return file_paths, root_file_paths # file_paths contains all file paths, core_file_paths only the ones in def get_name_from_path(path, basepath, prefix, postfix): @@ -53,8 +57,8 @@ if __name__ == '__main__': # List all files in the given folder and subfolders cpp_base_path = sys.argv[1] py_base_path = sys.argv[2] - cpp_file_paths = get_filepaths(cpp_base_path) - py_file_paths = get_filepaths(py_base_path) + cpp_file_paths, cpp_root_file_paths = get_filepaths(cpp_base_path) + py_file_paths, py_root_file_paths = get_filepaths(py_base_path) # Add all the .h filepaths to a dict mapping = {} @@ -65,10 +69,16 @@ if __name__ == '__main__': # Add all python binding files to a list implemented_names = [] + core_implemented_names = [] for f in py_file_paths: if f.endswith(".cpp"): name = get_name_from_path(f, py_base_path, "py_", ".cpp") implemented_names.append(name) + if f in py_root_file_paths: + core_implemented_names.append(name) + + implemented_names.sort() + core_implemented_names.sort() # Create a list of cpp header files for which a python binding file exists files_to_parse = [] @@ -124,3 +134,9 @@ if __name__ == '__main__': rendered = tpl.render(functions=implemented_names) with open("../python_shared.cpp", 'w') as fs: fs.write(rendered) + + # Write py_igl_cpp file with all core library files + tpl = Template(filename='py_igl.mako') + rendered = tpl.render(functions=core_implemented_names) + with open("../py_igl.cpp", 'w') as fs: + fs.write(rendered) diff --git a/python/scripts/py_igl.mako b/python/scripts/py_igl.mako new file mode 100644 index 000000000..c6a8f66db --- /dev/null +++ b/python/scripts/py_igl.mako @@ -0,0 +1,16 @@ +#include + +#include "python_shared.h" + +% for f in functions: +#include +% endfor + + +void python_export_igl(py::module &m) +{ +% for f in functions: +#include "py_igl/py_${f}.cpp" +% endfor + +}