libigl v2.5.0
Loading...
Searching...
No Matches
igl Namespace Reference

Namespaces

namespace  copyleft
 
namespace  embree
 
namespace  matlab
 
namespace  mosek
 
namespace  opengl
 
namespace  predicates
 
namespace  serialization
 
namespace  spectra
 
namespace  stb
 
namespace  triangle
 
namespace  xml
 

Classes

class  AABB
 Implementation of semi-general purpose axis-aligned bounding box hierarchy. More...
 
struct  active_set_params
 Input parameters controling active_set. More...
 
struct  ARAPData
 Parameters and precomputed values for arap solver. More...
 
struct  ArapDOFData
 Structure that contains fields for all precomputed data or data that needs to be remembered at update. More...
 
struct  AtA_cached_data
 Hold precomputed data for AtA_cached. More...
 
class  BBWData
 Container for BBW computation related data and flags. More...
 
struct  FastWindingNumberBVH
 Structure for caching precomputation for fast winding number for triangle soups.
 
struct  FileMemoryBuffer
 
struct  FileMemoryStream
 Class to convert a FILE * to an std::istream. More...
 
class  HalfEdgeIterator
 Fake halfedge for fast and easy navigation on triangle meshes with vertex_triangle_adjacency and triangle_triangle adjacency. More...
 
struct  HeatGeodesicsData
 Precomputation data for heat_geodesics_solve. More...
 
struct  Hit
 Reimplementation of the embree::Hit struct from embree1.0. More...
 
struct  IndexDimLessThan
 Comparison struct for use with functions like std::sort. More...
 
struct  IndexedPointer
 
struct  IndexedPointerBase
 
struct  IndexEquals
 Comparison struct used by unique. More...
 
struct  IndexLessThan
 Comparison struct used by sort http://bytes.com/topic/c/answers/132045-sort-get-index. More...
 
struct  IndexRowEquals
 Comparison struct for use with functions like std::sort. More...
 
struct  IndexRowLessThan
 Comparison struct For use with functions like std::sort. More...
 
struct  IndexVectorLessThan
 Comparison struct for vectors for use with functions like std::sort. More...
 
struct  KelvinletParams
 Parameters for controling kelvinlets. More...
 
struct  min_quad_with_fixed_data
 Parameters and precomputed values for min_quad_with_fixed. More...
 
class  MshLoader
 Class for loading information from .msh file depends only on c++stl library. More...
 
class  MshSaver
 Class for dumping information to .msh file depends only on c++stl library current implementation works only with 3D information. More...
 
class  Serializable
 
struct  SerializableBase
 
struct  ShapeupData
 Parameters and precomputed data for ShapeUp. More...
 
struct  SLIMData
 Parameters and precomputed data for computing a SLIM map as derived in "Scalable Locally Injective Maps" [Rabinovich et al. More...
 
class  SortableRow
 A row of things that can be sorted against other rows. More...
 
class  Timer
 Simple timer class. More...
 
class  WindingNumberAABB
 Class for building an AABB tree to implement the divide and conquer algorithm described in [Jacobson et al. More...
 
class  WindingNumberTree
 Space partitioning tree for computing winding number hierarchically. More...
 

Typedefs

using decimate_cost_and_placement_callback = std::function< void(const int, const Eigen::MatrixXd &, const Eigen::MatrixXi &, const Eigen::MatrixXi &, const Eigen::VectorXi &, const Eigen::MatrixXi &, const Eigen::MatrixXi &, double &, Eigen::RowVectorXd &)>
 Function handle used to control the cost of each edge collapse in igl::decimate.
 
using decimate_stopping_condition_callback = std::function< bool(const Eigen::MatrixXd &, const Eigen::MatrixXi &, const Eigen::MatrixXi &, const Eigen::VectorXi &, const Eigen::MatrixXi &, const Eigen::MatrixXi &, const igl::min_heap< std::tuple< double, int, int > > &, const Eigen::VectorXi &, const Eigen::MatrixXd &, const int, const int, const int, const int, const int)>
 Function handle used to control whether the queue processing in igl::decimate should stop.
 
using decimate_pre_collapse_callback = std::function< bool(const Eigen::MatrixXd &, const Eigen::MatrixXi &, const Eigen::MatrixXi &, const Eigen::VectorXi &, const Eigen::MatrixXi &, const Eigen::MatrixXi &, const igl::min_heap< std::tuple< double, int, int > > &, const Eigen::VectorXi &, const Eigen::MatrixXd &, const int)>
 Function handle called just before collapse_edge is attempted.
 
using decimate_post_collapse_callback = std::function< void(const Eigen::MatrixXd &, const Eigen::MatrixXi &, const Eigen::MatrixXi &, const Eigen::VectorXi &, const Eigen::MatrixXi &, const Eigen::MatrixXi &, const igl::min_heap< std::tuple< double, int, int > > &, const Eigen::VectorXi &, const Eigen::MatrixXd &, const int, const int, const int, const int, const int, const bool)>
 Function handle called just after collapse_edge is attempted.
 
using DEFAULT_URBG = std::mt19937
 
template<class T >
using min_heap = std::priority_queue< T, std::vector< T >, std::greater< T > >
 Templated min heap (reverses sort order of std::priority_queue)
 
using shapeup_projection_function = std::function< bool(const Eigen::PlainObjectBase< Eigen::MatrixXd > &, const Eigen::PlainObjectBase< Eigen::VectorXi > &, const Eigen::PlainObjectBase< Eigen::MatrixXi > &, Eigen::PlainObjectBase< Eigen::MatrixXd > &)>
 Every function here defines a local projection for ShapeUp, and must have the following structure to qualify:
 

Enumerations

enum  ARAPEnergyType {
  ARAP_ENERGY_TYPE_SPOKES = 0 , ARAP_ENERGY_TYPE_SPOKES_AND_RIMS = 1 , ARAP_ENERGY_TYPE_ELEMENTS = 2 , ARAP_ENERGY_TYPE_DEFAULT = 3 ,
  NUM_ARAP_ENERGY_TYPES = 4
}
 Enum for choosing ARAP energy type. More...
 
enum  ColorMapType {
  COLOR_MAP_TYPE_INFERNO = 0 , COLOR_MAP_TYPE_JET = 1 , COLOR_MAP_TYPE_MAGMA = 2 , COLOR_MAP_TYPE_PARULA = 3 ,
  COLOR_MAP_TYPE_PLASMA = 4 , COLOR_MAP_TYPE_VIRIDIS = 5 , COLOR_MAP_TYPE_TURBO = 6 , NUM_COLOR_MAP_TYPES = 7
}
 
enum  EigsType { EIGS_TYPE_SM = 0 , EIGS_TYPE_LM = 1 , NUM_EIGS_TYPES = 2 }
 Type of eigen values to extract. More...
 
enum class  FileEncoding { Binary , Ascii }
 File encoding types for writing files. More...
 
enum class  BrushType : int { GRAB , SCALE , TWIST , PINCH }
 Kelvinlets brush type. More...
 
enum  MappingEnergyType {
  ARAP = 0 , LOG_ARAP = 1 , SYMMETRIC_DIRICHLET = 2 , CONFORMAL = 3 ,
  EXP_CONFORMAL = 4 , EXP_SYMMETRIC_DIRICHLET = 5 , NUM_SLIM_ENERGY_TYPES = 6
}
 Energy Types used for Parameterization/Mapping. More...
 
enum  MassMatrixType {
  MASSMATRIX_TYPE_BARYCENTRIC = 0 , MASSMATRIX_TYPE_VORONOI = 1 , MASSMATRIX_TYPE_FULL = 2 , MASSMATRIX_TYPE_DEFAULT = 3 ,
  NUM_MASSMATRIX_TYPES = 4
}
 Type of mass matrix. More...
 
enum  MeshBooleanType {
  MESH_BOOLEAN_TYPE_UNION = 0 , MESH_BOOLEAN_TYPE_INTERSECT = 1 , MESH_BOOLEAN_TYPE_MINUS = 2 , MESH_BOOLEAN_TYPE_XOR = 3 ,
  MESH_BOOLEAN_TYPE_RESOLVE = 4 , NUM_MESH_BOOLEAN_TYPES = 5
}
 Boolean operation types. More...
 
enum  NormalType { PER_VERTEX_NORMALS , PER_FACE_NORMALS , PER_CORNER_NORMALS }
 Type of mesh normal computation method. More...
 
enum  PerEdgeNormalsWeightingType { PER_EDGE_NORMALS_WEIGHTING_TYPE_UNIFORM = 0 , PER_EDGE_NORMALS_WEIGHTING_TYPE_AREA = 1 , PER_EDGE_NORMALS_WEIGHTING_TYPE_DEFAULT = 2 , NUM_PER_EDGE_NORMALS_WEIGHTING_TYPE = 3 }
 Weighting schemes for per edge normals. More...
 
enum  PerVertexNormalsWeightingType {
  PER_VERTEX_NORMALS_WEIGHTING_TYPE_UNIFORM = 0 , PER_VERTEX_NORMALS_WEIGHTING_TYPE_AREA = 1 , PER_VERTEX_NORMALS_WEIGHTING_TYPE_ANGLE = 2 , PER_VERTEX_NORMALS_WEIGHTING_TYPE_DEFAULT = 3 ,
  NUM_PER_VERTEX_NORMALS_WEIGHTING_TYPE = 4
}
 Weighting schemes for computing per-vertex normals. More...
 
enum  SignedDistanceType {
  SIGNED_DISTANCE_TYPE_PSEUDONORMAL = 0 , SIGNED_DISTANCE_TYPE_WINDING_NUMBER = 1 , SIGNED_DISTANCE_TYPE_DEFAULT = 2 , SIGNED_DISTANCE_TYPE_UNSIGNED = 3 ,
  SIGNED_DISTANCE_TYPE_FAST_WINDING_NUMBER = 4 , NUM_SIGNED_DISTANCE_TYPE = 5
}
 Types of signing a distance field. More...
 
enum  SolverStatus { SOLVER_STATUS_CONVERGED = 0 , SOLVER_STATUS_MAX_ITER = 1 , SOLVER_STATUS_ERROR = 2 , NUM_SOLVER_STATUSES = 3 }
 Solver status type used by min_quad_with_fixed. More...
 
enum  TetrahedralizedGripType { TETRAHEDRALIZED_GRID_TYPE_5 = 0 , TETRAHEDRALIZED_GRID_TYPE_6_ROTATIONAL = 1 , NUM_TETRAHEDRALIZED_GRID_TYPE = 2 }
 Types of tetrahedralizations of a cubical cell. More...
 
enum  WindingNumberMethod { EXACT_WINDING_NUMBER_METHOD = 0 , APPROX_SIMPLE_WINDING_NUMBER_METHOD = 1 , APPROX_CACHE_WINDING_NUMBER_METHOD = 2 , NUM_WINDING_NUMBER_METHODS = 3 }
 

Functions

template<typename DerivedS , typename DerivedV , typename DerivedA >
void accumarray (const Eigen::MatrixBase< DerivedS > &S, const Eigen::MatrixBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedA > &A)
 Accumulate values in V using subscripts in S.
 
template<typename DerivedS , typename DerivedA >
void accumarray (const Eigen::MatrixBase< DerivedS > &S, const typename DerivedA::Scalar V, Eigen::PlainObjectBase< DerivedA > &A)
 Accumulate constant value V using subscripts in S.
 
template<typename AT , typename DerivedB , typename Derivedknown , typename DerivedY , typename AeqT , typename DerivedBeq , typename AieqT , typename DerivedBieq , typename Derivedlx , typename Derivedux , typename DerivedZ >
igl::SolverStatus active_set (const Eigen::SparseMatrix< AT > &A, const Eigen::PlainObjectBase< DerivedB > &B, const Eigen::PlainObjectBase< Derivedknown > &known, const Eigen::PlainObjectBase< DerivedY > &Y, const Eigen::SparseMatrix< AeqT > &Aeq, const Eigen::PlainObjectBase< DerivedBeq > &Beq, const Eigen::SparseMatrix< AieqT > &Aieq, const Eigen::PlainObjectBase< DerivedBieq > &Bieq, const Eigen::PlainObjectBase< Derivedlx > &lx, const Eigen::PlainObjectBase< Derivedux > &ux, const igl::active_set_params &params, Eigen::PlainObjectBase< DerivedZ > &Z)
 Minimize convex quadratic energy subject to linear inequality constraints.
 
template<typename Index , typename IndexVector >
void adjacency_list (const Eigen::MatrixBase< Index > &F, std::vector< std::vector< IndexVector > > &A, bool sorted=false)
 Constructs the graph adjacency list of a given mesh (V,F)
 
template<typename Index >
void adjacency_list (const std::vector< std::vector< Index > > &F, std::vector< std::vector< Index > > &A)
 Constructs the graph adjacency list of a given polygon mesh (V,F)
 
template<typename DerivedF , typename T >
void adjacency_matrix (const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< T > &A)
 Constructs the graph adjacency matrix of a given mesh (V,F)
 
template<typename DerivedI , typename DerivedC , typename T >
void adjacency_matrix (const Eigen::MatrixBase< DerivedI > &I, const Eigen::MatrixBase< DerivedC > &C, Eigen::SparseMatrix< T > &A)
 Constructs an vertex adjacency for a polygon mesh.
 
template<typename AType , typename DerivedB >
void all (const Eigen::SparseMatrix< AType > &A, const int dim, Eigen::PlainObjectBase< DerivedB > &B)
 Check whether all values are logically true along a dimension.
 
template<typename Mat >
void all_pairs_distances (const Mat &V, const Mat &U, const bool squared, Mat &D)
 Compute distances between each point i in V and point j in U.
 
template<typename DerivedP , typename DerivedN , typename DerivedS >
void ambient_occlusion (const std::function< bool(const Eigen::Vector3f &, const Eigen::Vector3f &) > &shoot_ray, const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S)
 Compute ambient occlusion per given point using ray-mesh intersection function handle.
 
template<typename DerivedV , int DIM, typename DerivedF , typename DerivedP , typename DerivedN , typename DerivedS >
void ambient_occlusion (const igl::AABB< DerivedV, DIM > &aabb, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S)
 Compute ambient occlusion per given point for mesh (V,F) with precomputed AABB tree.
 
template<typename DerivedV , typename DerivedF , typename DerivedP , typename DerivedN , typename DerivedS >
void ambient_occlusion (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S)
 Compute ambient occlusion per given point for mesh (V,F)
 
double angular_distance (const Eigen::Quaterniond &A, const Eigen::Quaterniond &B)
 The "angular distance" between two unit quaternions is the angle of the smallest rotation (treated as an Axis and Angle) that takes A to B.
 
template<typename AType , typename DerivedB >
void any (const Eigen::SparseMatrix< AType > &A, const int dim, Eigen::PlainObjectBase< DerivedB > &B)
 Check whether any values are logically true along a dimension.
 
template<typename DerivedV , typename DerivedF , typename Derivedb >
bool arap_precomputation (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const int dim, const Eigen::MatrixBase< Derivedb > &b, ARAPData &data)
 Compute necessary information to start using an ARAP deformation using local-global solver as described in "As-rigid-as-possible surface modeling" [Sorkine and Alexa 2007].
 
template<typename Derivedbc , typename DerivedU >
bool arap_solve (const Eigen::MatrixBase< Derivedbc > &bc, ARAPData &data, Eigen::MatrixBase< DerivedU > &U)
 Conduct arap solve.
 
template<typename LbsMatrixType , typename SSCALAR >
bool arap_dof_precomputation (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const LbsMatrixType &M, const Eigen::Matrix< int, Eigen::Dynamic, 1 > &G, ArapDOFData< LbsMatrixType, SSCALAR > &data)
 Precomputes the system to optimize for "Fast Automatic Skinning Transformations" [Jacobson et al. 2012] skinning degrees of freedom optimization using as-rigid-as-possible energy.
 
template<typename LbsMatrixType , typename SSCALAR >
bool arap_dof_recomputation (const Eigen::Matrix< int, Eigen::Dynamic, 1 > &fixed_dim, const Eigen::SparseMatrix< double > &A_eq, ArapDOFData< LbsMatrixType, SSCALAR > &data)
 Should always be called after arap_dof_precomputation, but may be called in between successive calls to arap_dof_update, recomputes precomputation given that there are only changes in free and fixed.
 
template<typename LbsMatrixType , typename SSCALAR >
bool arap_dof_update (const ArapDOFData< LbsMatrixType, SSCALAR > &data, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &B_eq, const Eigen::MatrixXd &L0, const int max_iters, const double tol, Eigen::MatrixXd &L)
 Optimizes the transformations attached to each weight function based on precomputed system.
 
template<typename MatV , typename MatF , typename MatK >
void arap_linear_block (const MatV &V, const MatF &F, const int d, const igl::ARAPEnergyType energy, MatK &Kd)
 Constructs a block of the matrix which constructs the linear terms of a given arap energy.
 
template<typename MatV , typename MatF , typename MatK >
void arap_linear_block_spokes (const MatV &V, const MatF &F, const int d, MatK &Kd)
 Constructs a block of the matrix which constructs the linear terms for spokes energy.
 
template<typename MatV , typename MatF , typename MatK >
void arap_linear_block_spokes_and_rims (const MatV &V, const MatF &F, const int d, MatK &Kd)
 Constructs a block of the matrix which constructs the linear terms for spokes and rims energy.
 
template<typename MatV , typename MatF , typename MatK >
void arap_linear_block_elements (const MatV &V, const MatF &F, const int d, MatK &Kd)
 Constructs a block of the matrix which constructs the linear terms for per element energy.
 
template<typename DerivedV , typename DerivedF , typename DerivedK >
void arap_rhs (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const int dim, const igl::ARAPEnergyType energy, Eigen::SparseCompressedBase< DerivedK > &K)
 Right-hand side constructor of global poisson solve for various Arap energies.
 
template<typename Scalar >
void AtA_cached_precompute (const Eigen::SparseMatrix< Scalar > &A, AtA_cached_data &data, Eigen::SparseMatrix< Scalar > &AtA)
 Computes At * W * A, where A is sparse and W is diagonal.
 
template<typename Scalar >
void AtA_cached (const Eigen::SparseMatrix< Scalar > &A, const AtA_cached_data &data, Eigen::SparseMatrix< Scalar > &AtA)
 Computes At * W * A, where A is sparse and W is diagonal precomputed into data.
 
template<typename DerivedF , typename DerivedE , typename DerivedoE , typename DeriveduE , typename DeriveduV >
void average_from_edges_onto_vertices (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedoE > &oE, const Eigen::MatrixBase< DeriveduE > &uE, Eigen::PlainObjectBase< DeriveduV > &uV)
 Move a scalar field defined on edges to vertices by averaging.
 
template<typename DerivedF , typename DerivedS , typename DerivedSF >
void average_onto_faces (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedSF > &SF)
 Move a scalar field defined on vertices to faces by averaging.
 
template<typename DerivedV , typename DerivedF , typename DerivedS , typename DerivedSV >
void average_onto_vertices (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedSV > &SV)
 Move a scalar field defined on faces to vertices by averaging.
 
template<typename DerivedV , typename DerivedF >
double avg_edge_length (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F)
 Compute the average edge length for the given triangle mesh.
 
template<typename Q_type >
void axis_angle_to_quat (const Q_type *axis, const Q_type angle, Q_type *out)
 Convert axis angle representation of a rotation to a quaternion.
 
template<typename DerivedV , typename DerivedF , typename DerivedBC >
void barycenter (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedBC > &BC)
 Computes the barycenter of every simplex.
 
template<typename DerivedP , typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedD , typename DerivedL >
void barycentric_coordinates (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< DerivedC > &C, const Eigen::MatrixBase< DerivedD > &D, Eigen::PlainObjectBase< DerivedL > &L)
 Compute barycentric coordinates of each point in a corresponding tetrahedron.
 
template<typename DerivedP , typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedL >
void barycentric_coordinates (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedL > &L)
 Compute barycentric coordinates in a triangle.
 
template<typename DerivedD , typename DerivedF , typename DerivedB , typename DerivedI , typename DerivedX >
void barycentric_interpolation (const Eigen::MatrixBase< DerivedD > &D, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedX > &X)
 Interpolate data on a triangle mesh using barycentric coordinates.
 
std::string basename (const std::string &path)
 Extract basename of file path (like PHP's basename).
 
template<typename DerivedV , typename DerivedEle , typename Derivedb , typename Derivedbc , typename DerivedW >
bool bbw (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedEle > &Ele, const Eigen::PlainObjectBase< Derivedb > &b, const Eigen::PlainObjectBase< Derivedbc > &bc, BBWData &data, Eigen::PlainObjectBase< DerivedW > &W)
 Compute Bounded Biharmonic Weights on a given domain (V,Ele) with a given set of boundary conditions.
 
template<typename DerivedV , typename DerivedP >
void bezier (const Eigen::MatrixBase< DerivedV > &V, const typename DerivedV::Scalar t, Eigen::PlainObjectBase< DerivedP > &P)
 Evaluate a polynomial Bezier Curve at single parameter value.
 
template<typename DerivedV , typename DerivedT , typename DerivedP >
void bezier (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedP > &P)
 Evaluate a polynomial Bezier Curve at many parameter values.
 
template<typename VMat , typename DerivedT , typename DerivedP >
void bezier (const std::vector< VMat > &spline, const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedP > &P)
 Evaluate a polynomial Bezier spline with a fixed parameter set for each sub-curve.
 
template<typename AType , typename DerivedD , typename DerivedP >
void bfs (const AType &A, const size_t s, Eigen::PlainObjectBase< DerivedD > &D, Eigen::PlainObjectBase< DerivedP > &P)
 Traverse a directed graph represented by an adjacency list using.
 
template<typename AType , typename DType , typename PType >
void bfs (const std::vector< std::vector< AType > > &A, const size_t s, std::vector< DType > &D, std::vector< PType > &P)
 Traverse a directed graph represented by an adjacency list using.
 
template<typename AType , typename DType , typename PType >
void bfs (const Eigen::SparseCompressedBase< AType > &A, const size_t s, std::vector< DType > &D, std::vector< PType > &P)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedFF , typename DerivedC >
void bfs_orient (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedFF > &FF, Eigen::PlainObjectBase< DerivedC > &C)
 Consistently orient faces in orientable patches using BFS.
 
template<typename DerivedV , typename DerivedT , typename SType , typename DerivedW >
bool biharmonic_coordinates (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, const std::vector< std::vector< SType > > &S, Eigen::PlainObjectBase< DerivedW > &W)
 Compute "discrete biharmonic generalized barycentric coordinates" as described in "Linear Subspace Design for Real-Time Shape Deformation" [Wang et al.
 
template<typename DerivedV , typename DerivedT , typename SType , typename DerivedW >
bool biharmonic_coordinates (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, const std::vector< std::vector< SType > > &S, const int k, Eigen::PlainObjectBase< DerivedW > &W)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedU >
bool bijective_composite_harmonic_mapping (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< Derivedb > &b, const Eigen::MatrixBase< Derivedbc > &bc, Eigen::PlainObjectBase< DerivedU > &U)
 Compute a injective planar mapping of a triangulated polygon (V,F) subjected to boundary conditions (b,bc).
 
template<typename DerivedV , typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedU >
bool bijective_composite_harmonic_mapping (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< Derivedb > &b, const Eigen::MatrixBase< Derivedbc > &bc, const int min_steps, const int max_steps, const int num_inner_iters, const bool test_for_flips, Eigen::PlainObjectBase< DerivedU > &U)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar >
void blkdiag (const std::vector< Eigen::SparseMatrix< Scalar > > &L, Eigen::SparseMatrix< Scalar > &Y)
 Given a list of matrices place them along the diagonal as blocks of the output matrix.
 
template<typename DerivedY >
void blkdiag (const std::vector< DerivedY > &L, Eigen::PlainObjectBase< DerivedY > &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedB , typename DerivedFI , typename DerivedP , typename URBG = DEFAULT_URBG>
void blue_noise (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const typename DerivedV::Scalar r, Eigen::PlainObjectBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedFI > &FI, Eigen::PlainObjectBase< DerivedP > &P, URBG &&urbg=igl::generate_default_urbg())
 "Fast Poisson Disk Sampling in Arbitrary Dimensions" [Bridson 2007].
 
template<typename DerivedBE , typename DerivedP >
void bone_parents (const Eigen::MatrixBase< DerivedBE > &BE, Eigen::PlainObjectBase< DerivedP > &P)
 Recover "parent" bones from directed graph representation.
 
bool boundary_conditions (const Eigen::MatrixXd &V, const Eigen::MatrixXi &Ele, const Eigen::MatrixXd &C, const Eigen::VectorXi &P, const Eigen::MatrixXi &BE, const Eigen::MatrixXi &CE, const Eigen::MatrixXi &CF, Eigen::VectorXi &b, Eigen::MatrixXd &bc)
 Compute boundary conditions for automatic weights computation.
 
template<typename DerivedT , typename DerivedF , typename DerivedJ , typename DerivedK >
void boundary_facets (const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedJ > &J, Eigen::PlainObjectBase< DerivedK > &K)
 Determine boundary faces (edges) of tetrahedra (triangles) stored in T (analogous to qptoolbox's outline and boundary_faces).
 
template<typename DerivedT , typename DerivedF >
void boundary_facets (const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedF > &F)
 Determine boundary faces (edges) of tetrahedra (triangles) stored in T.
 
template<typename DerivedT , typename Ret >
Ret boundary_facets (const Eigen::MatrixBase< DerivedT > &T)
 Determine boundary faces (edges) of tetrahedra (triangles) stored in T.
 
template<typename IntegerT , typename IntegerF >
void boundary_facets (const std::vector< std::vector< IntegerT > > &T, std::vector< std::vector< IntegerF > > &F)
 Determine boundary faces (edges) of tetrahedra (triangles) stored in T; inputs and outputs lists.
 
template<typename DerivedF , typename Index >
void boundary_loop (const Eigen::MatrixBase< DerivedF > &F, std::vector< std::vector< Index > > &L)
 Compute list of ordered boundary loops for a manifold mesh.
 
template<typename DerivedF , typename Index >
void boundary_loop (const Eigen::MatrixBase< DerivedF > &F, std::vector< Index > &L)
 Compute ordered boundary loops for a manifold mesh and return the longest loop in terms of vertices.
 
template<typename DerivedF , typename DerivedL >
void boundary_loop (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedL > &L)
 Compute ordered boundary loops for a manifold mesh and return the longest loop in terms of vertices.
 
template<typename DerivedV , typename DerivedBV , typename DerivedBF >
void bounding_box (const Eigen::MatrixBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedBV > &BV, Eigen::PlainObjectBase< DerivedBF > &BF)
 Build a triangle mesh of the bounding box of a given list of vertices.
 
template<typename DerivedV , typename DerivedBV , typename DerivedBF >
void bounding_box (const Eigen::MatrixBase< DerivedV > &V, const typename DerivedV::Scalar pad, Eigen::PlainObjectBase< DerivedBV > &BV, Eigen::PlainObjectBase< DerivedBF > &BF)
 
double bounding_box_diagonal (const Eigen::MatrixXd &V)
 Compute the length of the diagonal of a given meshes axis-aligned bounding box.
 
template<typename Q_type >
Q_type CANONICAL_VIEW_QUAT (int i, int j)
 
template<>
float CANONICAL_VIEW_QUAT< float > (int i, int j)
 
template<>
double CANONICAL_VIEW_QUAT< double > (int i, int j)
 
template<typename Scalar >
void cat (const int dim, const Eigen::SparseMatrix< Scalar > &A, const Eigen::SparseMatrix< Scalar > &B, Eigen::SparseMatrix< Scalar > &C)
 Perform concatenation of a two sparse matrices along a single dimension If dim == 1, then C = [A;B]; If dim == 2 then C = [A B].
 
template<typename Derived , class MatC >
void cat (const int dim, const Eigen::MatrixBase< Derived > &A, const Eigen::MatrixBase< Derived > &B, MatC &C)
 Perform concatenation of a two dense matrices along a single dimension If dim == 1, then C = [A;B]; If dim == 2 then C = [A B].
 
template<class Mat >
Mat cat (const int dim, const Mat &A, const Mat &B)
 Perform concatenation of a two dense matrices along a single dimension If dim == 1, then C = [A;B]; If dim == 2 then C = [A B].
 
template<class Mat >
void cat (const std::vector< std::vector< Mat > > &A, Mat &C)
 Concatenate a "matrix" of sub-blocks C = [A0;A1;A2;...;An] where Ai = [A[i][0] A[i][1] ... A[i][m]];.
 
template<typename T , typename DerivedC >
void cat (const int dim, const std::vector< T > &A, Eigen::PlainObjectBase< DerivedC > &C)
 Concatenate a std::vector of matrices along the specified dimension.
 
template<typename DerivedX , typename DerivedY >
void ceil (const Eigen::PlainObjectBase< DerivedX > &X, Eigen::PlainObjectBase< DerivedY > &Y)
 Ceil a given matrix to nearest integers.
 
template<typename DerivedV , typename DerivedF , typename Derivedc , typename Derivedvol >
void centroid (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< Derivedc > &c, Derivedvol &vol)
 Computes the centroid and enclosed volume of a closed mesh using a surface integral.
 
template<typename DerivedV , typename DerivedF , typename Derivedc >
void centroid (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< Derivedc > &c)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::vector< int > circulation (const int e, const bool ccw, const Eigen::VectorXi &EMAP, const Eigen::MatrixXi &EF, const Eigen::MatrixXi &EI)
 Return list of faces around the end point of an edge.
 
void circulation (const int e, const bool ccw, const Eigen::VectorXi &EMAP, const Eigen::MatrixXi &EF, const Eigen::MatrixXi &EI, Eigen::VectorXi &vN)
 Return list of faces around the end point of an edge.
 
void circulation (const int e, const bool ccw, const Eigen::MatrixXi &F, const Eigen::VectorXi &EMAP, const Eigen::MatrixXi &EF, const Eigen::MatrixXi &EI, std::vector< int > &Nv, std::vector< int > &Nf)
 Return list of faces around the end point of an edge.
 
template<typename DerivedV , typename DerivedF , typename DerivedR >
void circumradius (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedR > &R)
 Compute the circumradius of each triangle in a mesh (V,F)
 
bool collapse_edge (const int e, const Eigen::RowVectorXd &p, Eigen::MatrixXd &V, Eigen::MatrixXi &F, Eigen::MatrixXi &E, Eigen::VectorXi &EMAP, Eigen::MatrixXi &EF, Eigen::MatrixXi &EI, int &e1, int &e2, int &f1, int &f2)
 Attempt to collapse a given edge of a mesh.
 
bool collapse_edge (const int e, const Eigen::RowVectorXd &p, std::vector< int > &Nsv, const std::vector< int > &Nsf, std::vector< int > &Ndv, const std::vector< int > &Ndf, Eigen::MatrixXd &V, Eigen::MatrixXi &F, Eigen::MatrixXi &E, Eigen::VectorXi &EMAP, Eigen::MatrixXi &EF, Eigen::MatrixXi &EI, int &e1, int &e2, int &f1, int &f2)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool collapse_edge (const int e, const Eigen::RowVectorXd &p, Eigen::MatrixXd &V, Eigen::MatrixXi &F, Eigen::MatrixXi &E, Eigen::VectorXi &EMAP, Eigen::MatrixXi &EF, Eigen::MatrixXi &EI)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool collapse_edge (const decimate_cost_and_placement_callback &cost_and_placement, const decimate_pre_collapse_callback &pre_collapse, const decimate_post_collapse_callback &post_collapse, Eigen::MatrixXd &V, Eigen::MatrixXi &F, Eigen::MatrixXi &E, Eigen::VectorXi &EMAP, Eigen::MatrixXi &EF, Eigen::MatrixXi &EI, igl::min_heap< std::tuple< double, int, int > > &Q, Eigen::VectorXi &EQ, Eigen::MatrixXd &C, int &e, int &e1, int &e2, int &f1, int &f2)
 Collapse least-cost edge from a priority queue and update queue.
 
bool collapse_edge (const decimate_cost_and_placement_callback &cost_and_placement, Eigen::MatrixXd &V, Eigen::MatrixXi &F, Eigen::MatrixXi &E, Eigen::VectorXi &EMAP, Eigen::MatrixXi &EF, Eigen::MatrixXi &EI, igl::min_heap< std::tuple< double, int, int > > &Q, Eigen::VectorXi &EQ, Eigen::MatrixXd &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool collapse_edge (const decimate_cost_and_placement_callback &cost_and_placement, const decimate_pre_collapse_callback &pre_collapse, const decimate_post_collapse_callback &post_collapse, Eigen::MatrixXd &V, Eigen::MatrixXi &F, Eigen::MatrixXi &E, Eigen::VectorXi &EMAP, Eigen::MatrixXi &EF, Eigen::MatrixXi &EI, igl::min_heap< std::tuple< double, int, int > > &Q, Eigen::VectorXi &EQ, Eigen::MatrixXd &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void collapse_small_triangles (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const double eps, Eigen::MatrixXi &FF)
 Given a triangle mesh (V,F) compute a new mesh (VV,FF) which contains the original faces and vertices of (V,F) except any small triangles have been removed via collapse.
 
template<typename L , typename S , typename H , typename T >
void colon (const L low, const S step, const H hi, Eigen::Matrix< T, Eigen::Dynamic, 1 > &I)
 Colon operator like matlab's colon operator.
 
template<typename L , typename H , typename T >
void colon (const L low, const H hi, Eigen::Matrix< T, Eigen::Dynamic, 1 > &I)
 Colon operator like matlab's colon operator.
 
template<typename T >
void colormap (const ColorMapType cm, const T f, T *rgb)
 Compute [r,g,b] values of the selected colormap for a given factor f between 0 and 1.
 
template<typename T >
void colormap (const ColorMapType cm, const T f, T &r, T &g, T &b)
 Compute [r,g,b] values of the selected colormap for a given factor f between 0 and 1.
 
template<typename T >
void colormap (const double palette[256][3], const T x_in, T &r, T &g, T &b)
 Compute [r,g,b] values of the colormap palette for a given factor f between 0 and 1.
 
template<typename DerivedZ , typename DerivedC >
void colormap (const ColorMapType cm, const Eigen::MatrixBase< DerivedZ > &Z, const bool normalize, Eigen::PlainObjectBase< DerivedC > &C)
 Compute [r,g,b] values of the colormap palette for a given factors between 0 and 1.
 
template<typename DerivedZ , typename DerivedC >
void colormap (const ColorMapType cm, const Eigen::MatrixBase< DerivedZ > &Z, const double min_Z, const double max_Z, Eigen::PlainObjectBase< DerivedC > &C)
 Compute [r,g,b] values of the colormap palette for a given factors between min_Z and max_Z
 
bool column_to_quats (const Eigen::VectorXd &Q, std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &vQ)
 de-"Columnize" a list of quaternions (q1x,q1y,q1z,q1w,q2x,q2y,q2z,q2w,...)
 
template<typename DerivedA , typename DerivedB >
void columnize (const Eigen::PlainObjectBase< DerivedA > &A, const int k, const int dim, Eigen::PlainObjectBase< DerivedB > &B)
 "Columnize" a stack of block matrices.
 
template<typename DerivedV , typename DerivedF >
void comb_cross_field (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedV > &PD1in, const Eigen::MatrixBase< DerivedV > &PD2in, Eigen::PlainObjectBase< DerivedV > &PD1out, Eigen::PlainObjectBase< DerivedV > &PD2out)
 Computes principal matchings of the vectors of a cross field across face edges, and generates a combed cross field defined on the mesh faces.
 
template<typename DerivedV , typename DerivedF , typename DerivedP >
void comb_frame_field (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedP > &PD1, const Eigen::MatrixBase< DerivedP > &PD2, const Eigen::MatrixBase< DerivedP > &BIS1_combed, const Eigen::MatrixBase< DerivedP > &BIS2_combed, Eigen::PlainObjectBase< DerivedP > &PD1_combed, Eigen::PlainObjectBase< DerivedP > &PD2_combed)
 Computes principal matchings of the vectors of a frame field across face edges, and generates a combed frame field defined on the mesh faces.
 
template<typename DerivedV , typename DerivedF >
void comb_line_field (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedV > &PD1in, Eigen::PlainObjectBase< DerivedV > &PD1out)
 Computes principal matchings of the vectors of a cross field across face edges, and generates a combed cross field defined on the mesh faces.
 
template<typename DerivedVV , typename DerivedFF , typename DerivedV , typename DerivedF , typename DerivedVsizes , typename DerivedFsizes >
void combine (const std::vector< DerivedVV > &VV, const std::vector< DerivedFF > &FF, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedVsizes > &Vsizes, Eigen::PlainObjectBase< DerivedFsizes > &Fsizes)
 Concatenate k meshes into a single >=k connected component mesh with a single vertex list and face list.
 
template<typename DerivedVV , typename DerivedFF , typename DerivedV , typename DerivedF >
void combine (const std::vector< DerivedVV > &VV, const std::vector< DerivedFF > &FF, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
void compute_frame_field_bisectors (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedV > &B1, const Eigen::MatrixBase< DerivedV > &B2, const Eigen::MatrixBase< DerivedV > &PD1, const Eigen::MatrixBase< DerivedV > &PD2, Eigen::PlainObjectBase< DerivedV > &BIS1, Eigen::PlainObjectBase< DerivedV > &BIS2)
 Compute bisectors of a frame field defined on mesh faces.
 
template<typename DerivedV , typename DerivedF >
void compute_frame_field_bisectors (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedV > &PD1, const Eigen::MatrixBase< DerivedV > &PD2, Eigen::PlainObjectBase< DerivedV > &BIS1, Eigen::PlainObjectBase< DerivedV > &BIS2)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedFO >
void connect_boundary_to_infinity (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedFO > &FO)
 Connect all boundary edges to a fictitious point at infinity.
 
template<typename DerivedF , typename DerivedFO >
void connect_boundary_to_infinity (const Eigen::MatrixBase< DerivedF > &F, const typename DerivedF::Scalar inf_index, Eigen::PlainObjectBase< DerivedFO > &FO)
 Connect all boundary edges to a fictitious point at infinity.
 
template<typename DerivedV , typename DerivedF , typename DerivedVO , typename DerivedFO >
void connect_boundary_to_infinity (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedVO > &VO, Eigen::PlainObjectBase< DerivedFO > &FO)
 Connect all boundary edges to a fictitious point at infinity.
 
template<typename Atype , typename DerivedC , typename DerivedK >
int connected_components (const Eigen::SparseMatrix< Atype > &A, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedK > &K)
 Determine the connected components of a graph described by the input adjacency matrix (similar to MATLAB's graphconncomp or gptoolbox's conncomp, but A is transposed for unsymmetric graphs).
 
template<typename DerivedV , typename DerivedF , typename Scalar >
void cotmatrix (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< Scalar > &L)
 Constructs the cotangent stiffness matrix (discrete laplacian) for a given mesh (V,F).
 
template<typename DerivedV , typename DerivedI , typename DerivedC , typename Scalar >
void cotmatrix (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedI > &I, const Eigen::MatrixBase< DerivedC > &C, Eigen::SparseMatrix< Scalar > &L, Eigen::SparseMatrix< Scalar > &M, Eigen::SparseMatrix< Scalar > &P)
 Cotangent Laplacian (and mass matrix) for polygon meshes according to "Polygon Laplacian Made Simple" [Bunge et al. 2020].
 
template<typename DerivedV , typename DerivedF , typename DerivedC >
void cotmatrix_entries (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedC > &C)
 Compute the cotmatrix contributions (cotangents) of each angle in mesh (V,F)
 
template<typename Derivedl , typename DerivedC >
void cotmatrix_entries (const Eigen::MatrixBase< Derivedl > &l, Eigen::PlainObjectBase< DerivedC > &C)
 Compute the cotmatrix contributions (cotangents) of each angle in mesh with edge lengths (l)
 
template<typename Derivedl , typename DerivedF , typename Scalar >
void cotmatrix_intrinsic (const Eigen::MatrixBase< Derivedl > &l, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< Scalar > &L)
 Constructs the cotangent stiffness matrix (discrete laplacian) for a given mesh with faces F and edge lengths l.
 
template<typename XType , typename SType >
void count (const Eigen::SparseMatrix< XType > &X, const int dim, Eigen::SparseVector< SType > &S)
 Count the number of non-zeros in the columns or rows of a sparse matrix.
 
template<typename XType , typename DerivedS >
void count (const Eigen::SparseMatrix< XType > &X, const int dim, Eigen::PlainObjectBase< DerivedS > &S)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void covariance_scatter_matrix (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const ARAPEnergyType energy, Eigen::SparseMatrix< double > &CSM)
 Construct the covariance scatter matrix for a given arap energy.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarK >
void cr_vector_curvature_correction (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarK > &K)
 Computes the vector Crouzeix-Raviart curvature correction term of Oded Stein, Alec Jacobson, Max Wardetzky, Eitan Grinspun, 2020.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarK >
void cr_vector_curvature_correction (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarK > &K)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedL_sq , typename Derivedtheta , typename Derivedkappa , typename DerivedE , typename DerivedOE , typename ScalarK >
void cr_vector_curvature_correction_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedL_sq > &l_sq, const Eigen::MatrixBase< Derivedtheta > &theta, const Eigen::MatrixBase< Derivedkappa > &kappa, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarK > &K)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedL_sq , typename DerivedE , typename DerivedOE , typename ScalarK >
void cr_vector_curvature_correction_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedL_sq > &l_sq, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarK > &K)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. include/igl/cr_vector_curvature_correction.h.
 
template<typename DerivedF , typename DerivedL_sq , typename Derivedtheta , typename DerivedE , typename DerivedOE , typename ScalarK >
void cr_vector_curvature_correction_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedL_sq > &l_sq, const Eigen::MatrixBase< Derivedtheta > &theta, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarK > &K)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. include/igl/cr_vector_curvature_correction.h.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarL >
void cr_vector_laplacian (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarL > &L)
 Computes the CR vector Laplacian matrix.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarL >
void cr_vector_laplacian (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarL > &L)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedL_sq , typename DeriveddA , typename DerivedE , typename DerivedOE , typename ScalarL >
void cr_vector_laplacian_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedL_sq > &l_sq, const Eigen::MatrixBase< DeriveddA > &dA, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarL > &L)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedL_sq , typename DerivedE , typename DerivedOE , typename ScalarL >
void cr_vector_laplacian_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedL_sq > &l_sq, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarL > &L)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. include/igl/cr_vector_laplacian.h.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename ScalarM >
void cr_vector_mass (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, Eigen::SparseMatrix< ScalarM > &M)
 Computes the CR vector mass matrix, using an arrangement of all parallel degrees of freedom first, and all perpendicular degrees of freedom next.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename ScalarM >
void cr_vector_mass (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::SparseMatrix< ScalarM > &M)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DeriveddA , typename DerivedE , typename ScalarM >
void cr_vector_mass_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DeriveddA > &dA, const Eigen::MatrixBase< DerivedE > &E, Eigen::SparseMatrix< ScalarM > &M)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void cross (const double *a, const double *b, double *out)
 Cross product; out = cross(a,b)
 
template<typename DerivedA , typename DerivedB , typename DerivedC >
void cross (const Eigen::PlainObjectBase< DerivedA > &A, const Eigen::PlainObjectBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedC > &C)
 Computes rowwise cross product C = cross(A,B,2);.
 
template<typename DerivedV , typename DerivedF , typename DerivedM >
void cross_field_mismatch (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedV > &PD1, const Eigen::MatrixBase< DerivedV > &PD2, const bool isCombed, Eigen::PlainObjectBase< DerivedM > &mismatch)
 Calculates the mismatch (integer), at each face edge, of a cross field defined on the mesh faces.
 
template<typename DerivedV , typename DerivedF , typename LT , typename DerivedE , typename DerivedEMAP >
void crouzeix_raviart_cotmatrix (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< LT > &L, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedEMAP > &EMAP)
 Compute the Crouzeix-Raviart cotangent stiffness matrix.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedEMAP , typename LT >
void crouzeix_raviart_cotmatrix (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedEMAP > &EMAP, Eigen::SparseMatrix< LT > &L)
 Compute the Crouzeix-Raviart cotangent stiffness matrix.
 
template<typename MT , typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedEMAP >
void crouzeix_raviart_massmatrix (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< MT > &M, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedEMAP > &EMAP)
 CROUZEIX_RAVIART_MASSMATRIX Compute the Crouzeix-Raviart mass matrix where M(e,e) is just the sum of the areas of the triangles on either side of an edge e.
 
template<typename MT , typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedEMAP >
void crouzeix_raviart_massmatrix (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedEMAP > &EMAP, Eigen::SparseMatrix< MT > &M)
 CROUZEIX_RAVIART_MASSMATRIX Compute the Crouzeix-Raviart mass matrix where M(e,e) is just the sum of the areas of the triangles on either side of an edge e.
 
template<typename DerivedX , typename DerivedY >
void cumprod (const Eigen::MatrixBase< DerivedX > &X, const int dim, Eigen::PlainObjectBase< DerivedY > &Y)
 Computes a cumulative product of the columns of X, like matlab's cumprod.
 
template<typename DerivedX , typename DerivedY >
void cumsum (const Eigen::MatrixBase< DerivedX > &X, const int dim, Eigen::PlainObjectBase< DerivedY > &Y)
 Computes a cumulative sum of the columns of X, like matlab's cumsum.
 
template<typename DerivedX , typename DerivedY >
void cumsum (const Eigen::MatrixBase< DerivedX > &X, const int dim, const bool zero_prefix, Eigen::PlainObjectBase< DerivedY > &Y)
 Computes a cumulative sum of the columns of [0;X].
 
template<typename DerivedV , typename DerivedF , typename ScalarQ >
void curved_hessian_energy (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< ScalarQ > &Q)
 Computes the curved Hessian energy using the Crouzeix-Raviart discretization.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarQ >
void curved_hessian_energy (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarQ > &Q)
 Computes the curved Hessian energy using the Crouzeix-Raviart discretization.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarQ >
void curved_hessian_energy (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarQ > &Q)
 Computes the curved Hessian energy using the Crouzeix-Raviart discretization.
 
template<typename DerivedF , typename DerivedL_sq , typename DerivedE , typename DerivedOE , typename ScalarQ >
void curved_hessian_energy_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedL_sq > &l_sq, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarQ > &Q)
 Computes the curved Hessian energy using the Crouzeix-Raviart discretization.
 
template<typename DerivedF , typename DerivedL_sq , typename DeriveddA , typename DerivedE , typename DerivedOE , typename ScalarQ >
void curved_hessian_energy_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedL_sq > &l_sq, const Eigen::MatrixBase< DeriveddA > &dA, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarQ > &Q)
 Computes the curved Hessian energy using the Crouzeix-Raviart discretization.
 
template<typename DerivedV , typename DerivedF , typename DerivedC , typename DerivedI >
void cut_mesh (Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, const Eigen::MatrixBase< DerivedC > &cuts, Eigen::PlainObjectBase< DerivedI > &I)
 Given a mesh and a list of edges that are to be cut, the function generates a new disk-topology mesh that has the cuts at its boundary.
 
template<typename DerivedV , typename DerivedF , typename DerivedFF , typename DerivedFFi , typename DerivedC , typename DerivedI >
void cut_mesh (Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, Eigen::MatrixBase< DerivedFF > &FF, Eigen::MatrixBase< DerivedFFi > &FFi, const Eigen::MatrixBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedI > &I)
 Given a mesh and a list of edges that are to be cut, the function generates a new disk-topology mesh that has the cuts at its boundary.
 
template<typename DerivedV , typename DerivedF , typename DerivedC >
void cut_mesh (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedC > &cuts, Eigen::PlainObjectBase< DerivedV > &Vn, Eigen::PlainObjectBase< DerivedF > &Fn)
 Given a mesh and a list of edges that are to be cut, the function generates a new disk-topology mesh that has the cuts at its boundary.
 
template<typename DerivedV , typename DerivedF , typename DerivedC , typename DerivedI >
void cut_mesh (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedC > &cuts, Eigen::PlainObjectBase< DerivedV > &Vn, Eigen::PlainObjectBase< DerivedF > &Fn, Eigen::PlainObjectBase< DerivedI > &I)
 Given a mesh and a list of edges that are to be cut, the function generates a new disk-topology mesh that has the cuts at its boundary.
 
template<typename DerivedV , typename DerivedF , typename DerivedM , typename DerivedO >
void cut_mesh_from_singularities (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedM > &MMatch, Eigen::PlainObjectBase< DerivedO > &seams)
 Given a mesh (V,F) and the integer mismatch of a cross field per edge (mismatch), finds the cut_graph connecting the singularities (seams) and the degree of the singularities singularity_index.
 
template<typename DerivedF , typename Index >
void cut_to_disk (const Eigen::MatrixBase< DerivedF > &F, std::vector< std::vector< Index > > &cuts)
 Given a triangle mesh, computes a set of edge cuts sufficient to carve the mesh into a topological disk, without disconnecting any connected components.
 
template<typename DerivedV , typename DerivedF >
void cylinder (const int axis_devisions, const int height_devisions, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 Construct a triangle mesh of a cylinder (without caps)
 
bool dated_copy (const std::string &src_path, const std::string &dir)
 Copy the given file to a new file with the same basename in dir directory with the current date and time as a suffix.
 
bool dated_copy (const std::string &src_path)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool decimate (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const size_t max_m, Eigen::MatrixXd &U, Eigen::MatrixXi &G, Eigen::VectorXi &J, Eigen::VectorXi &I)
 Assumes (V,F) is a manifold mesh (possibly with boundary) collapses edges until desired number of faces is achieved.
 
bool decimate (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const size_t max_m, Eigen::MatrixXd &U, Eigen::MatrixXi &G, Eigen::VectorXi &J)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool decimate (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const decimate_cost_and_placement_callback &cost_and_placement, const decimate_stopping_condition_callback &stopping_condition, const decimate_pre_collapse_callback &pre_collapse, const decimate_post_collapse_callback &post_collapse, const Eigen::MatrixXi &E, const Eigen::VectorXi &EMAP, const Eigen::MatrixXi &EF, const Eigen::MatrixXi &EI, Eigen::MatrixXd &U, Eigen::MatrixXi &G, Eigen::VectorXi &J, Eigen::VectorXi &I)
 Collapses edges of a closed manifold mesh (V,F) using user defined callbacks in a priority queue.
 
bool decimate (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const decimate_cost_and_placement_callback &cost_and_placement, const decimate_stopping_condition_callback &stopping_condition, const decimate_pre_collapse_callback &pre_collapse, const decimate_post_collapse_callback &post_collapse, Eigen::MatrixXd &U, Eigen::MatrixXi &G, Eigen::VectorXi &J, Eigen::VectorXi &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool decimate (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const decimate_cost_and_placement_callback &cost_and_placement, const decimate_stopping_condition_callback &stopping_condition, Eigen::MatrixXd &U, Eigen::MatrixXi &G, Eigen::VectorXi &J, Eigen::VectorXi &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void decimate_trivial_callbacks (decimate_pre_collapse_callback &always_try, decimate_post_collapse_callback &never_care)
 Function to build trivial pre and post collapse actions.
 
unsigned int default_num_threads (unsigned int force_num_threads=0)
 Returns the default number of threads used in libigl.
 
void deform_skeleton (const Eigen::MatrixXd &C, const Eigen::MatrixXi &BE, const std::vector< Eigen::Affine3d, Eigen::aligned_allocator< Eigen::Affine3d > > &vA, Eigen::MatrixXd &CT, Eigen::MatrixXi &BET)
 Deform a skeleton.
 
void deform_skeleton (const Eigen::MatrixXd &C, const Eigen::MatrixXi &BE, const Eigen::MatrixXd &T, Eigen::MatrixXd &CT, Eigen::MatrixXi &BET)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename Orient2D , typename InCircle , typename DerivedF >
void delaunay_triangulation (const Eigen::MatrixBase< DerivedV > &V, Orient2D orient2D, InCircle incircle, Eigen::PlainObjectBase< DerivedF > &F)
 Given a set of points in 2D, return a Delaunay triangulation of these points.
 
template<typename AType , typename DerivedD , typename DerivedP , typename DerivedC >
void dfs (const std::vector< std::vector< AType > > &A, const size_t s, Eigen::PlainObjectBase< DerivedD > &D, Eigen::PlainObjectBase< DerivedP > &P, Eigen::PlainObjectBase< DerivedC > &C)
 Traverse a directed graph represented by an adjacency list using depth first search.
 
template<typename AType , typename DType , typename PType , typename CType >
void dfs (const std::vector< std::vector< AType > > &A, const size_t s, std::vector< DType > &D, std::vector< PType > &P, std::vector< CType > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedT , typename Derivedtheta , typename Derivedcos_theta >
void dihedral_angles (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< Derivedtheta > &theta, Eigen::PlainObjectBase< Derivedcos_theta > &cos_theta)
 Compute dihedral angles for all tets of a given tet mesh (V,T).
 
template<typename DerivedL , typename DerivedA , typename Derivedtheta , typename Derivedcos_theta >
void dihedral_angles_intrinsic (const Eigen::MatrixBase< DerivedL > &L, const Eigen::MatrixBase< DerivedA > &A, Eigen::PlainObjectBase< Derivedtheta > &theta, Eigen::PlainObjectBase< Derivedcos_theta > &cos_theta)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename IndexType , typename DerivedD , typename DerivedP >
int dijkstra (const IndexType &source, const std::set< IndexType > &targets, const std::vector< std::vector< IndexType > > &VV, const std::vector< double > &weights, Eigen::PlainObjectBase< DerivedD > &min_distance, Eigen::PlainObjectBase< DerivedP > &previous)
 Dijkstra's algorithm for vertex-weighted shortest paths, with multiple targets.
 
template<typename IndexType , typename DerivedV , typename DerivedD , typename DerivedP >
int dijkstra (const Eigen::MatrixBase< DerivedV > &V, const std::vector< std::vector< IndexType > > &VV, const IndexType &source, const std::set< IndexType > &targets, Eigen::PlainObjectBase< DerivedD > &min_distance, Eigen::PlainObjectBase< DerivedP > &previous)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename IndexType , typename DerivedD , typename DerivedP >
int dijkstra (const IndexType &source, const std::set< IndexType > &targets, const std::vector< std::vector< IndexType > > &VV, Eigen::PlainObjectBase< DerivedD > &min_distance, Eigen::PlainObjectBase< DerivedP > &previous)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename IndexType , typename DerivedP >
void dijkstra (const IndexType &vertex, const Eigen::MatrixBase< DerivedP > &previous, std::vector< IndexType > &path)
 Backtracking after Dijkstra's algorithm, to find shortest path.
 
template<typename DerivedV , typename DerivedOmega , typename DerivedU >
void direct_delta_mush (const Eigen::MatrixBase< DerivedV > &V, const std::vector< Eigen::Affine3d, Eigen::aligned_allocator< Eigen::Affine3d > > &T, const Eigen::MatrixBase< DerivedOmega > &Omega, Eigen::PlainObjectBase< DerivedU > &U)
 Computes Direct Delta Mush Skinning (Variant 0) from "Direct Delta Mush Skinning and Variants".
 
template<typename DerivedV , typename DerivedF , typename DerivedW , typename DerivedOmega >
void direct_delta_mush_precomputation (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedW > &W, const int p, const typename DerivedV::Scalar lambda, const typename DerivedV::Scalar kappa, const typename DerivedV::Scalar alpha, Eigen::PlainObjectBase< DerivedOmega > &Omega)
 Precomputation for Direct Delta Mush Skinning.
 
template<typename DerivedC , typename DerivedE >
void directed_edge_orientations (const Eigen::MatrixBase< DerivedC > &C, const Eigen::MatrixBase< DerivedE > &E, std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &Q)
 Determine rotations that take each edge from the x-axis to its given rest orientation.
 
template<typename DerivedE , typename DerivedP >
void directed_edge_parents (const Eigen::MatrixBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedP > &P)
 Recover "parents" (preceding edges) in a tree given just directed edges.
 
std::string dirname (const std::string &path)
 Function like PHP's dirname: /etc/passwd --> /etc,.
 
double dot (const double *a, const double *b)
 Computes out = dot(a,b)
 
template<typename DerivedV >
DerivedV dot_row (const Eigen::PlainObjectBase< DerivedV > &A, const Eigen::PlainObjectBase< DerivedV > &B)
 Compute the dot product between each row of A and B.
 
template<typename DerivedV , typename DerivedF , typename DeriveddblA >
void doublearea (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DeriveddblA > &dblA)
 Computes twice the area for each input triangle or quad.
 
template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedD >
void doublearea (const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedD > &D)
 Compute the twice the signed area of a each triangle.
 
template<typename DerivedA , typename DerivedB , typename DerivedC >
DerivedA::Scalar doublearea_single (const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< DerivedC > &C)
 Compute the twice the signed area of a single triangle.
 
template<typename Derivedl , typename DeriveddblA >
void doublearea (const Eigen::MatrixBase< Derivedl > &l, const typename Derivedl::Scalar nan_replacement, Eigen::PlainObjectBase< DeriveddblA > &dblA)
 Compute twice the area of each intrinsic triangle in a mesh.
 
template<typename Derivedl , typename DeriveddblA >
void doublearea (const Eigen::MatrixBase< Derivedl > &l, Eigen::PlainObjectBase< DeriveddblA > &dblA)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DeriveddblA >
void doublearea_quad (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DeriveddblA > &dblA)
 Computes twice the area for each input quadrilateral.
 
template<typename DerivedV , typename DerivedW , typename Q , typename QAlloc , typename T , typename DerivedU >
void dqs (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedW > &W, const std::vector< Q, QAlloc > &vQ, const std::vector< T > &vT, Eigen::PlainObjectBase< DerivedU > &U)
 Dual quaternion skinning.
 
template<typename DerivedV , typename DerivedQ >
void dual_contouring (const std::function< typename DerivedV::Scalar(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &f, const std::function< Eigen::Matrix< typename DerivedV::Scalar, 1, 3 >(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &f_grad, const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &min_corner, const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &max_corner, const int nx, const int ny, const int nz, const bool constrained, const bool triangles, const bool root_finding, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedQ > &Q)
 Dual contouring to extract a pure quad mesh from differentiable implicit function using a dense grid.
 
template<typename DerivedGf , typename DerivedGV , typename DerivedV , typename DerivedQ >
void dual_contouring (const std::function< typename DerivedV::Scalar(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &f, const std::function< Eigen::Matrix< typename DerivedV::Scalar, 1, 3 >(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &f_grad, const Eigen::MatrixBase< DerivedGf > &Gf, const Eigen::MatrixBase< DerivedGV > &GV, const int nx, const int ny, const int nz, const bool constrained, const bool triangles, const bool root_finding, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedQ > &Q)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedGf , typename DerivedGV , typename DerivedGI , typename DerivedV , typename DerivedQ >
void dual_contouring (const std::function< typename DerivedV::Scalar(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &f, const std::function< Eigen::Matrix< typename DerivedV::Scalar, 1, 3 >(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &f_grad, const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &step, const Eigen::MatrixBase< DerivedGf > &Gf, const Eigen::MatrixBase< DerivedGV > &GV, const Eigen::MatrixBase< DerivedGI > &GI, const bool constrained, const bool triangles, const bool root_finding, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedQ > &Q)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename Derivedear , typename Derivedear_opp >
void ears (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< Derivedear > &ear, Eigen::PlainObjectBase< Derivedear_opp > &ear_opp)
 Find all ears (faces with two boundary edges) in a given mesh.
 
bool edge_collapse_is_valid (const int e, const Eigen::MatrixXi &F, const Eigen::MatrixXi &E, const Eigen::VectorXi &EMAP, const Eigen::MatrixXi &EF, const Eigen::MatrixXi &EI)
 Tests whether collapsing exactly two faces and exactly 3 edges from E (e and one side of each face gets collapsed to the other) will result in a mesh with the same topology.
 
bool edge_collapse_is_valid (std::vector< int > &Nsv, std::vector< int > &Ndv)
 Tests whether collapsing exactly two faces and exactly 3 edges from E (e and one side of each face gets collapsed to the other) will result in a mesh with the same topology.
 
template<typename DeriveduE , typename DerivedS , typename DerivedT >
void edge_crossings (const Eigen::MatrixBase< DeriveduE > &uE, const Eigen::MatrixBase< DerivedS > &S, const typename DerivedS::Scalar val, std::unordered_map< int, int > &uE2I, Eigen::PlainObjectBase< DerivedT > &T)
 Compute the each point that a scalar field crosses a specified value along an edge of a mesh.
 
template<typename DeriveduE , typename DerivedEMAP , typename uE2EType , typename Index >
bool edge_exists_near (const Eigen::MatrixBase< DeriveduE > &uE, const Eigen::MatrixBase< DerivedEMAP > &EMAP, const std::vector< std::vector< uE2EType > > &uE2E, const Index &a, const Index &b, const Index &uei)
 Does edge (a,b) exist in the edges of all faces incident on existing unique edge uei.
 
void edge_flaps (const Eigen::MatrixXi &F, const Eigen::MatrixXi &uE, const Eigen::VectorXi &EMAP, Eigen::MatrixXi &EF, Eigen::MatrixXi &EI)
 Determine "edge flaps": two faces on either side of a unique edge (assumes edge-manifold mesh)
 
void edge_flaps (const Eigen::MatrixXi &F, Eigen::MatrixXi &uE, Eigen::VectorXi &EMAP, Eigen::MatrixXi &EF, Eigen::MatrixXi &EI)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedL >
void edge_lengths (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedL > &L)
 Constructs a list of lengths of edges opposite each index in a face (triangle/tet) list.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedoE , typename Derivedmps >
void edge_midpoints (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedoE > &oE, Eigen::PlainObjectBase< Derivedmps > &mps)
 Computes the midpoints of edges in a triangle mesh.
 
template<typename DerivedV , typename DerivedF , typename DerivedE >
void edge_topology (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &EV, Eigen::PlainObjectBase< DerivedE > &FE, Eigen::PlainObjectBase< DerivedE > &EF)
 Initialize Edges and their topological relations (assumes an edge-manifold mesh).
 
template<bool computePerpendicular = true, typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedoE , typename DerivedvecParallel , typename DerivedvecPerpendicular >
void edge_vectors (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedoE > &oE, Eigen::PlainObjectBase< DerivedvecParallel > &vecParallel, Eigen::PlainObjectBase< DerivedvecPerpendicular > &vecPerpendicular)
 Computes the normalized edge vectors for edges in a triangle mesh.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedoE , typename Derivedvec >
void edge_vectors (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedoE > &oE, Eigen::PlainObjectBase< Derivedvec > &vec)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedE >
void edges (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E)
 Constructs a list of unique edges represented in a given mesh (V,F)
 
template<typename DerivedI , typename DerivedC , typename DerivedE >
void edges (const Eigen::MatrixBase< DerivedI > &I, const Eigen::MatrixBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedE > &E)
 Constructs a list of unique edges represented in a given polygon mesh.
 
template<typename T , typename DerivedE >
void edges (const Eigen::SparseMatrix< T > &A, Eigen::PlainObjectBase< DerivedE > &E)
 Constructs a list of unique edges represented in a given adjacency matrix.
 
template<typename DerivedE , typename DerivedI , typename DerivedJ , typename DerivedK >
void edges_to_path (const Eigen::MatrixBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedJ > &J, Eigen::PlainObjectBase< DerivedK > &K)
 Given a set of undirected, unique edges such that all form a single connected compoent with exactly 0 or 2 nodes with valence =1, determine the/a path visiting all nodes.
 
template<typename Atype , typename Btype , typename DerivedU , typename DerivedS >
bool eigs (const Eigen::SparseMatrix< Atype > &A, const Eigen::SparseMatrix< Btype > &B, const size_t k, const EigsType type, Eigen::PlainObjectBase< DerivedU > &sU, Eigen::PlainObjectBase< DerivedS > &sS)
 Compute the first/last k eigen pairs of the generalized eigen value problem:
 
template<typename S_type >
S_type EPS ()
 Function returning EPS for corresponding type.
 
template<typename S_type >
S_type EPS_SQ ()
 Function returning EPS_SQ for corresponding type.
 
template<>
float EPS< float > ()
 
template<>
double EPS< double > ()
 
template<>
float EPS_SQ< float > ()
 
template<>
double EPS_SQ< double > ()
 
template<typename DerivedF >
int euler_characteristic (const Eigen::MatrixBase< DerivedF > &F)
 Computes the Euler characteristic of a given mesh (V,F)
 
template<typename DerivedV , typename DerivedF , typename DerivedVS , typename DerivedFS , typename DerivedVT , typename DerivedFT , typename DerivedD >
void exact_geodesic (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedVS > &VS, const Eigen::MatrixBase< DerivedFS > &FS, const Eigen::MatrixBase< DerivedVT > &VT, const Eigen::MatrixBase< DerivedFT > &FT, Eigen::PlainObjectBase< DerivedD > &D)
 Exact geodesic algorithm for triangular mesh with the implementation from https://code.google.com/archive/p/geodesic/, and the algorithm first described by Mitchell, Mount and Papadimitriou in 1987.
 
template<typename Printable >
bool example_fun (const Printable &input)
 This is an example of a function, it takes a templated parameter and shovels it into cout.
 
template<typename DerivedV , typename DerivedT , typename DerivedEV , typename DerivedEF , typename DerivedI , typename DerivedJ >
void exploded_view (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, const typename DerivedV::Scalar s, const typename DerivedV::Scalar t, Eigen::PlainObjectBase< DerivedEV > &EV, Eigen::PlainObjectBase< DerivedEF > &EF, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedJ > &J)
 Given a tet-mesh, create a trivial surface mesh (4 triangles per tet) with each tet scaled individually and translated outward from the mesh's centroid, creating an exploded-view visualization.
 
std::string extension (const std::string &path)
 Extract file extension from path.
 
void exterior_edges (const Eigen::MatrixXi &F, Eigen::MatrixXi &E)
 Determines boundary "edges" and also edges with an odd number of occurrences where seeing edge (i,j) counts as +1 and seeing the opposite edge (j,i) counts as -1.
 
Eigen::MatrixXi exterior_edges (const Eigen::MatrixXi &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedEMAP , typename DeriveduEC , typename DeriveduEE , typename DerivedP >
size_t extract_manifold_patches (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedEMAP > &EMAP, const Eigen::MatrixBase< DeriveduEC > &uEC, const Eigen::MatrixBase< DeriveduEE > &uEE, Eigen::PlainObjectBase< DerivedP > &P)
 Extract a set of maximal patches from a given mesh.
 
template<typename DerivedF , typename DerivedEMAP , typename uE2EType , typename DerivedP >
size_t extract_manifold_patches (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedEMAP > &EMAP, const std::vector< std::vector< uE2EType > > &uE2E, Eigen::PlainObjectBase< DerivedP > &P)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedP >
size_t extract_manifold_patches (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedP > &P)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedEMAP , typename uE2EType >
void extract_non_manifold_edge_curves (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedEMAP > &EMAP, const std::vector< std::vector< uE2EType > > &uE2E, std::vector< std::vector< size_t > > &curves)
 Extract non-manifold curves from a given mesh.
 
template<typename DerivedV , typename DerivedT , typename DerivedA >
void face_areas (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedA > &A)
 Constructs a list of face areas of faces opposite each index in a tet list.
 
template<typename DerivedL , typename DerivedA >
void face_areas (const Eigen::MatrixBase< DerivedL > &L, Eigen::PlainObjectBase< DerivedA > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedL , typename DerivedA >
void face_areas (const Eigen::MatrixBase< DerivedL > &L, const typename DerivedL::Scalar doublearea_nan_replacement, Eigen::PlainObjectBase< DerivedA > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename IntegerF , typename IntegerC >
void face_occurrences (const std::vector< std::vector< IntegerF > > &F, std::vector< IntegerC > &C)
 Count the occurances of each face (row) in a list of face indices (irrespecitive of order)
 
template<typename DerivedF , typename DerivedC >
void face_occurrences (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename MatV , typename MatF , typename VecI >
void faces_first (const MatV &V, const MatF &F, MatV &RV, MatF &RF, VecI &IM)
 Reorder vertices so that vertices in face list come before vertices that don't appear in the face list.
 
template<typename MatV , typename MatF , typename VecI >
void faces_first (MatV &V, MatF &F, VecI &IM)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename Atype >
void facet_adjacency_matrix (const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< Atype > &A)
 Construct a #F×#F adjacency matrix with A(i,j)>0 indicating that faces i and j share an edge.
 
template<typename DerivedF , typename DerivedC >
int facet_components (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedC > &C)
 Compute connected components of facets based on edge-edge adjacency.
 
template<typename TTIndex , typename DerivedC , typename Derivedcounts >
void facet_components (const std::vector< std::vector< std::vector< TTIndex > > > &TT, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< Derivedcounts > &counts)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename Index >
void false_barycentric_subdivision (const Eigen::PlainObjectBase< Scalar > &V, const Eigen::PlainObjectBase< Index > &F, Eigen::PlainObjectBase< Scalar > &VD, Eigen::PlainObjectBase< Index > &FD)
 Refine the mesh by adding the barycenter of each face.
 
template<typename DerivedV1 , typename DerivedF1 , typename DerivedV2 , typename DerivedF2 , typename DerivedI , typename DerivedE >
void fast_find_intersections (const Eigen::MatrixBase< DerivedV1 > &V1, const Eigen::MatrixBase< DerivedF1 > &F1, const Eigen::MatrixBase< DerivedV2 > &V2, const Eigen::MatrixBase< DerivedF2 > &F2, Eigen::PlainObjectBase< DerivedI > &intersect_pairs, Eigen::PlainObjectBase< DerivedE > &edges)
 Identify triangles where two meshes interesect using AABBTree and tri_tri_intersection_test_3d.
 
template<typename DerivedV1 , typename DerivedF1 , typename DerivedV2 , typename DerivedF2 , typename DerivedI , typename DerivedE >
void fast_find_intersections (const AABB< DerivedV1, 3 > &tree, const Eigen::MatrixBase< DerivedV1 > &V1, const Eigen::MatrixBase< DerivedF1 > &F1, const Eigen::MatrixBase< DerivedV2 > &V2, const Eigen::MatrixBase< DerivedF2 > &F2, Eigen::PlainObjectBase< DerivedI > &intersect_pairs, Eigen::PlainObjectBase< DerivedE > &edges)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedI , typename DerivedE >
bool fast_find_self_intersections (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedI > &intersect, Eigen::PlainObjectBase< DerivedE > &edges)
 Identify triangles where mesh intersects itself using AABBTree and tri_tri_intersection_test_3d.
 
template<typename DerivedV , typename DerivedF , typename DerivedI >
bool fast_find_self_intersections (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedI > &intersect)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedP , typename DerivedA , typename DerivedN , typename Index , typename DerivedCH , typename DerivedCM , typename DerivedR , typename DerivedEC >
void fast_winding_number (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedA > &A, const std::vector< std::vector< Index > > &point_indices, const Eigen::MatrixBase< DerivedCH > &CH, const int expansion_order, Eigen::PlainObjectBase< DerivedCM > &CM, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedEC > &EC)
 Generate the precomputation for the fast winding number for point data [Barill et.
 
template<typename DerivedP , typename DerivedA , typename DerivedN , typename Index , typename DerivedCH , typename DerivedCM , typename DerivedR , typename DerivedEC , typename DerivedQ , typename BetaType , typename DerivedWN >
void fast_winding_number (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedA > &A, const std::vector< std::vector< Index > > &point_indices, const Eigen::MatrixBase< DerivedCH > &CH, const Eigen::MatrixBase< DerivedCM > &CM, const Eigen::MatrixBase< DerivedR > &R, const Eigen::MatrixBase< DerivedEC > &EC, const Eigen::MatrixBase< DerivedQ > &Q, const BetaType beta, Eigen::PlainObjectBase< DerivedWN > &WN)
 Evaluate the fast winding number for point data, having already done the the precomputation.
 
template<typename DerivedP , typename DerivedA , typename DerivedN , typename DerivedQ , typename BetaType , typename DerivedWN >
void fast_winding_number (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedQ > &Q, const int expansion_order, const BetaType beta, Eigen::PlainObjectBase< DerivedWN > &WN)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedP , typename DerivedA , typename DerivedN , typename DerivedQ , typename DerivedWN >
void fast_winding_number (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedQ > &Q, Eigen::PlainObjectBase< DerivedWN > &WN)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedQ , typename DerivedW >
void fast_winding_number (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedQ > &Q, Eigen::PlainObjectBase< DerivedW > &W)
 Compute approximate winding number of a triangle soup mesh according to "Fast Winding Numbers for Soups and Clouds" [Barill et al.
 
template<typename DerivedV , typename DerivedF >
void fast_winding_number (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const int order, FastWindingNumberBVH &fwn_bvh)
 Precomputation for computing approximate winding numbers of a triangle soup.
 
template<typename DerivedQ , typename DerivedW >
void fast_winding_number (const FastWindingNumberBVH &fwn_bvh, const float accuracy_scale, const Eigen::MatrixBase< DerivedQ > &Q, Eigen::PlainObjectBase< DerivedW > &W)
 After precomputation, compute winding number at a each of many points in a list.
 
template<typename Derivedp >
Derivedp::Scalar fast_winding_number (const FastWindingNumberBVH &fwn_bvh, const float accuracy_scale, const Eigen::MatrixBase< Derivedp > &p)
 After precomputation, compute winding number at a single point.
 
bool file_contents_as_string (const std::string file_name, std::string &content)
 Read a files contents as plain text into a given string.
 
std::string file_contents_as_string (const std::string file_name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string file_dialog_open ()
 Open a file dialog to select a file.
 
std::string file_dialog_save ()
 Open a file dialog to select a file.
 
bool file_exists (const std::string filename)
 Check if a file or directory exists like PHP's file_exists function:
 
template<typename T , typename DerivedI , typename DerivedJ , typename DerivedV >
void find (const Eigen::SparseMatrix< T > &X, Eigen::DenseBase< DerivedI > &I, Eigen::DenseBase< DerivedJ > &J, Eigen::DenseBase< DerivedV > &V)
 Find the non-zero entries and there respective indices in a sparse matrix.
 
template<typename T >
std::vector< Eigen::Triplet< T > > find (const Eigen::SparseMatrix< T > &X)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedI , typename DerivedJ , typename DerivedV >
void find (const Eigen::DenseBase< DerivedX > &X, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedJ > &J, Eigen::PlainObjectBase< DerivedV > &V)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedI >
void find (const Eigen::DenseBase< DerivedX > &X, Eigen::PlainObjectBase< DerivedI > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void find (const Eigen::SparseVector< T > &X, Eigen::Matrix< int, Eigen::Dynamic, 1 > &I, Eigen::Matrix< T, Eigen::Dynamic, 1 > &V)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<int RowsAtCompileTime, int MaxRowsAtCompileTime>
std::vector< int > find (const Eigen::Array< bool, RowsAtCompileTime, 1, 0, MaxRowsAtCompileTime, 1 > &M)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedM , typename DerivedO >
void find_cross_field_singularities (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedM > &mismatch, Eigen::PlainObjectBase< DerivedO > &isSingularity, Eigen::PlainObjectBase< DerivedO > &singularityIndex)
 Computes singularities of a cross field, assumed combed.
 
template<typename DerivedV , typename DerivedF , typename DerivedO >
void find_cross_field_singularities (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedV > &PD1, const Eigen::MatrixBase< DerivedV > &PD2, Eigen::PlainObjectBase< DerivedO > &isSingularity, Eigen::PlainObjectBase< DerivedO > &singularityIndex, bool isCombed=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename AType , typename DerivedI >
void find_zero (const Eigen::SparseMatrix< AType > &A, const int dim, Eigen::PlainObjectBase< DerivedI > &I)
 Find the first zero (whether implicit or explicitly stored) in the rows/columns of a matrix.
 
void fit_cubic_bezier (const Eigen::MatrixXd &d, const double error, std::vector< Eigen::MatrixXd > &cubics)
 Fit a cubic bezier spline (G1 continuous) to an ordered list of input points in any dimension, according to "An algorithm for automatically fitting digitized curves" [Schneider 1990].
 
void fit_cubic_bezier_substring (const Eigen::MatrixXd &d, const int first, const int last, const Eigen::RowVectorXd &tHat1, const Eigen::RowVectorXd &tHat2, const double error, const bool force_split, std::vector< Eigen::MatrixXd > &cubics)
 Recursive helper function for fit_cubic_bezier.
 
void fit_plane (const Eigen::MatrixXd &V, Eigen::RowVector3d &N, Eigen::RowVector3d &C)
 Fit a plane to a point cloud.
 
template<typename DerivedS , typename DerivedD >
void fit_rotations (const Eigen::PlainObjectBase< DerivedS > &S, const bool single_precision, Eigen::PlainObjectBase< DerivedD > &R)
 Given an input mesh and new positions find rotations for every covariance matrix in a stack of covariance matrices.
 
template<typename DerivedS , typename DerivedD >
void fit_rotations_planar (const Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedD > &R)
 Given an input mesh and new positions find 2D rotations for every vertex that best maps its one ring to the new one ring.
 
double flip_avoiding_line_search (const Eigen::MatrixXi &F, Eigen::MatrixXd &cur_v, const Eigen::MatrixXd &dst_v, std::function< double(Eigen::MatrixXd &)> &energy, double cur_energy=-1)
 A bisection line search for a mesh based energy that avoids triangle flips as suggested in "Bijective Parameterization with Free Boundaries" (Smith J.
 
template<typename DerivedF , typename DerivedE , typename DeriveduE , typename DerivedEMAP , typename uE2EType >
void flip_edge (Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DeriveduE > &uE, Eigen::PlainObjectBase< DerivedEMAP > &EMAP, std::vector< std::vector< uE2EType > > &uE2E, const size_t uei)
 Flip an edge in a triangle mesh.
 
template<typename DerivedV , typename DerivedF , typename DerivedX >
void flipped_triangles (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedX > &X)
 Finds the ids of the flipped triangles of the mesh V,F in the UV mapping uv.
 
template<typename Scalar , typename Index >
Eigen::VectorXi flipped_triangles (const Eigen::MatrixBase< Scalar > &V, const Eigen::MatrixBase< Index > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Derivedres , typename DerivedS >
void flood_fill (const Eigen::MatrixBase< Derivedres > &res, Eigen::PlainObjectBase< DerivedS > &S)
 Given a 3D array with sparse non-nan (number?) data fill in the NaNs via flood fill.
 
template<typename DerivedX , typename DerivedY >
void floor (const Eigen::PlainObjectBase< DerivedX > &X, Eigen::PlainObjectBase< DerivedY > &Y)
 Floor a given matrix to nearest integers.
 
template<typename AType , typename Func >
void for_each (const Eigen::SparseMatrix< AType > &A, const Func &func)
 FOR_EACH Call a given function for each non-zero (i.e., explicit value might actually be ==0) in a Sparse Matrix A in order (of storage).
 
template<typename DerivedA , typename Func >
void for_each (const Eigen::DenseBase< DerivedA > &A, const Func &func)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void forward_kinematics (const Eigen::MatrixXd &C, const Eigen::MatrixXi &BE, const Eigen::VectorXi &P, const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &dQ, const std::vector< Eigen::Vector3d > &dT, std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &vQ, std::vector< Eigen::Vector3d > &vT)
 Given a skeleton and a set of relative bone rotations compute absolute rigid transformations for each bone.
 
void forward_kinematics (const Eigen::MatrixXd &C, const Eigen::MatrixXi &BE, const Eigen::VectorXi &P, const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &dQ, std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &vQ, std::vector< Eigen::Vector3d > &vT)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void forward_kinematics (const Eigen::MatrixXd &C, const Eigen::MatrixXi &BE, const Eigen::VectorXi &P, const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &dQ, const std::vector< Eigen::Vector3d > &dT, Eigen::MatrixXd &T)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void forward_kinematics (const Eigen::MatrixXd &C, const Eigen::MatrixXi &BE, const Eigen::VectorXi &P, const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &dQ, Eigen::MatrixXd &T)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void frame_field_deformer (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::MatrixXd &FF1, const Eigen::MatrixXd &FF2, Eigen::MatrixXd &V_d, Eigen::MatrixXd &FF1_d, Eigen::MatrixXd &FF2_d, const int iterations=50, const double lambda=0.1, const bool perturb_initial_guess=true)
 Deform a mesh to transform the given per-face frame field to be as close as possible to a cross field, in the least square sense.
 
void frame_to_cross_field (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::MatrixXd &FF1, const Eigen::MatrixXd &FF2, Eigen::MatrixXd &X)
 Convert a frame field into its closest cross field.
 
template<typename DerivedP >
void frustum (const typename DerivedP::Scalar left, const typename DerivedP::Scalar right, const typename DerivedP::Scalar bottom, const typename DerivedP::Scalar top, const typename DerivedP::Scalar nearVal, const typename DerivedP::Scalar farVal, Eigen::PlainObjectBase< DerivedP > &P)
 Implementation of the deprecated glFrustum function.
 
template<typename DerivedV , typename DerivedF , typename DerivedK >
void gaussian_curvature (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedK > &K)
 Compute the 2π minus the sum of interior angles at each vertex.
 
DEFAULT_URBG generate_default_urbg ()
 
double get_seconds ()
 Current time in seconds.
 
template<typename DerivedV , typename DerivedF >
void grad (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< typename DerivedV::Scalar > &G, bool uniform=false)
 Gradient operator on a triangle mesh.
 
template<typename Derivedl , typename DerivedF , typename Gtype >
void grad_intrinsic (const Eigen::MatrixBase< Derivedl > &l, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< Gtype > &G)
 Construct an intrinsic gradient operator.
 
template<typename Derivedres , typename DerivedGV >
void grid (const Eigen::MatrixBase< Derivedres > &res, Eigen::PlainObjectBase< DerivedGV > &GV)
 Construct vertices of a regular grid, suitable for input to igl::marching_cubes
 
template<typename Scalar , typename DerivedX , typename DerivedLB , typename DerivedUB , typename DerivedI >
Scalar grid_search (const std::function< Scalar(DerivedX &) > f, const Eigen::MatrixBase< DerivedLB > &LB, const Eigen::MatrixBase< DerivedUB > &UB, const Eigen::MatrixBase< DerivedI > &I, DerivedX &X)
 Global optimization via grid search.
 
template<typename T >
void group_sum_matrix (const Eigen::Matrix< int, Eigen::Dynamic, 1 > &G, const int k, Eigen::SparseMatrix< T > &A)
 Builds a matrix A such that A*V computes the sum of vertices in each group specified by G.
 
template<typename T >
void group_sum_matrix (const Eigen::Matrix< int, Eigen::Dynamic, 1 > &G, Eigen::SparseMatrix< T > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void guess_extension (FILE *fp, std::string &guess)
 Given a file pointer at the beginning of a "mesh" file, try to guess the extension of the file format it comes from.
 
std::string guess_extension (FILE *fp)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedW >
bool harmonic (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< Derivedb > &b, const Eigen::MatrixBase< Derivedbc > &bc, const int k, Eigen::PlainObjectBase< DerivedW > &W)
 Compute k-harmonic weight functions "coordinates".
 
template<typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedW >
bool harmonic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< Derivedb > &b, const Eigen::MatrixBase< Derivedbc > &bc, const int k, Eigen::PlainObjectBase< DerivedW > &W)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedL , typename DerivedM , typename Derivedb , typename Derivedbc , typename DerivedW >
bool harmonic (const Eigen::SparseCompressedBase< DerivedL > &L, const Eigen::SparseCompressedBase< DerivedM > &M, const Eigen::MatrixBase< Derivedb > &b, const Eigen::MatrixBase< Derivedbc > &bc, const int k, Eigen::PlainObjectBase< DerivedW > &W)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Compute a harmonic map using a given Laplacian and mass matrix.
 
template<typename DerivedL , typename DerivedM , typename DerivedQ >
void harmonic (const Eigen::SparseCompressedBase< DerivedL > &L, const Eigen::SparseCompressedBase< DerivedM > &M, const int k, DerivedQ &Q)
 Build the discrete k-harmonic operator (computing integrated quantities).
 
template<typename DerivedV , typename DerivedF , typename DerivedQ >
void harmonic (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const int k, DerivedQ &Q)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename Index >
void harwell_boeing (const Eigen::SparseMatrix< Scalar > &A, int &num_rows, std::vector< Scalar > &V, std::vector< Index > &R, std::vector< Index > &C)
 Convert the matrix to Compressed sparse column (CSC or CCS) format, also known as Harwell Boeing format.
 
template<typename DerivedVA , typename DerivedFA , typename DerivedVB , typename DerivedFB , typename Scalar >
void hausdorff (const Eigen::MatrixBase< DerivedVA > &VA, const Eigen::MatrixBase< DerivedFA > &FA, const Eigen::MatrixBase< DerivedVB > &VB, const Eigen::MatrixBase< DerivedFB > &FB, Scalar &d)
 Compute the Hausdorff distance between mesh (VA,FA) and mesh (VB,FB).
 
template<typename DerivedV , typename Scalar >
void hausdorff (const Eigen::MatrixBase< DerivedV > &V, const std::function< Scalar(const Scalar &, const Scalar &, const Scalar &)> &dist_to_B, Scalar &l, Scalar &u)
 Compute lower and upper bounds (l,u) on the Hausdorff distance between a triangle (V) and a pointset (e.g., mesh, triangle soup) given by a distance function handle (dist_to_B).
 
template<typename DerivedV , typename DerivedF , typename Scalar >
bool heat_geodesics_precompute (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, HeatGeodesicsData< Scalar > &data)
 Precompute factorized solvers for computing a fast approximation of geodesic distances on a mesh (V,F).
 
template<typename DerivedV , typename DerivedF , typename Scalar >
bool heat_geodesics_precompute (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Scalar t, HeatGeodesicsData< Scalar > &data)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename Derivedgamma , typename DerivedD >
void heat_geodesics_solve (const HeatGeodesicsData< Scalar > &data, const Eigen::MatrixBase< Derivedgamma > &gamma, Eigen::PlainObjectBase< DerivedD > &D)
 Compute fast approximate geodesic distances using precomputed data from a set of selected source vertices (gamma).
 
template<typename DerivedV , typename DerivedF , typename Scalar >
void hessian (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< Scalar > &H)
 Constructs the finite element Hessian matrix as described in https://arxiv.org/abs/1707.04348, Natural Boundary Conditions for Smoothing in Geometry Processing (Oded Stein, Eitan Grinspun, Max Wardetzky, Alec Jacobson) The interior vertices are NOT set to zero yet.
 
template<typename DerivedV , typename DerivedF , typename Scalar >
void hessian_energy (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< Scalar > &Q)
 Constructs the Hessian energy matrix using mixed FEM as described in https://arxiv.org/abs/1707.04348 Natural Boundary Conditions for Smoothing in Geometry Processing (Oded Stein, Eitan Grinspun, Max Wardetzky, Alec Jacobson)
 
template<typename DerivedX , typename DerivedE , typename DerivedN , typename DerivedB >
void histc (const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedB > &B)
 Count occurrences of values in X between consecutive entries in E.
 
template<typename DerivedX , typename DerivedE , typename DerivedB >
void histc (const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedB > &B)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedE >
void histc (const typename DerivedE::Scalar &x, const Eigen::MatrixBase< DerivedE > &E, typename DerivedE::Index &b)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void hsv_to_rgb (const T *hsv, T *rgb)
 Convert RGB to HSV.
 
template<typename T >
void hsv_to_rgb (const T &h, const T &s, const T &v, T &r, T &g, T &b)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedH , typename DerivedR >
void hsv_to_rgb (const Eigen::PlainObjectBase< DerivedH > &H, Eigen::PlainObjectBase< DerivedR > &R)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
void icosahedron (Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 
template<typename DerivedV , typename DerivedQ , int DIM>
void in_element (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixXi &Ele, const Eigen::MatrixBase< DerivedQ > &Q, const AABB< DerivedV, DIM > &aabb, Eigen::VectorXi &I)
 Determine whether each point in a list of points is in the elements of a mesh.
 
template<typename DerivedV , typename DerivedQ , int DIM, typename Scalar >
void in_element (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixXi &Ele, const Eigen::MatrixBase< DerivedQ > &Q, const AABB< DerivedV, DIM > &aabb, Eigen::SparseMatrix< Scalar > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Derived >
void increment_ulp (Eigen::MatrixBase< Derived > &inout, int it)
 Increment Unit in Last Place of a matrix.
 
void infinite_cost_stopping_condition (const decimate_cost_and_placement_callback &cost_and_placement, decimate_stopping_condition_callback &stopping_condition)
 Stopping condition function compatible with igl::decimate.
 
decimate_stopping_condition_callback infinite_cost_stopping_condition (const decimate_cost_and_placement_callback &cost_and_placement)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedR >
void inradius (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedR > &R)
 Compute the inradius of each triangle in a mesh (V,F)
 
template<typename DerivedV , typename DerivedF , typename DerivedK >
void internal_angles (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedK > &K)
 Compute internal angles for a triangle mesh.
 
template<typename DerivedL , typename DerivedK >
void internal_angles_intrinsic (const Eigen::MatrixBase< DerivedL > &L_sq, Eigen::PlainObjectBase< DerivedK > &K)
 Compute internal angles for a triangle mesh.
 
template<class M >
void intersect (const M &A, const M &B, M &C)
 Determine the intersect between two sets of coefficients using ==.
 
template<class M >
intersect (const M &A, const M &B)
 overload
 
template<typename DerivedV , typename DerivedF , typename Scalar , typename Derivedl_intrinsic , typename DerivedF_intrinsic >
void intrinsic_delaunay_cotmatrix (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< Scalar > &L, Eigen::PlainObjectBase< Derivedl_intrinsic > &l_intrinsic, Eigen::PlainObjectBase< DerivedF_intrinsic > &F_intrinsic)
 Computes the discrete cotangent Laplacian of a mesh after converting it into its intrinsic Delaunay triangulation (see, e.g., [Fisher et al.
 
template<typename DerivedV , typename DerivedF , typename Scalar >
void intrinsic_delaunay_cotmatrix (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< Scalar > &L)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Derivedl_in , typename DerivedF_in , typename Derivedl , typename DerivedF >
void intrinsic_delaunay_triangulation (const Eigen::MatrixBase< Derivedl_in > &l_in, const Eigen::MatrixBase< DerivedF_in > &F_in, Eigen::PlainObjectBase< Derivedl > &l, Eigen::PlainObjectBase< DerivedF > &F)
 INTRINSIC_DELAUNAY_TRIANGULATION Flip edges intrinsically until all are "intrinsic Delaunay".
 
template<typename Derivedl_in , typename DerivedF_in , typename Derivedl , typename DerivedF , typename DerivedE , typename DeriveduE , typename DerivedEMAP , typename uE2EType >
void intrinsic_delaunay_triangulation (const Eigen::MatrixBase< Derivedl_in > &l_in, const Eigen::MatrixBase< DerivedF_in > &F_in, Eigen::PlainObjectBase< Derivedl > &l, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DeriveduE > &uE, Eigen::PlainObjectBase< DerivedEMAP > &EMAP, std::vector< std::vector< uE2EType > > &uE2E)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename MatY >
void invert_diag (const Eigen::SparseCompressedBase< DerivedX > &X, MatY &Y)
 Invert the diagonal entries of a matrix (if the matrix is a diagonal matrix then this amounts to inverting the matrix)
 
template<typename DerivedF >
std::vector< bool > is_border_vertex (const Eigen::MatrixBase< DerivedF > &F)
 Determine vertices on open boundary of a (manifold) mesh with triangle faces F.
 
template<typename DerivedF , typename DerivedE , typename DerivedB >
void is_boundary_edge (const Eigen::PlainObjectBase< DerivedE > &E, const Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedB > &B)
 Determine for each edge E if it is a "boundary edge" in F.
 
template<typename DerivedF , typename DerivedE , typename DerivedB , typename DerivedEMAP >
void is_boundary_edge (const Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedEMAP > &EMAP)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedD >
void is_delaunay (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedD > &D)
 IDetermine if each edge in the mesh (V,F) is Delaunay.
 
template<typename DerivedV , typename DerivedF , typename uE2EType , typename InCircle , typename ueiType >
bool is_delaunay (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const std::vector< std::vector< uE2EType > > &uE2E, const InCircle incircle, const ueiType uei)
 Determine whether a single edge is Delaunay using a provided (extrinsic) incirle test.
 
bool is_dir (const char *filename)
 Tells whether the given filename is a directory.
 
template<typename DerivedF >
bool is_edge_manifold (const Eigen::MatrixBase< DerivedF > &F)
 Check if the mesh is edge-manifold (every edge is incident one one face (boundary) or two oppositely oriented faces).
 
template<typename DerivedF , typename DerivedBF , typename DerivedE , typename DerivedEMAP , typename DerivedBE >
bool is_edge_manifold (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedBF > &BF, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedEMAP > &EMAP, Eigen::PlainObjectBase< DerivedBE > &BE)
 Checks if mesh is edge-manifold and outputs per-edge info.
 
template<typename DerivedF , typename DerivedEMAP , typename DerivedBF , typename DerivedBE >
bool is_edge_manifold (const Eigen::MatrixBase< DerivedF > &F, const typename DerivedF::Index ne, const Eigen::MatrixBase< DerivedEMAP > &EMAP, Eigen::PlainObjectBase< DerivedBF > &BF, Eigen::PlainObjectBase< DerivedBE > &BE)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool is_file (const char *filename)
 Tells whether the given filename is a regular file.
 
template<typename Derivedl , typename DerivedF , typename DerivedD >
void is_intrinsic_delaunay (const Eigen::MatrixBase< Derivedl > &l, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedD > &D)
 Determine if each edge in the mesh (V,F) is Delaunay.
 
template<typename Derivedl , typename DerivedF , typename uE2EType , typename DerivedD >
void is_intrinsic_delaunay (const Eigen::MatrixBase< Derivedl > &l, const Eigen::MatrixBase< DerivedF > &F, const std::vector< std::vector< uE2EType > > &uE2E, Eigen::PlainObjectBase< DerivedD > &D)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Derivedl , typename uE2EType , typename Index >
bool is_intrinsic_delaunay (const Eigen::MatrixBase< Derivedl > &l, const std::vector< std::vector< uE2EType > > &uE2E, const Index num_faces, const Index uei)
 Determine whether a single edge is Delaunay using a provided (extrinsic) incirle test.
 
template<typename DerivedF >
std::vector< bool > is_irregular_vertex (const Eigen::MatrixBase< DerivedF > &F)
 Determine if a vertex is irregular, i.e.
 
bool is_planar (const Eigen::MatrixXd &V)
 Determine if a set of points lies on the XY plane.
 
bool is_readable (const char *filename)
 Check if a file is reabable like PHP's is_readable function: http://www.php.net/manual/en/function.is-readable.php.
 
template<typename T >
bool is_sparse (const Eigen::SparseMatrix< T > &A)
 Determine if a matrix A is sparse.
 
template<typename DerivedA >
bool is_sparse (const Eigen::PlainObjectBase< DerivedA > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool is_stl (FILE *stl_file, bool &is_ascii)
 Given a file pointer, determine if it contains an .stl file and then rewind it.
 
bool is_stl (FILE *stl_file)
 
template<typename AT >
bool is_symmetric (const Eigen::SparseMatrix< AT > &A)
 Returns true if the given matrix is symmetric.
 
template<typename AT , typename epsilonT >
bool is_symmetric (const Eigen::SparseMatrix< AT > &A, const epsilonT epsilon)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA >
bool is_symmetric (const Eigen::PlainObjectBase< DerivedA > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedB >
bool is_vertex_manifold (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedB > &B)
 Check if a mesh is vertex-manifold.
 
template<typename DerivedF >
bool is_vertex_manifold (const Eigen::MatrixBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool is_writable (const char *filename)
 Check if a file exists and is writable like PHP's is_writable function: http://www.php.net/manual/en/function.is-writable.php.
 
template<typename Derived >
bool isdiag (const Eigen::SparseCompressedBase< Derived > &A)
 Determine if a given matrix is diagonal: all non-zeros lie on the main diagonal.
 
template<typename DerivedA , typename DerivedB , typename DerivedIA , typename DerivedLOCB >
void ismember (const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedIA > &IA, Eigen::PlainObjectBase< DerivedLOCB > &LOCB)
 Determine if elements of A exist in elements of B.
 
template<typename DerivedA , typename DerivedB , typename DerivedIA , typename DerivedLOCB >
void ismember_rows (const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedIA > &IA, Eigen::PlainObjectBase< DerivedLOCB > &LOCB)
 Determine if row of A exist in rows of B.
 
template<typename DerivedV , typename DerivedF , typename DerivedS , typename Derivedvals , typename DerivediV , typename DerivediE , typename DerivedI >
void isolines (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedS > &S, const Eigen::MatrixBase< Derivedvals > &vals, Eigen::PlainObjectBase< DerivediV > &iV, Eigen::PlainObjectBase< DerivediE > &iE, Eigen::PlainObjectBase< DerivedI > &I)
 Compute isolines of a scalar field on a triangle mesh.
 
template<typename DerivedF , typename DerivedS , typename Derivedvals , typename DerivediB , typename DerivediFI , typename DerivediE , typename DerivedI >
void isolines_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedS > &S, const Eigen::MatrixBase< Derivedvals > &vals, Eigen::PlainObjectBase< DerivediB > &iB, Eigen::PlainObjectBase< DerivediFI > &iFI, Eigen::PlainObjectBase< DerivediE > &iE, Eigen::PlainObjectBase< DerivedI > &I)
 Compute isolines of a scalar field on a triangle mesh intrinsically.
 
template<typename DerivedF , typename DerivedS , typename DeriveduE , typename DerivedEMAP , typename DeriveduEC , typename DeriveduEE , typename DerivediB , typename DerivediFI , typename DerivediE >
void isolines_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedS > &S, const Eigen::MatrixBase< DeriveduE > &uE, const Eigen::MatrixBase< DerivedEMAP > &EMAP, const Eigen::MatrixBase< DeriveduEC > &uEC, const Eigen::MatrixBase< DeriveduEE > &uEE, const typename DerivedS::Scalar val, Eigen::PlainObjectBase< DerivediB > &iB, Eigen::PlainObjectBase< DerivediFI > &iFI, Eigen::PlainObjectBase< DerivediE > &iE)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedCM , typename Derivediso_color , typename DerivedICM >
void isolines_map (const Eigen::MatrixBase< DerivedCM > &CM, const Eigen::MatrixBase< Derivediso_color > &iso_color, const int interval_thickness, const int iso_thickness, Eigen::PlainObjectBase< DerivedICM > &ICM)
 Inject a given colormap with evenly spaced isolines.
 
template<typename DerivedCM , typename DerivedICM >
void isolines_map (const Eigen::MatrixBase< DerivedCM > &CM, Eigen::PlainObjectBase< DerivedICM > &ICM)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedVX , typename DerivedFX , typename DerivedVY , typename DerivedFY , typename DerivedR , typename Derivedt >
void iterative_closest_point (const Eigen::MatrixBase< DerivedVX > &VX, const Eigen::MatrixBase< DerivedFX > &FX, const Eigen::MatrixBase< DerivedVY > &VY, const Eigen::MatrixBase< DerivedFY > &FY, const int num_samples, const int max_iters, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< Derivedt > &t)
 Solve for the rigid transformation that places mesh X onto mesh Y using the iterative closest point method.
 
template<typename DerivedVX , typename DerivedFX , typename DerivedVY , typename DerivedFY , typename DerivedNY , typename DerivedR , typename Derivedt >
void iterative_closest_point (const Eigen::MatrixBase< DerivedVX > &VX, const Eigen::MatrixBase< DerivedFX > &FX, const Eigen::MatrixBase< DerivedVY > &VY, const Eigen::MatrixBase< DerivedFY > &FY, const igl::AABB< DerivedVY, 3 > &Ytree, const Eigen::MatrixBase< DerivedNY > &NY, const int num_samples, const int max_iters, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< Derivedt > &t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void jet (const T f, T *rgb)
 Jet colormap like MATLAB's jet.
 
template<typename T >
void jet (const T f, T &r, T &g, T &b)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedZ , typename DerivedC >
void jet (const Eigen::MatrixBase< DerivedZ > &Z, const bool normalize, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedZ , typename DerivedC >
void jet (const Eigen::MatrixBase< DerivedZ > &Z, const double min_Z, const double max_Z, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename Derivedx0 , typename Derivedf , typename DerivedF , typename DerivedU >
void kelvinlets (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< Derivedx0 > &x0, const Eigen::MatrixBase< Derivedf > &f, const Eigen::MatrixBase< DerivedF > &F, const KelvinletParams< typename DerivedV::Scalar > &params, Eigen::PlainObjectBase< DerivedU > &U)
 Implements Pixar's Regularized Kelvinlets (Pixar Technical Memo #17-03): Sculpting Brushes based on Fundamental Solutions of Elasticity, a technique for real-time physically based volume sculpting of virtual elastic materials.
 
template<typename T >
void kkt_inverse (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &A, const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &Aeq, const bool use_lu_decomposition, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &S)
 Constructs the inverse of the KKT matrix of a convex, linear equality constrained quadratic minimization problem.
 
template<typename DerivedP , typename IndexType , typename DerivedCH , typename DerivedCN , typename DerivedW , typename DerivedI >
void knn (const Eigen::MatrixBase< DerivedP > &P, size_t k, const std::vector< std::vector< IndexType > > &point_indices, const Eigen::MatrixBase< DerivedCH > &CH, const Eigen::MatrixBase< DerivedCN > &CN, const Eigen::MatrixBase< DerivedW > &W, Eigen::PlainObjectBase< DerivedI > &I)
 Given a 3D set of points P, an whole number k, and an octree find the indicies of the k nearest neighbors for each point in P.
 
template<typename DerivedP , typename DerivedV , typename IndexType , typename DerivedCH , typename DerivedCN , typename DerivedW , typename DerivedI >
void knn (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedV > &V, size_t k, const std::vector< std::vector< IndexType > > &point_indices, const Eigen::MatrixBase< DerivedCH > &CH, const Eigen::MatrixBase< DerivedCN > &CN, const Eigen::MatrixBase< DerivedW > &W, Eigen::PlainObjectBase< DerivedI > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedT , typename DerivedF >
int launch_medit (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedT > &T, const Eigen::PlainObjectBase< DerivedF > &F, const bool wait)
 Writes the tetmesh in (V,T,F) to a temporary file, opens it with medit (forking with a system call) and returns.
 
void lbs_matrix (const Eigen::MatrixXd &V, const Eigen::MatrixXd &W, Eigen::MatrixXd &M)
 Linear blend skinning can be expressed by V' = M * T where V' is a #V by dim matrix of deformed vertex positions (one vertex per row), M is a #V by (dim+1)*#T (composed of weights and rest positions) and T is a #T*(dim+1) by dim matrix of #T stacked transposed transformation matrices.
 
void lbs_matrix_column (const Eigen::MatrixXd &V, const Eigen::MatrixXd &W, Eigen::SparseMatrix< double > &M)
 Construct a matrix that when multiplied against a column of affine transformation entries computes new coordinates of the vertices.
 
void lbs_matrix_column (const Eigen::MatrixXd &V, const Eigen::MatrixXd &W, Eigen::MatrixXd &M)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void lbs_matrix_column (const Eigen::MatrixXd &V, const Eigen::MatrixXd &W, const Eigen::MatrixXi &WI, Eigen::SparseMatrix< double > &M)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void lbs_matrix_column (const Eigen::MatrixXd &V, const Eigen::MatrixXd &W, const Eigen::MatrixXi &WI, Eigen::MatrixXd &M)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedP , typename Orient2D , typename DerivedF >
void lexicographic_triangulation (const Eigen::MatrixBase< DerivedP > &P, Orient2D orient2D, Eigen::PlainObjectBase< DerivedF > &F)
 Given a set of points in 2D, return a lexicographic triangulation of these points.
 
template<typename MatF , typename VecL >
void limit_faces (const MatF &F, const VecL &L, const bool exclusive, MatF &LF)
 Limit given faces F to those which contain (only) indices found in L.
 
template<typename DerivedV , typename DerivedF , typename DerivedO >
void line_field_mismatch (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedV > &PD1, const bool isCombed, Eigen::PlainObjectBase< DerivedO > &mismatch)
 Calculates the mismatch (integer), at each face edge, of a cross field defined on the mesh faces.
 
double line_search (Eigen::MatrixXd &x, const Eigen::MatrixXd &d, double i_step_size, std::function< double(Eigen::MatrixXd &)> energy, double cur_energy=-1)
 Implement a bisection linesearch to minimize a mesh-based energy on vertices given at 'x' at a search direction 'd', with initial step size.
 
bool line_segment_in_rectangle (const Eigen::Vector2d &s, const Eigen::Vector2d &d, const Eigen::Vector2d &A, const Eigen::Vector2d &B)
 Determine whether a line segment overlaps with a rectangle.
 
bool linprog (const Eigen::VectorXd &c, const Eigen::MatrixXd &A, const Eigen::VectorXd &b, const int k, Eigen::VectorXd &x)
 Solve a linear program given in "standard form".
 
bool linprog (const Eigen::VectorXd &f, const Eigen::MatrixXd &A, const Eigen::VectorXd &b, const Eigen::MatrixXd &B, const Eigen::VectorXd &c, Eigen::VectorXd &x)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Derived >
Derived LinSpaced (typename Derived::Index size, const typename Derived::Scalar &low, const typename Derived::Scalar &high)
 Replacement for Eigen::DenseBase::LinSpaced.
 
template<typename T , typename Derived >
bool list_to_matrix (const std::vector< std::vector< T > > &V, Eigen::PlainObjectBase< Derived > &M)
 Convert a list (std::vector) of row vectors of the same length to a matrix.
 
template<typename T , size_t N, typename Derived >
bool list_to_matrix (const std::vector< std::array< T, N > > &V, Eigen::PlainObjectBase< Derived > &M)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , typename Derived >
bool list_to_matrix (const std::vector< T > &V, Eigen::PlainObjectBase< Derived > &M)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , typename Derived >
bool list_to_matrix (const std::vector< std::vector< T > > &V, const int n, const T &padding, Eigen::PlainObjectBase< Derived > &M)
 Convert a list of row vectors of n or less to a matrix and pad on the right with padding.
 
template<typename DerivedV , typename DerivedF >
void local_basis (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedV > &B1, Eigen::PlainObjectBase< DerivedV > &B2, Eigen::PlainObjectBase< DerivedV > &B3)
 Compute a local orthogonal reference system for each triangle in the given mesh.
 
template<typename Derivedeye , typename Derivedcenter , typename Derivedup , typename DerivedR >
void look_at (const Eigen::PlainObjectBase< Derivedeye > &eye, const Eigen::PlainObjectBase< Derivedcenter > &center, const Eigen::PlainObjectBase< Derivedup > &up, Eigen::PlainObjectBase< DerivedR > &R)
 Implementation of the deprecated gluLookAt function.
 
template<typename DerivedF , typename SType , typename DerivedNF >
void loop (const int n_verts, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< SType > &S, Eigen::PlainObjectBase< DerivedNF > &NF)
 Given the triangle mesh [V, F], where n_verts = V.rows(), computes newV and a sparse matrix S s.t.
 
template<typename DerivedV , typename DerivedF , typename DerivedNV , typename DerivedNF >
void loop (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedNV > &NV, Eigen::PlainObjectBase< DerivedNF > &NF, const int number_of_subdivs=1)
 Given the triangle mesh [V, F], computes number_of_subdivs steps of loop subdivision and outputs the new mesh [newV, newF].
 
template<typename DerivedV , typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedV_uv , typename QScalar >
bool lscm (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< Derivedb > &b, const Eigen::MatrixBase< Derivedbc > &bc, Eigen::PlainObjectBase< DerivedV_uv > &V_uv, Eigen::SparseMatrix< QScalar > &Q)
 Compute a Least-squares conformal map parametrization (equivalently derived in "Intrinsic Parameterizations of Surface Meshes" [Desbrun et al.
 
template<typename DerivedV , typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedV_uv >
bool lscm (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< Derivedb > &b, const Eigen::MatrixBase< Derivedbc > &bc, Eigen::PlainObjectBase< DerivedV_uv > &V_uv)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedV_uv >
bool lscm (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedV_uv > &V_uv)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename QScalar >
void lscm_hessian (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< QScalar > &Q)
 Compute a Least-squares conformal map parametrization (equivalently derived in "Intrinsic Parameterizations of Surface Meshes" [Desbrun et al.
 
void map_vertices_to_circle (const Eigen::MatrixXd &V, const Eigen::VectorXi &bnd, Eigen::MatrixXd &UV)
 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.
 
double mapping_energy_with_jacobians (const Eigen::MatrixXd &Ji, const Eigen::VectorXd &areas, igl::MappingEnergyType slim_energy, double exp_factor)
 Compute the rotation-invariant energy of a mapping (represented in Jacobians and areas)
 
template<typename DerivedGV , typename Scalar , typename Index , typename DerivedV , typename DerivedF >
void march_cube (const DerivedGV &GV, const Eigen::Matrix< Scalar, 8, 1 > &cS, const Eigen::Matrix< Index, 8, 1 > &cI, const Scalar &isovalue, Eigen::PlainObjectBase< DerivedV > &V, Index &n, Eigen::PlainObjectBase< DerivedF > &F, Index &m, std::unordered_map< int64_t, int > &E2V)
 Process a single cube of a marching cubes grid.
 
template<typename DerivedS , typename DerivedGV , typename DerivedV , typename DerivedF >
void marching_cubes (const Eigen::MatrixBase< DerivedS > &S, const Eigen::MatrixBase< DerivedGV > &GV, const unsigned nx, const unsigned ny, const unsigned nz, const typename DerivedS::Scalar isovalue, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 Performs marching cubes reconstruction on a grid defined by values, and points, and generates a mesh defined by vertices and faces.
 
template<typename DerivedS , typename DerivedGV , typename DerivedGI , typename DerivedV , typename DerivedF >
void marching_cubes (const Eigen::MatrixBase< DerivedS > &S, const Eigen::MatrixBase< DerivedGV > &GV, const Eigen::MatrixBase< DerivedGI > &GI, const typename DerivedS::Scalar isovalue, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedTV , typename DerivedTT , typename DerivedS , typename DerivedSV , typename DerivedSF , typename DerivedJ , typename BCType >
void marching_tets (const Eigen::MatrixBase< DerivedTV > &TV, const Eigen::MatrixBase< DerivedTT > &TT, const Eigen::MatrixBase< DerivedS > &S, const typename DerivedS::Scalar isovalue, Eigen::PlainObjectBase< DerivedSV > &SV, Eigen::PlainObjectBase< DerivedSF > &SF, Eigen::PlainObjectBase< DerivedJ > &J, Eigen::SparseMatrix< BCType > &BC)
 Performs the marching tetrahedra algorithm on a tet mesh defined by TV and TT with scalar values defined at each vertex in TV.
 
template<typename DerivedTV , typename DerivedTT , typename DerivedS , typename DerivedSV , typename DerivedSF , typename DerivedJ , typename BCType >
void marching_tets (const Eigen::MatrixBase< DerivedTV > &TV, const Eigen::MatrixBase< DerivedTT > &TT, const Eigen::MatrixBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedSV > &SV, Eigen::PlainObjectBase< DerivedSF > &SF, Eigen::PlainObjectBase< DerivedJ > &J, Eigen::SparseMatrix< BCType > &BC)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedTV , typename DerivedTT , typename DerivedS , typename DerivedSV , typename DerivedSF , typename DerivedJ >
void marching_tets (const Eigen::MatrixBase< DerivedTV > &TV, const Eigen::MatrixBase< DerivedTT > &TT, const Eigen::MatrixBase< DerivedS > &S, const typename DerivedS::Scalar isovalue, Eigen::PlainObjectBase< DerivedSV > &SV, Eigen::PlainObjectBase< DerivedSF > &SF, Eigen::PlainObjectBase< DerivedJ > &J)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedTV , typename DerivedTT , typename DerivedS , typename DerivedSV , typename DerivedSF , typename BCType >
void marching_tets (const Eigen::MatrixBase< DerivedTV > &TV, const Eigen::MatrixBase< DerivedTT > &TT, const Eigen::MatrixBase< DerivedS > &S, const typename DerivedS::Scalar isovalue, Eigen::PlainObjectBase< DerivedSV > &SV, Eigen::PlainObjectBase< DerivedSF > &SF, Eigen::SparseMatrix< BCType > &BC)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedTV , typename DerivedTT , typename DerivedS , typename DerivedSV , typename DerivedSF >
void marching_tets (const Eigen::MatrixBase< DerivedTV > &TV, const Eigen::MatrixBase< DerivedTT > &TT, const Eigen::MatrixBase< DerivedS > &S, const typename DerivedS::Scalar isovalue, Eigen::PlainObjectBase< DerivedSV > &SV, Eigen::PlainObjectBase< DerivedSF > &SF)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename Scalar >
void massmatrix (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const MassMatrixType type, Eigen::SparseMatrix< Scalar > &M)
 Constructs the mass (area) matrix for a given mesh (V,F).
 
template<typename Derivedl , typename DerivedF , typename Scalar >
void massmatrix_intrinsic (const Eigen::MatrixBase< Derivedl > &l, const Eigen::MatrixBase< DerivedF > &F, const MassMatrixType type, Eigen::SparseMatrix< Scalar > &M)
 Constructs the mass (area) matrix for a given mesh (V,F).
 
template<typename Derivedl , typename DerivedF , typename Scalar >
void massmatrix_intrinsic (const Eigen::MatrixBase< Derivedl > &l, const Eigen::MatrixBase< DerivedF > &F, const MassMatrixType type, const int n, Eigen::SparseMatrix< Scalar > &M)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Q_type >
void mat4_to_quat (const Q_type *m, Q_type *q)
 Convert a OpenGL (rotation) matrix to a quaternion.
 
template<typename Q_type >
void mat3_to_quat (const Q_type *m, Q_type *q)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const Eigen::Vector4f MAYA_GREEN (128./255., 242./255., 0./255., 1.)
 
const Eigen::Vector4f MAYA_YELLOW (255./255., 247./255., 50./255., 1.)
 
const Eigen::Vector4f MAYA_RED (234./255., 63./255., 52./255., 1.)
 
const Eigen::Vector4f MAYA_BLUE (0./255., 73./255., 252./255., 1.)
 
const Eigen::Vector4f MAYA_PURPLE (180./255., 73./255., 200./255., 1.)
 
const Eigen::Vector4f MAYA_VIOLET (31./255., 15./255., 66./255., 1.)
 
const Eigen::Vector4f MAYA_GREY (0.5, 0.5, 0.5, 1.0)
 
const Eigen::Vector4f MAYA_CYAN (131./255., 219./255., 252./255., 1.)
 
const Eigen::Vector4f MAYA_SEA_GREEN (70./255., 252./255., 167./255., 1.)
 
template<typename DerivedM >
const Eigen::WithFormat< DerivedM > matlab_format (const Eigen::DenseBase< DerivedM > &M, const std::string name="")
 This is a routine to print a matrix using format suitable for pasting into the matlab IDE.
 
template<typename DerivedM >
std::string matlab_format_index (const Eigen::MatrixBase< DerivedM > &M, const std::string name="")
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedS >
const std::string matlab_format (const Eigen::SparseMatrix< DerivedS > &S, const std::string name="")
 Same but for sparse matrices.
 
const std::string matlab_format (const double v, const std::string name="")
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const std::string matlab_format (const float v, const std::string name="")
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Eigen::IOFormat matlab_format ()
 Just build and return the format.
 
template<typename DerivedM >
void matrix_to_list (const Eigen::MatrixBase< DerivedM > &M, std::vector< std::vector< typename DerivedM::Scalar > > &V)
 Convert a matrix to a list (std::vector) of row vectors of the same size.
 
template<typename DerivedM >
void matrix_to_list (const Eigen::MatrixBase< DerivedM > &M, std::vector< typename DerivedM::Scalar > &V)
 Convert a matrix to a list (std::vector) of elements in column-major ordering.
 
template<typename DerivedM >
std::vector< typename DerivedM::Scalar > matrix_to_list (const Eigen::MatrixBase< DerivedM > &M)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename AType , typename DerivedB , typename DerivedI >
void max (const Eigen::SparseMatrix< AType > &A, const int dim, Eigen::PlainObjectBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedI > &I)
 Compute the maximum along dimension dim of a matrix X.
 
template<typename DerivedX , typename DerivedY , typename DerivedI >
void max (const Eigen::DenseBase< DerivedX > &X, const int dim, Eigen::PlainObjectBase< DerivedY > &Y, Eigen::PlainObjectBase< DerivedI > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void max_faces_stopping_condition (int &m, const int orig_m, const int max_m, decimate_stopping_condition_callback &stopping_condition)
 Stopping condition function compatible with igl::decimate.
 
decimate_stopping_condition_callback max_faces_stopping_condition (int &m, const int orign_m, const int max_m)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
int max_size (const std::vector< T > &V)
 Determine max size of lists in a vector.
 
template<typename DerivedV , typename mType >
bool median (const Eigen::MatrixBase< DerivedV > &V, mType &m)
 Compute the median of an eigen vector.
 
template<typename AType , typename DerivedB , typename DerivedI >
void min (const Eigen::SparseMatrix< AType > &A, const int dim, Eigen::PlainObjectBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedI > &I)
 Compute the minimum along dimension dim of a matrix X.
 
template<typename DerivedX , typename DerivedY , typename DerivedI >
void min (const Eigen::DenseBase< DerivedX > &X, const int dim, Eigen::PlainObjectBase< DerivedY > &Y, Eigen::PlainObjectBase< DerivedI > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , typename Derivedknown >
bool min_quad_with_fixed_precompute (const Eigen::SparseMatrix< T > &A, const Eigen::MatrixBase< Derivedknown > &known, const Eigen::SparseMatrix< T > &Aeq, const bool pd, min_quad_with_fixed_data< T > &data)
 Minimize a convex quadratic energy subject to fixed value and linear equality constraints.
 
template<typename T , typename DerivedB , typename DerivedY , typename DerivedBeq , typename DerivedZ , typename Derivedsol >
bool min_quad_with_fixed_solve (const min_quad_with_fixed_data< T > &data, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< DerivedY > &Y, const Eigen::MatrixBase< DerivedBeq > &Beq, Eigen::PlainObjectBase< DerivedZ > &Z, Eigen::PlainObjectBase< Derivedsol > &sol)
 Solves a system previously factored using min_quad_with_fixed_precompute.
 
template<typename T , typename DerivedB , typename DerivedY , typename DerivedBeq , typename DerivedZ >
bool min_quad_with_fixed_solve (const min_quad_with_fixed_data< T > &data, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< DerivedY > &Y, const Eigen::MatrixBase< DerivedBeq > &Beq, Eigen::PlainObjectBase< DerivedZ > &Z)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , typename Derivedknown , typename DerivedB , typename DerivedY , typename DerivedBeq , typename DerivedZ >
bool min_quad_with_fixed (const Eigen::SparseMatrix< T > &A, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< Derivedknown > &known, const Eigen::MatrixBase< DerivedY > &Y, const Eigen::SparseMatrix< T > &Aeq, const Eigen::MatrixBase< DerivedBeq > &Beq, const bool pd, Eigen::PlainObjectBase< DerivedZ > &Z)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , int n, int m, bool Hpd = true>
Eigen::Matrix< Scalar, n, 1 > min_quad_with_fixed (const Eigen::Matrix< Scalar, n, n > &H, const Eigen::Matrix< Scalar, n, 1 > &f, const Eigen::Array< bool, n, 1 > &k, const Eigen::Matrix< Scalar, n, 1 > &bc, const Eigen::Matrix< Scalar, m, n > &A, const Eigen::Matrix< Scalar, m, 1 > &b)
 Dense version optimized for very small, known at compile time sizes.
 
template<typename Scalar , int n, bool Hpd = true>
Eigen::Matrix< Scalar, n, 1 > min_quad_with_fixed (const Eigen::Matrix< Scalar, n, n > &H, const Eigen::Matrix< Scalar, n, 1 > &f, const Eigen::Array< bool, n, 1 > &k, const Eigen::Matrix< Scalar, n, 1 > &bc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , int n, int kcount, bool Hpd>
Eigen::Matrix< Scalar, n, 1 > min_quad_with_fixed (const Eigen::Matrix< Scalar, n, n > &H, const Eigen::Matrix< Scalar, n, 1 > &f, const Eigen::Array< bool, n, 1 > &k, const Eigen::Matrix< Scalar, n, 1 > &bc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
int min_size (const std::vector< T > &V)
 Determine min size of lists in a vector.
 
template<typename DerivedA , typename DerivedB >
void mod (const Eigen::PlainObjectBase< DerivedA > &A, const int base, Eigen::PlainObjectBase< DerivedB > &B)
 Compute elementwise mod: B = A % base.
 
template<typename DerivedA >
DerivedA mod (const Eigen::PlainObjectBase< DerivedA > &A, const int base)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void mode (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &X, const int d, Eigen::Matrix< T, Eigen::Dynamic, 1 > &M)
 Takes mode of coefficients in a matrix along a given dimension.
 
template<typename DerivedV , typename DerivedF , typename Derivedm0 , typename Derivedm1 , typename Derivedm2 >
void moments (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Derivedm0 &m0, Eigen::PlainObjectBase< Derivedm1 > &m1, Eigen::PlainObjectBase< Derivedm2 > &m2)
 Computes the moments of mass for a solid object bound by a triangle mesh.
 
void mvc (const Eigen::MatrixXd &V, const Eigen::MatrixXd &C, Eigen::MatrixXd &W)
 Mean value coordinates for a polygon.
 
double nchoosek (const int n, const int k)
 Binomial coefficient.
 
template<typename DerivedV , typename DerivedU >
void nchoosek (const Eigen::MatrixBase< DerivedV > &V, const int k, Eigen::PlainObjectBase< DerivedU > &U)
 All combinations .
 
bool next_filename (const std::string &prefix, const int zeros, const std::string &suffix, std::string &next)
 Find the file with the first filename of the form "prefix%0[zeros]dsuffix".
 
template<typename DerivedV , typename DerivedEle , typename Scalar >
void normal_derivative (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, Eigen::SparseMatrix< Scalar > &DD)
 Computes the directional derivative normal to all (half-)edges of a triangle mesh (not just boundary edges).
 
template<typename Q_type >
bool normalize_quat (const Q_type *q, Q_type *out)
 Normalize a quaternion A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.
 
template<typename DerivedA , typename DerivedN >
void null (const Eigen::PlainObjectBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedN > &N)
 Compute a basis for the null space for the given matrix A: the columns of the output N form a basis for the space orthogonal to that spanned by the rows of A.
 
template<typename DerivedP , typename IndexType , typename DerivedCH , typename DerivedCN , typename DerivedW >
void octree (const Eigen::MatrixBase< DerivedP > &P, std::vector< std::vector< IndexType > > &point_indices, Eigen::PlainObjectBase< DerivedCH > &CH, Eigen::PlainObjectBase< DerivedCN > &CN, Eigen::PlainObjectBase< DerivedW > &W)
 Given a set of 3D points P, generate data structures for a pointerless octree.
 
template<typename DerivedV , typename DerivedF , typename isolevelType , typename DerivedSV , typename DerivedSF , typename DerivedGV , typename Derivedside , typename DerivedS >
void offset_surface (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const isolevelType isolevel, const typename Derivedside::Scalar s, const SignedDistanceType &signed_distance_type, Eigen::PlainObjectBase< DerivedSV > &SV, Eigen::PlainObjectBase< DerivedSF > &SF, Eigen::PlainObjectBase< DerivedGV > &GV, Eigen::PlainObjectBase< Derivedside > &side, Eigen::PlainObjectBase< DerivedS > &S)
 Compute a triangulated offset surface using matching cubes on a grid of signed distance values from the input triangle mesh.
 
template<typename IntegerT >
void on_boundary (const std::vector< std::vector< IntegerT > > &T, std::vector< bool > &I, std::vector< std::vector< bool > > &C)
 Determine boundary facets of mesh elements stored in T.
 
template<typename DerivedT , typename DerivedI , typename DerivedC >
void on_boundary (const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedE , typename DerivedOE >
void orient_halfedges (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedOE > &oE)
 Orients halfedges for a triangle mesh, assigning them to a unique edge.
 
template<typename DerivedV , typename DerivedF , typename DerivedC , typename DerivedFF , typename DerivedI >
void orient_outward (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedFF > &FF, Eigen::PlainObjectBase< DerivedI > &I)
 Orient each component (identified by C) of a mesh (V,F) so the normals on average point away from the patch's centroid.
 
template<typename DerivedF , typename DerivedC , typename AScalar >
void orientable_patches (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedC > &C, Eigen::SparseMatrix< AScalar > &A)
 Compute connected components of facets connected by manifold edges.
 
template<typename DerivedF , typename DerivedC >
void orientable_patches (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedE >
void oriented_facets (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E)
 Determines all "directed [facets](https://en.wikipedia.org/wiki/Simplex#Elements)" of a given set of simplicial elements.
 
void orth (const Eigen::MatrixXd &A, Eigen::MatrixXd &Q)
 Orthogonalization of a matrix.
 
template<typename DerivedP >
void ortho (const typename DerivedP::Scalar left, const typename DerivedP::Scalar right, const typename DerivedP::Scalar bottom, const typename DerivedP::Scalar top, const typename DerivedP::Scalar nearVal, const typename DerivedP::Scalar farVal, Eigen::PlainObjectBase< DerivedP > &P)
 Implementation of the deprecated glOrtho function.
 
template<typename DerivedV , typename DerivedF , typename DerivedI , typename IndexType , typename DerivedA >
void outer_vertex (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedI > &I, IndexType &v_index, Eigen::PlainObjectBase< DerivedA > &A)
 Find a vertex that is reachable from infinite without crossing any faces.
 
template<typename DerivedV , typename DerivedF , typename DerivedI , typename IndexType , typename DerivedA >
void outer_edge (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedI > &I, IndexType &v1, IndexType &v2, Eigen::PlainObjectBase< DerivedA > &A)
 Find an edge that is reachable from infinity without crossing any faces.
 
template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedI , typename IndexType >
void outer_facet (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedI > &I, IndexType &f, bool &flipped)
 Find a facet that is reachable from infinity without crossing any faces.
 
template<typename Index , typename FunctionType >
bool parallel_for (const Index loop_size, const FunctionType &func, const size_t min_parallel=0)
 Functional implementation of a basic, open-mp style, parallel for loop.
 
template<typename Index , typename PrepFunctionType , typename FunctionType , typename AccumFunctionType >
bool parallel_for (const Index loop_size, const PrepFunctionType &prep_func, const FunctionType &func, const AccumFunctionType &accum_func, const size_t min_parallel=0)
 Functional implementation of an open-mp style, parallel for loop with accumulation.
 
template<typename DerivedV , typename DerivedF , typename DerivedK >
void parallel_transport_angles (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedV > &FN, const Eigen::MatrixXi &E2F, const Eigen::MatrixXi &F2E, Eigen::PlainObjectBase< DerivedK > &K)
 Given the per-face local bases computed via igl::local_basis, this function computes the angle between the two reference frames across each edge.
 
void partition (const Eigen::MatrixXd &W, const int k, Eigen::Matrix< int, Eigen::Dynamic, 1 > &G, Eigen::Matrix< int, Eigen::Dynamic, 1 > &S, Eigen::Matrix< double, Eigen::Dynamic, 1 > &D)
 Partition vertices into groups based on each vertex's vector: vertices with similar coordinates (close in space) will be put in the same group.
 
template<typename T >
void parula (const T f, T *rgb)
 Parula colormap like MATLAB's parula.
 
template<typename T >
void parula (const T f, T &r, T &g, T &b)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedZ , typename DerivedC >
void parula (const Eigen::MatrixBase< DerivedZ > &Z, const bool normalize, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedZ , typename DerivedC >
void parula (const Eigen::MatrixBase< DerivedZ > &Z, const double min_Z, const double max_Z, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedI , typename DerivedE >
void path_to_edges (const Eigen::MatrixBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedE > &E, bool make_loop=false)
 Given a path as an ordered list of N>=2 vertex indices I[0], I[1], ..., I[N-1] construct a list of edges [[I[0],I[1]], [I[1],I[2]], ..., [I[N-2], I[N-1]]] connecting each sequential pair of vertices.
 
template<typename Index , typename DerivedE >
void path_to_edges (const std::vector< Index > &I, Eigen::PlainObjectBase< DerivedE > &E, bool make_loop=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string path_to_executable ()
 Path to current executable.
 
void pathinfo (const std::string &path, std::string &dirname, std::string &basename, std::string &extension, std::string &filename)
 Function like PHP's pathinfo to return information about path.
 
template<typename DerivedV , typename DerivedF , typename DerivedCN >
void per_corner_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const typename DerivedV::Scalar corner_threshold_degrees, Eigen::PlainObjectBase< DerivedCN > &CN)
 Compute per corner normals for a triangle mesh by computing the area-weighted average of normals at incident faces whose normals deviate less than the provided threshold.
 
template<typename DerivedV , typename DerivedF , typename DerivedVF , typename DerivedNI , typename DerivedCN >
void per_corner_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const typename DerivedV::Scalar corner_threshold_degrees, const Eigen::MatrixBase< DerivedVF > &VF, const Eigen::MatrixBase< DerivedNI > &NI, Eigen::PlainObjectBase< DerivedCN > &CN)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedCI , typename DerivedCC , typename DerivedCN >
void per_corner_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedCI > &CI, const Eigen::MatrixBase< DerivedCC > &CC, Eigen::PlainObjectBase< DerivedCN > &CN)
 
template<typename DerivedNV , typename DerivedNF , typename DerivedCN >
void per_corner_normals (const Eigen::MatrixBase< DerivedNV > &NV, const Eigen::MatrixBase< DerivedNF > &NF, Eigen::PlainObjectBase< DerivedCN > &CN)
 Given indexed normals (e.g., read from a .obj file), explode into per-corner normals (e.g., as expected by igl::opengl::ViewerData)
 
template<typename DerivedV , typename DerivedI , typename DerivedC , typename DerivedN , typename DerivedVV , typename DerivedFF , typename DerivedJ , typename DerivedNN >
void per_corner_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedI > &I, const Eigen::MatrixBase< DerivedC > &C, const typename DerivedV::Scalar corner_threshold_degrees, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedVV > &VV, Eigen::PlainObjectBase< DerivedFF > &FF, Eigen::PlainObjectBase< DerivedJ > &J, Eigen::PlainObjectBase< DerivedNN > &NN)
 Per-corner normals for a polygon mesh.
 
template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedN , typename DerivedE , typename DerivedEMAP >
void per_edge_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const PerEdgeNormalsWeightingType weight, const Eigen::MatrixBase< DerivedFN > &FN, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedEMAP > &EMAP)
 Compute face normals via vertex position list, face list.
 
template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedE , typename DerivedEMAP >
void per_edge_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const PerEdgeNormalsWeightingType weight, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedEMAP > &EMAP)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedE , typename DerivedEMAP >
void per_edge_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedEMAP > &EMAP)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedZ , typename DerivedN >
void per_face_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedZ > &Z, Eigen::PlainObjectBase< DerivedN > &N)
 Compute face normals via vertex position list, face list.
 
template<typename DerivedV , typename DerivedF , typename DerivedN >
void per_face_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedN > &N)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedN >
void per_face_normals_stable (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedN > &N)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedI , typename DerivedC , typename DerivedN , typename DerivedVV , typename DerivedFF , typename DerivedJ >
void per_face_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedI > &I, const Eigen::MatrixBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedVV > &VV, Eigen::PlainObjectBase< DerivedFF > &FF, Eigen::PlainObjectBase< DerivedJ > &J)
 Per face normals for a general polygon mesh.
 
template<typename DerivedV , typename DerivedF >
void per_vertex_attribute_smoothing (const Eigen::MatrixBase< DerivedV > &Ain, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedV > &Aout)
 Smooth vertex attributes using uniform Laplacian.
 
template<typename DerivedV , typename DerivedF , typename DerivedN >
void per_vertex_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const igl::PerVertexNormalsWeightingType weighting, Eigen::PlainObjectBase< DerivedN > &N)
 Compute vertex normals via vertex position list, face list.
 
template<typename DerivedV , typename DerivedF , typename DerivedN >
void per_vertex_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedN > &N)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedN >
void per_vertex_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const PerVertexNormalsWeightingType weighting, const Eigen::MatrixBase< DerivedFN > &FN, Eigen::PlainObjectBase< DerivedN > &N)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedN >
void per_vertex_normals (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedFN > &FN, Eigen::PlainObjectBase< DerivedN > &N)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void per_vertex_point_to_plane_quadrics (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::MatrixXi &EMAP, const Eigen::MatrixXi &EF, const Eigen::MatrixXi &EI, std::vector< std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double > > &quadrics)
 Compute quadrics per vertex of a "closed" triangle mesh (V,F).
 
template<typename DerivedF , typename DeriveduE , typename DeriveduEC , typename DeriveduEE >
bool piecewise_constant_winding_number (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DeriveduE > &uE, const Eigen::MatrixBase< DeriveduEC > &uEC, const Eigen::MatrixBase< DeriveduEE > &uEE)
 Determine if a given mesh induces a piecewise constant winding number field: Is this mesh valid input to solid set operations.
 
template<typename DerivedF >
bool piecewise_constant_winding_number (const Eigen::MatrixBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA , typename DerivedX >
void pinv (const Eigen::MatrixBase< DerivedA > &A, typename DerivedA::Scalar tol, Eigen::PlainObjectBase< DerivedX > &X)
 Compute the Moore-Penrose pseudoinverse.
 
template<typename DerivedA , typename DerivedX >
void pinv (const Eigen::MatrixBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedX > &X)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
void planarize_quad_mesh (const Eigen::MatrixBase< DerivedV > &Vin, const Eigen::MatrixBase< DerivedF > &F, const int maxIter, const double &threshold, Eigen::PlainObjectBase< DerivedV > &Vout)
 Planarizes a given quad mesh using the algorithm described in the paper "Shape-Up: Shaping Discrete Geometry with Projections" by S.
 
bool point_in_circle (const double qx, const double qy, const double cx, const double cy, const double r)
 Determine if 2d point is in a circle.
 
template<typename DerivedP , typename DerivedV , typename DerivedEle , typename DerivedsqrD , typename DerivedI , typename DerivedC >
void point_mesh_squared_distance (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, Eigen::PlainObjectBase< DerivedsqrD > &sqrD, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C)
 Compute distances from a set of points P to a triangle mesh (V,F)
 
template<int DIM, typename Derivedp , typename DerivedV , typename DerivedEle , typename Derivedsqr_d , typename Derivedc >
void point_simplex_squared_distance (const Eigen::MatrixBase< Derivedp > &p, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const typename DerivedEle::Index i, Derivedsqr_d &sqr_d, Eigen::PlainObjectBase< Derivedc > &c)
 Determine squared distance from a point to linear simplex.
 
template<int DIM, typename Derivedp , typename DerivedV , typename DerivedEle , typename Derivedsqr_d , typename Derivedc , typename Derivedb >
void point_simplex_squared_distance (const Eigen::MatrixBase< Derivedp > &p, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const typename DerivedEle::Index i, Derivedsqr_d &sqr_d, Eigen::PlainObjectBase< Derivedc > &c, Eigen::PlainObjectBase< Derivedb > &b)
 Determine squared distance from a point to linear simplex.
 
template<typename DerivedA , typename DerivedR , typename DerivedT , typename DerivedU , typename DerivedS , typename DerivedV >
void polar_dec (const Eigen::PlainObjectBase< DerivedA > &A, bool includeReflections, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedU > &U, Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedV > &V)
 Computes the polar decomposition (R,T) of a matrix A.
 
template<typename DerivedA , typename DerivedR , typename DerivedT >
void polar_dec (const Eigen::PlainObjectBase< DerivedA > &A, const bool includeReflections, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &T)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA , typename DerivedR , typename DerivedT , typename DerivedU , typename DerivedS , typename DerivedV >
void polar_dec (const Eigen::PlainObjectBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedU > &U, Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedV > &V)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA , typename DerivedR , typename DerivedT >
void polar_dec (const Eigen::PlainObjectBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &T)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA , typename DerivedR , typename DerivedT , typename DerivedU , typename DerivedS , typename DerivedV >
void polar_svd (const Eigen::MatrixBase< DerivedA > &A, bool includeReflections, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedU > &U, Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedV > &V)
 Computes the polar decomposition (R,T) of a matrix A using SVD singular value decomposition.
 
template<typename DerivedA , typename DerivedR , typename DerivedT >
void polar_svd (const Eigen::MatrixBase< DerivedA > &A, const bool includeReflections, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &T)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA , typename DerivedR , typename DerivedT , typename DerivedU , typename DerivedS , typename DerivedV >
void polar_svd (const Eigen::MatrixBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedU > &U, Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedV > &V)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA , typename DerivedR , typename DerivedT >
void polar_svd (const Eigen::MatrixBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &T)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Mat >
void polar_svd3x3 (const Mat &A, Mat &R)
 Computes the closest rotation to input matrix A using specialized 3x3 SVD singular value decomposition (WunderSVD3x3)
 
template<typename PType , typename DerivedI , typename DerivedC >
void polygon_corners (const std::vector< std::vector< PType > > &P, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C)
 Convert a list-of-lists polygon mesh faces representation to list of polygon corners and sizes.
 
template<typename DerivedQ , typename DerivedI , typename DerivedC >
void polygon_corners (const Eigen::MatrixBase< DerivedQ > &Q, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedI , typename DerivedC , typename DerivedF , typename DerivedJ >
void polygons_to_triangles (const Eigen::MatrixBase< DerivedI > &I, const Eigen::MatrixBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedJ > &J)
 Given a polygon mesh, trivially triangulate each polygon with a fan.
 
template<typename DerivedV , typename DerivedF , typename DerivedPD1 , typename DerivedPD2 , typename DerivedPV1 , typename DerivedPV2 >
void principal_curvature (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedPD1 > &PD1, Eigen::PlainObjectBase< DerivedPD2 > &PD2, Eigen::PlainObjectBase< DerivedPV1 > &PV1, Eigen::PlainObjectBase< DerivedPV2 > &PV2, unsigned radius=5, bool useKring=true)
 Compute the principal curvature directions and magnitude of the given triangle mesh DerivedV derived from vertex positions matrix type: i.e.
 
template<typename DerivedV , typename DerivedF , typename DerivedPD1 , typename DerivedPD2 , typename DerivedPV1 , typename DerivedPV2 , typename Index >
void principal_curvature (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedPD1 > &PD1, Eigen::PlainObjectBase< DerivedPD2 > &PD2, Eigen::PlainObjectBase< DerivedPV1 > &PV1, Eigen::PlainObjectBase< DerivedPV2 > &PV2, std::vector< Index > &bad_vertices, unsigned radius=5, bool useKring=true)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void print_ijv (const Eigen::SparseMatrix< T > &X, const int offset=0)
 Prints a 3 column matrix representing [I,J,V] = find(X).
 
template<typename T >
void print_vector (std::vector< std::vector< T > > &v)
 
template<typename T >
void print_vector (std::vector< std::vector< std::vector< T > > > &v)
 
template<typename DerivedX , typename DerivedY , typename Scalar , typename DerivedR , typename DerivedT >
void procrustes (const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedY > &Y, const bool includeScaling, const bool includeReflections, Scalar &scale, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &t)
 Solve Procrustes problem in d dimensions.
 
template<typename DerivedX , typename DerivedY , typename Scalar , int DIM, int TType>
void procrustes (const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedY > &Y, const bool includeScaling, const bool includeReflections, Eigen::Transform< Scalar, DIM, TType > &T)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY , typename DerivedR , typename DerivedT >
void procrustes (const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedY > &Y, const bool includeScaling, const bool includeReflections, Eigen::PlainObjectBase< DerivedR > &S, Eigen::PlainObjectBase< DerivedT > &t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY , typename DerivedR , typename DerivedT >
void procrustes (const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedY > &Y, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY , typename Scalar , typename DerivedT >
void procrustes (const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedY > &Y, Eigen::Rotation2D< Scalar > &R, Eigen::PlainObjectBase< DerivedT > &t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar >
Eigen::Matrix< Scalar, 3, 1 > project (const Eigen::Matrix< Scalar, 3, 1 > &obj, const Eigen::Matrix< Scalar, 4, 4 > &model, const Eigen::Matrix< Scalar, 4, 4 > &proj, const Eigen::Matrix< Scalar, 4, 1 > &viewport)
 Eigen reimplementation of gluProject.
 
template<typename DerivedV , typename DerivedM , typename DerivedN , typename DerivedO , typename DerivedP >
void project (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedM > &model, const Eigen::MatrixBase< DerivedN > &proj, const Eigen::MatrixBase< DerivedO > &viewport, Eigen::PlainObjectBase< DerivedP > &P)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedU , typename DerivedUF , typename Scalar >
void project_isometrically_to_plane (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedU > &U, Eigen::PlainObjectBase< DerivedUF > &UF, Eigen::SparseMatrix< Scalar > &I)
 Project each triangle to the plane.
 
template<typename DerivedP , typename DerivedS , typename DerivedD , typename Derivedt , typename DerivedsqrD >
void project_to_line (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedS > &S, const Eigen::MatrixBase< DerivedD > &D, Eigen::PlainObjectBase< Derivedt > &t, Eigen::PlainObjectBase< DerivedsqrD > &sqrD)
 Project points onto vectors, that is find the parameter t for a point p such that proj_p = (y-x).
 
template<typename Scalar >
void project_to_line (const Scalar px, const Scalar py, const Scalar pz, const Scalar sx, const Scalar sy, const Scalar sz, const Scalar dx, const Scalar dy, const Scalar dz, Scalar &projpx, Scalar &projpy, Scalar &projpz, Scalar &t, Scalar &sqrd)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar >
void project_to_line (const Scalar px, const Scalar py, const Scalar pz, const Scalar sx, const Scalar sy, const Scalar sz, const Scalar dx, const Scalar dy, const Scalar dz, Scalar &t, Scalar &sqrd)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedP , typename DerivedS , typename DerivedD , typename Derivedt , typename DerivedsqrD >
void project_to_line_segment (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedS > &S, const Eigen::MatrixBase< DerivedD > &D, Eigen::PlainObjectBase< Derivedt > &t, Eigen::PlainObjectBase< DerivedsqrD > &sqrD)
 Project points onto vectors, that is find the parameter t for a point p such that proj_p = (y-x).
 
template<typename DerivedUV , typename DerivedM , typename DerivedVP , typename DerivedA , typename DerivedB >
void projection_constraint (const Eigen::MatrixBase< DerivedUV > &UV, const Eigen::MatrixBase< DerivedM > &M, const Eigen::MatrixBase< DerivedVP > &VP, Eigen::PlainObjectBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedB > &B)
 Construct two constraint equations for projecting a point to the screen.
 
template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedVN , typename DerivedEN , typename DerivedEMAP , typename Derivedq , typename Derivedc , typename Scalar , typename Derivedn >
void pseudonormal_test (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedFN > &FN, const Eigen::MatrixBase< DerivedVN > &VN, const Eigen::MatrixBase< DerivedEN > &EN, const Eigen::MatrixBase< DerivedEMAP > &EMAP, const Eigen::MatrixBase< Derivedq > &q, const int f, Eigen::PlainObjectBase< Derivedc > &c, Scalar &s, Eigen::PlainObjectBase< Derivedn > &n)
 Given a mesh (V,F), a query point q, and a point on (V,F) c, determine whether q is inside (V,F) --> s=-1 or outside (V,F) s=1, based on the sign of the dot product between (q-c) and n, where n is the normal at c, carefully chosen according to [Bærentzen & Aanæs 2005].
 
template<typename DerivedV , typename DerivedF , typename DerivedEN , typename DerivedVN , typename Derivedq , typename Derivedc , typename Scalar , typename Derivedn >
void pseudonormal_test (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &E, const Eigen::MatrixBase< DerivedEN > &EN, const Eigen::MatrixBase< DerivedVN > &VN, const Eigen::MatrixBase< Derivedq > &q, const int e, Eigen::PlainObjectBase< Derivedc > &c, Scalar &s, Eigen::PlainObjectBase< Derivedn > &n)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename DerivedX , typename DerivedLB , typename DerivedUB >
Scalar pso (const std::function< Scalar(DerivedX &) > f, const Eigen::MatrixBase< DerivedLB > &LB, const Eigen::MatrixBase< DerivedUB > &UB, const int max_iters, const int population, DerivedX &X)
 Global optimization with the particle swarm algorithm.
 
template<typename Scalar , typename DerivedX , typename DerivedLB , typename DerivedUB , typename DerivedP >
Scalar pso (const std::function< Scalar(DerivedX &) > f, const Eigen::MatrixBase< DerivedLB > &LB, const Eigen::MatrixBase< DerivedUB > &UB, const Eigen::DenseBase< DerivedP > &P, const int max_iters, const int population, DerivedX &X)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool qslim (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const size_t max_m, Eigen::MatrixXd &U, Eigen::MatrixXi &G, Eigen::VectorXi &J, Eigen::VectorXi &I)
 Decimate (simplify) a triangle mesh in nD according to the paper "Simplifying Surfaces with Color and Texture using Quadric Error Metrics" by [Garland and Heckbert, 1987] (technically a followup to qslim).
 
template<typename DerivedV , typename DerivedQ , typename DerivedE >
void quad_grid (const int nx, const int ny, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedQ > &Q, Eigen::PlainObjectBase< DerivedE > &E)
 
template<typename DerivedQ , typename DerivedE >
void quad_grid (const int nx, const int ny, Eigen::PlainObjectBase< DerivedQ > &Q, Eigen::PlainObjectBase< DerivedE > &E)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedP >
void quad_planarity (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedP > &P)
 Compute planarity of the faces of a quad mesh.
 
template<typename Scalar , int n, int ni>
Eigen::Matrix< Scalar, n, 1 > quadprog (const Eigen::Matrix< Scalar, n, n > &H, const Eigen::Matrix< Scalar, n, 1 > &f, const Eigen::Matrix< Scalar, ni, n > &Ai, const Eigen::Matrix< Scalar, ni, 1 > &lbi, const Eigen::Matrix< Scalar, ni, 1 > &ubi, const Eigen::Matrix< Scalar, n, 1 > &lb, const Eigen::Matrix< Scalar, n, 1 > &ub)
 Solve a convex quadratic program.
 
template<typename Scalar , int n, int m>
Eigen::Matrix< Scalar, n, 1 > quadprog (const Eigen::Matrix< Scalar, n, n > &H, const Eigen::Matrix< Scalar, n, 1 > &f, const Eigen::Matrix< Scalar, m, n > &A, const Eigen::Matrix< Scalar, m, 1 > &b, const Eigen::Matrix< Scalar, n, 1 > &lb, const Eigen::Matrix< Scalar, n, 1 > &ub)
 Solve a convex quadratic program.
 
template<typename Scalar , int n>
Eigen::Matrix< Scalar, n, 1 > quadprog (const Eigen::Matrix< Scalar, n, n > &H, const Eigen::Matrix< Scalar, n, 1 > &f, const Eigen::Matrix< Scalar, n, 1 > &lb, const Eigen::Matrix< Scalar, n, 1 > &ub)
 Solve a convex quadratic program.
 
std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double > operator+ (const std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double > &a, const std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double > &b)
 A binary addition operator for Quadric tuples compatible with qslim, computing c = a+b.
 
template<typename Q_type >
void quat_conjugate (const Q_type *q1, Q_type *out)
 Compute conjugate of given quaternion http://en.wikipedia.org/wiki/Quaternion#Conjugation.2C_the_norm.2C_and_reciprocal A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.
 
template<typename Q_type >
void quat_mult (const Q_type *q1, const Q_type *q2, Q_type *out)
 Computes out = q1 * q2 with quaternion multiplication A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.
 
template<typename Q_type >
void quat_to_axis_angle (const Q_type *q, Q_type *axis, Q_type &angle)
 Convert quat representation of a rotation to axis angle A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.
 
template<typename Q_type >
void quat_to_axis_angle_deg (const Q_type *q, Q_type *axis, Q_type &angle)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.include/igl/quat_to_axis_angle.h.
 
template<typename Q_type >
void quat_to_mat (const Q_type *quat, Q_type *mat)
 Convert a quaternion to a 4x4 matrix A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.
 
void quats_to_column (const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > vQ, Eigen::VectorXd &Q)
 "Columnize" a list of quaternions (q1x,q1y,q1z,q1w,q2x,q2y,q2z,q2w,...)
 
Eigen::VectorXd quats_to_column (const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > vQ)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedP , typename DerivedS , typename DerivedJ >
void ramer_douglas_peucker (const Eigen::MatrixBase< DerivedP > &P, const typename DerivedP::Scalar tol, Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedJ > &J)
 Ramer-Douglas-Peucker piecewise-linear curve simplification.
 
template<typename DerivedP , typename DerivedS , typename DerivedJ , typename DerivedQ >
void ramer_douglas_peucker (const Eigen::MatrixBase< DerivedP > &P, const typename DerivedP::Scalar tol, Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedJ > &J, Eigen::PlainObjectBase< DerivedQ > &Q)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Eigen::Vector3d random_dir ()
 Generate a uniformly random unit direction in 3D, return as vector.
 
Eigen::MatrixXd random_dir_stratified (const int n)
 Generate n stratified uniformly random unit directions in 3d, return as rows of an n by 3 matrix.
 
template<typename DerivedV , typename DerivedF , typename DerivedB , typename DerivedFI , typename DerivedX , typename URBG = DEFAULT_URBG>
void random_points_on_mesh (const int n, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedFI > &FI, Eigen::PlainObjectBase< DerivedX > &X, URBG &&urbg=igl::generate_default_urbg())
 Randomly sample a mesh (V,F) n times.
 
template<typename DeriveddblA , typename DerivedB , typename DerivedFI , typename URBG = DEFAULT_URBG>
void random_points_on_mesh_intrinsic (const int n, const Eigen::MatrixBase< DeriveddblA > &dblA, Eigen::PlainObjectBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedFI > &FI, URBG &&urbg=igl::generate_default_urbg())
 Randomly sample a mesh (V,F) n times.
 
template<typename DeriveddblA , typename DerivedF , typename ScalarB , typename DerivedFI , typename URBG >
void random_points_on_mesh_intrinsic (const int n, const Eigen::MatrixBase< DeriveddblA > &dblA, const int num_vertices, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< ScalarB > &B, Eigen::PlainObjectBase< DerivedFI > &FI, URBG &&urbg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar >
Eigen::Quaternion< Scalar > random_quaternion ()
 Generate a random quaternion via uniform sampling of the 4-sphere.
 
template<typename Scalar , typename DerivedX , typename DerivedLB , typename DerivedUB >
Scalar random_search (const std::function< Scalar(DerivedX &) > f, const Eigen::MatrixBase< DerivedLB > &LB, const Eigen::MatrixBase< DerivedUB > &UB, const int iters, DerivedX &X)
 Global optimization via random search.
 
template<typename DerivedI , typename URBG = DEFAULT_URBG>
void randperm (const int n, Eigen::PlainObjectBase< DerivedI > &I, URBG &&urbg=igl::generate_default_urbg())
 Like matlab's randperm(n) but minus 1.
 
template<typename Derivedsource , typename Deriveddir , typename Scalar >
bool ray_box_intersect (const Eigen::MatrixBase< Derivedsource > &source, const Eigen::MatrixBase< Deriveddir > &dir, const Eigen::AlignedBox< Scalar, 3 > &box, const Scalar &t0, const Scalar &t1, Scalar &tmin, Scalar &tmax)
 Determine whether a ray origin+t*dir and box intersect within the ray's parameterized range (t0,t1)
 
template<typename Derivedsource , typename Deriveddir , typename Scalar >
bool ray_box_intersect (const Eigen::MatrixBase< Derivedsource > &source, const Eigen::MatrixBase< Deriveddir > &inv_dir, const Eigen::MatrixBase< Deriveddir > &inv_dir_pad, const Eigen::AlignedBox< Scalar, 3 > &box, const Scalar &t0, const Scalar &t1, Scalar &tmin, Scalar &tmax)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Derivedsource , typename Deriveddir , typename DerivedV , typename DerivedF >
bool ray_mesh_intersect (const Eigen::MatrixBase< Derivedsource > &source, const Eigen::MatrixBase< Deriveddir > &dir, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, std::vector< igl::Hit > &hits)
 Shoot a ray against a mesh (V,F) and collect all hits.
 
template<typename Derivedsource , typename Deriveddir , typename DerivedV , typename DerivedF >
bool ray_mesh_intersect (const Eigen::MatrixBase< Derivedsource > &source, const Eigen::MatrixBase< Deriveddir > &dir, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, igl::Hit &hit)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Derivedsource , typename Deriveddir , typename DerivedV , typename DerivedF >
bool ray_triangle_intersect (const Eigen::MatrixBase< Derivedsource > &source, const Eigen::MatrixBase< Deriveddir > &dir, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const int f, igl::Hit &hit)
 
template<typename Derivedo , typename Derivedd , typename Derivedc , typename r_type , typename t_type >
int ray_sphere_intersect (const Eigen::PlainObjectBase< Derivedo > &o, const Eigen::PlainObjectBase< Derivedd > &d, const Eigen::PlainObjectBase< Derivedc > &c, r_type r, t_type &t0, t_type &t1)
 Compute the intersection between a ray from O in direction D and a sphere centered at C with radius r.
 
void read_file_binary (FILE *fp, std::vector< uint8_t > &fileBufferBytes)
 Read contents of file into a buffer of uint8_t bytes.
 
template<typename DerivedV , typename DerivedF >
bool read_triangle_mesh (const std::string str, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 Read mesh from an ascii file with automatic detection of file format among: mesh, msh obj, off, ply, stl, wrl.
 
template<typename Scalar , typename Index >
bool read_triangle_mesh (const std::string str, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Index > > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
bool read_triangle_mesh (const std::string str, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, std::string &dir, std::string &base, std::string &ext, std::string &name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
bool read_triangle_mesh (const std::string &ext, FILE *fp, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedWI , typename DerivedP , typename DerivedO >
bool readBF (const std::string &filename, Eigen::PlainObjectBase< DerivedWI > &WI, Eigen::PlainObjectBase< DerivedP > &P, Eigen::PlainObjectBase< DerivedO > &O)
 Read a bones forest from a file, returns a list of bone roots.
 
template<typename DerivedWI , typename DerivedbfP , typename DerivedO , typename DerivedC , typename DerivedBE , typename DerivedP >
bool readBF (const std::string &filename, Eigen::PlainObjectBase< DerivedWI > &WI, Eigen::PlainObjectBase< DerivedbfP > &bfP, Eigen::PlainObjectBase< DerivedO > &O, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedBE > &BE, Eigen::PlainObjectBase< DerivedP > &P)
 Read bone forest into pure bone-skeleton format, expects only bones (no point handles), and that a root in the .bf <—> no weight attachment.
 
template<typename Scalar >
bool readCSV (const std::string str, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &M)
 read a matrix from a csv file into a Eigen matrix
 
template<typename DerivedW >
bool readDMAT (const std::string file_name, Eigen::PlainObjectBase< DerivedW > &W)
 Read a matrix from an .dmat file.
 
template<typename Scalar >
bool readDMAT (const std::string file_name, std::vector< std::vector< Scalar > > &W)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedT >
bool readMESH (const std::string mesh_file_name, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedF > &F)
 Load a tetrahedral volume mesh from a .mesh file.
 
template<typename Scalar , typename Index >
bool readMESH (const std::string mesh_file_name, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Index > > &T, std::vector< std::vector< Index > > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedT >
bool readMESH (FILE *mesh_file, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename Index >
bool readMESH (FILE *mesh_file, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Index > > &T, std::vector< std::vector< Index > > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<int EigenMatrixOptions>
bool readMSH (const std::string &msh, Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &X, Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &Tri, Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &Tet, Eigen::VectorXi &TriTag, Eigen::VectorXi &TetTag, std::vector< std::string > &XFields, std::vector< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > > &XF, std::vector< std::string > &EFields, std::vector< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > > &TriF, std::vector< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > > &TetF)
 read triangle surface mesh and tetrahedral volume mesh from .msh file
 
template<int EigenMatrixOptions>
bool readMSH (const std::string &msh, Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &X, Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &Tri, Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &Tet, Eigen::VectorXi &TriTag, Eigen::VectorXi &TetTag)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<int EigenMatrixOptions>
bool readMSH (const std::string &msh, Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &X, Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &Tri, Eigen::VectorXi &TriTag)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<int EigenMatrixOptions>
bool readMSH (const std::string &msh, Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &X, Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &Tri)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedI >
bool readNODE (const std::string node_file_name, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedI > &I)
 load a list of points from a .node file
 
template<typename Scalar , typename Index >
bool readNODE (const std::string node_file_name, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Index > > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename Index >
bool readOBJ (const std::string obj_file_name, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Scalar > > &TC, std::vector< std::vector< Scalar > > &N, std::vector< std::vector< Index > > &F, std::vector< std::vector< Index > > &FTC, std::vector< std::vector< Index > > &FN, std::vector< std::tuple< std::string, Index, Index > > &FM)
 Read a mesh from an ascii obj file, filling in vertex positions, normals and texture coordinates.
 
template<typename Scalar , typename Index >
bool readOBJ (const std::string obj_file_name, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Scalar > > &TC, std::vector< std::vector< Scalar > > &N, std::vector< std::vector< Index > > &F, std::vector< std::vector< Index > > &FTC, std::vector< std::vector< Index > > &FN)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename Index >
bool readOBJ (FILE *obj_file, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Scalar > > &TC, std::vector< std::vector< Scalar > > &N, std::vector< std::vector< Index > > &F, std::vector< std::vector< Index > > &FTC, std::vector< std::vector< Index > > &FN, std::vector< std::tuple< std::string, Index, Index > > &FM)
 
template<typename Scalar , typename Index >
bool readOBJ (const std::string obj_file_name, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Index > > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedTC , typename DerivedCN , typename DerivedF , typename DerivedFTC , typename DerivedFN >
bool readOBJ (const std::string str, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedTC > &TC, Eigen::PlainObjectBase< DerivedCN > &CN, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedFTC > &FTC, Eigen::PlainObjectBase< DerivedFN > &FN)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
bool readOBJ (const std::string str, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedI , typename DerivedC >
bool readOBJ (const std::string str, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename Index >
bool readOFF (const std::string off_file_name, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Index > > &F, std::vector< std::vector< Scalar > > &N, std::vector< std::vector< Scalar > > &C)
 Read a mesh from an ascii OFF file, filling in vertex positions, normals and texture coordinates.
 
template<typename DerivedV , typename DerivedF >
bool readOFF (const std::string str, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
bool readOFF (const std::string str, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedV > &N)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename Index >
bool readOFF (FILE *off_file, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Index > > &F, std::vector< std::vector< Scalar > > &N, std::vector< std::vector< Scalar > > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV , typename DerivedVD , typename DerivedFD , typename DerivedED >
bool readPLY (std::istream &ply_stream, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedF > &E, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedUV > &UV, Eigen::PlainObjectBase< DerivedVD > &VD, std::vector< std::string > &Vheader, Eigen::PlainObjectBase< DerivedFD > &FD, std::vector< std::string > &Fheader, Eigen::PlainObjectBase< DerivedED > &ED, std::vector< std::string > &Eheader, std::vector< std::string > &comments)
 Read triangular mesh from ply file, filling in vertex positions, normals and texture coordinates, if available also read additional properties associated with vertex,faces and edges and file comments.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV , typename DerivedVD , typename DerivedFD , typename DerivedED >
bool readPLY (const std::string &ply_file, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedUV > &UV, Eigen::PlainObjectBase< DerivedVD > &VD, std::vector< std::string > &VDheader, Eigen::PlainObjectBase< DerivedFD > &FD, std::vector< std::string > &FDheader, Eigen::PlainObjectBase< DerivedED > &ED, std::vector< std::string > &EDheader, std::vector< std::string > &comments)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedUV , typename DerivedVD >
bool readPLY (const std::string &filename, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedUV > &UV, Eigen::PlainObjectBase< DerivedVD > &VD, std::vector< std::string > &Vheader)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV >
bool readPLY (const std::string &filename, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedUV > &UV)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
bool readPLY (const std::string &filename, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedE >
bool readPLY (const std::string &filename, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
bool readPLY (FILE *fp, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedN >
bool readSTL (std::istream &input, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedN > &N)
 Read a mesh from an ascii/binary stl file.
 
template<typename TypeV , typename TypeF , typename TypeN >
bool readSTL (std::istream &input, std::vector< std::array< TypeV, 3 > > &V, std::vector< std::array< TypeF, 3 > > &F, std::vector< std::array< TypeN, 3 > > &N)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedN >
bool readSTL (FILE *fp, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedN > &N)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool readTGF (const std::string tgf_filename, std::vector< std::vector< double > > &C, std::vector< std::vector< int > > &E, std::vector< int > &P, std::vector< std::vector< int > > &BE, std::vector< std::vector< int > > &CE, std::vector< std::vector< int > > &PE)
 Read a graph from a .tgf file.
 
bool readTGF (const std::string tgf_filename, Eigen::MatrixXd &C, Eigen::MatrixXi &E, Eigen::VectorXi &P, Eigen::MatrixXi &BE, Eigen::MatrixXi &CE, Eigen::MatrixXi &PE)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool readTGF (const std::string tgf_filename, Eigen::MatrixXd &C, Eigen::MatrixXi &E)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename Index >
bool readWRL (const std::string wrl_file_name, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Index > > &F)
 Read a mesh from an ascii wrl file, filling in vertex positions and face indices of the first model.
 
template<typename Scalar , typename Index >
bool readWRL (FILE *wrl_file, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Index > > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename AType , typename Func , typename DerivedB >
void redux (const Eigen::SparseMatrix< AType > &A, const int dim, const Func &func, Eigen::PlainObjectBase< DerivedB > &B)
 Perform reductions on the rows or columns of a SparseMatrix.
 
template<typename DerivedV , typename DerivedF , typename DerivedS , typename DerivedU , typename DerivedG , typename DerivedJ , typename BCtype , typename DerivedSU , typename DerivedL >
void remesh_along_isoline (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedS > &S, const typename DerivedS::Scalar val, Eigen::PlainObjectBase< DerivedU > &U, Eigen::PlainObjectBase< DerivedG > &G, Eigen::PlainObjectBase< DerivedSU > &SU, Eigen::PlainObjectBase< DerivedJ > &J, Eigen::SparseMatrix< BCtype > &BC, Eigen::PlainObjectBase< DerivedL > &L)
 Given a triangle mesh and a scalar field, remesh so that a given isovalue of the scalar field follows (new) edges of the output mesh.
 
template<typename DerivedF , typename DerivedS , typename DerivedG , typename DerivedJ , typename BCtype , typename DerivedSU , typename DerivedL >
void remesh_along_isoline (const int n, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedS > &S, const typename DerivedS::Scalar val, Eigen::PlainObjectBase< DerivedG > &G, Eigen::PlainObjectBase< DerivedSU > &SU, Eigen::PlainObjectBase< DerivedJ > &J, Eigen::SparseMatrix< BCtype > &BC, Eigen::PlainObjectBase< DerivedL > &L)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedSV , typename DerivedSVI , typename DerivedSVJ >
void remove_duplicate_vertices (const Eigen::MatrixBase< DerivedV > &V, const double epsilon, Eigen::PlainObjectBase< DerivedSV > &SV, Eigen::PlainObjectBase< DerivedSVI > &SVI, Eigen::PlainObjectBase< DerivedSVJ > &SVJ)
 Remove duplicate vertices upto a uniqueness tolerance (epsilon)
 
template<typename DerivedV , typename DerivedF , typename DerivedSV , typename DerivedSVI , typename DerivedSVJ , typename DerivedSF >
void remove_duplicate_vertices (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const double epsilon, Eigen::PlainObjectBase< DerivedSV > &SV, Eigen::PlainObjectBase< DerivedSVI > &SVI, Eigen::PlainObjectBase< DerivedSVJ > &SVJ, Eigen::PlainObjectBase< DerivedSF > &SF)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedNV , typename DerivedNF , typename DerivedI , typename DerivedJ >
void remove_unreferenced (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedNV > &NV, Eigen::PlainObjectBase< DerivedNF > &NF, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedJ > &J)
 Remove unreferenced vertices from V, updating F accordingly.
 
template<typename DerivedV , typename DerivedF , typename DerivedNV , typename DerivedNF , typename DerivedI >
void remove_unreferenced (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedNV > &NV, Eigen::PlainObjectBase< DerivedNF > &NF, Eigen::PlainObjectBase< DerivedI > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedI , typename DerivedJ >
void remove_unreferenced (const size_t n, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedJ > &J)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void repdiag (const Eigen::SparseMatrix< T > &A, const int d, Eigen::SparseMatrix< T > &B)
 Repeat a matrix along the diagonal a certain number of times, so that if A is a m by n matrix and we want to repeat along the diagonal d times, we get a m*d by n*d matrix B such that: B( (k*m+1):(k*m+1+m-1), (k*n+1):(k*n+1+n-1)) = A for k from 0 to d-1.
 
template<typename T >
void repdiag (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &A, const int d, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &B)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<class Mat >
Mat repdiag (const Mat &A, const int d)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA , typename DerivedB >
void repmat (const Eigen::MatrixBase< DerivedA > &A, const int r, const int c, Eigen::PlainObjectBase< DerivedB > &B)
 Replicate and tile a matrix.
 
template<typename T , int majorType>
void repmat (const Eigen::SparseMatrix< T, majorType > &A, const int r, const int c, Eigen::SparseMatrix< T, majorType > &B)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF1 , typename DerivedF2 , typename DerivedJ >
void resolve_duplicated_faces (const Eigen::MatrixBase< DerivedF1 > &F1, Eigen::PlainObjectBase< DerivedF2 > &F2, Eigen::PlainObjectBase< DerivedJ > &J)
 Resolve duplicated faces according to the following rules per unique face:
 
template<typename R , typename H >
void rgb_to_hsv (const R *rgb, H *hsv)
 Convert RGB to HSV.
 
template<typename DerivedR , typename DerivedH >
void rgb_to_hsv (const Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedH > &H)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedP , typename DerivedN , typename DerivedR , typename Derivedt >
void rigid_alignment (const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< Derivedt > &t)
 Find the rigid transformation that best aligns the 3D points X to their corresponding points P with associated normals N.
 
template<typename Q_type >
void rotate_by_quat (const Q_type *v, const Q_type *q, Q_type *out)
 Compute rotation of a given vector/point by a quaternion A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.
 
Eigen::MatrixXd rotate_vectors (const Eigen::MatrixXd &V, const Eigen::VectorXd &A, const Eigen::MatrixXd &B1, const Eigen::MatrixXd &B2)
 Rotate the vectors V by A radians on the tangent plane spanned by B1 and B2.
 
template<typename Scalar >
Eigen::Matrix< Scalar, 3, 3 > rotation_matrix_from_directions (const Eigen::Matrix< Scalar, 3, 1 > v0, const Eigen::Matrix< Scalar, 3, 1 > v1)
 Given 2 vectors centered on origin calculate the rotation matrix from first to the second.
 
template<typename DerivedX >
DerivedX round (const DerivedX r)
 Round a scalar value.
 
template<typename DerivedX , typename DerivedY >
void round (const Eigen::PlainObjectBase< DerivedX > &X, Eigen::PlainObjectBase< DerivedY > &Y)
 Round a given matrix to nearest integers.
 
template<class Row , class Mat >
bool rows_to_matrix (const std::vector< Row > &V, Mat &M)
 Convert a list (std::vector) of row vectors of the same length to a matrix.
 
void sample_edges (const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const int k, Eigen::MatrixXd &S)
 Compute k extra points along each edge in E defined over vertices of V.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarG >
void scalar_to_cr_vector_gradient (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarG > &G)
 Computes the gradient matrix with hat functions on the right, and vector CR functions on the left.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarG >
void scalar_to_cr_vector_gradient (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarG > &G)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedL_sq , typename DeriveddA , typename DerivedE , typename DerivedOE , typename ScalarG >
void scalar_to_cr_vector_gradient_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedL_sq > &l_sq, const Eigen::MatrixBase< DeriveddA > &dA, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarG > &G)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedL_sq , typename DerivedE , typename DerivedOE , typename ScalarG >
void scalar_to_cr_vector_gradient_intrinsic (const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedL_sq > &l_sq, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedOE > &oE, Eigen::SparseMatrix< ScalarG > &G)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. include/igl/scalar_to_cr_vector_gradient.h.
 
template<typename DerivedV , typename DerivedF , typename DerivedM , typename DerivedN , typename DerivedO , typename Ltype , typename DerivedW , typename Deriveda >
void screen_space_selection (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const igl::AABB< DerivedV, 3 > &tree, const Eigen::MatrixBase< DerivedM > &model, const Eigen::MatrixBase< DerivedN > &proj, const Eigen::MatrixBase< DerivedO > &viewport, const std::vector< Eigen::Matrix< Ltype, 1, 2 > > &L, Eigen::PlainObjectBase< DerivedW > &W, Eigen::PlainObjectBase< Deriveda > &and_visible)
 Given a mesh, a camera determine which points are inside of a given 2D screen space polygon culling points based on self-occlusion.
 
template<typename DerivedV , typename DerivedM , typename DerivedN , typename DerivedO , typename Ltype , typename DerivedW >
void screen_space_selection (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedM > &model, const Eigen::MatrixBase< DerivedN > &proj, const Eigen::MatrixBase< DerivedO > &viewport, const std::vector< Eigen::Matrix< Ltype, 1, 2 > > &L, Eigen::PlainObjectBase< DerivedW > &W)
 Given a mesh, a camera determine which points are inside of a given 2D screen space polygon.
 
template<typename DerivedV , typename DerivedM , typename DerivedN , typename DerivedO , typename DerivedP , typename DerivedE , typename DerivedW >
void screen_space_selection (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedM > &model, const Eigen::MatrixBase< DerivedN > &proj, const Eigen::MatrixBase< DerivedO > &viewport, const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedE > &E, Eigen::PlainObjectBase< DerivedW > &W)
 Given a mesh, a camera determine which points are inside of a given 2D screen space polygon.
 
template<typename DerivedV , typename DerivedTC , typename DerivedF , typename DerivedFTC , typename Derivedseams , typename Derivedboundaries , typename Derivedfoldovers >
void seam_edges (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedTC > &TC, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedFTC > &FTC, Eigen::PlainObjectBase< Derivedseams > &seams, Eigen::PlainObjectBase< Derivedboundaries > &boundaries, Eigen::PlainObjectBase< Derivedfoldovers > &foldovers)
 Finds all UV-space boundaries of a mesh.
 
template<typename DerivedSource , typename DerivedDir >
bool segment_segment_intersect (const Eigen::MatrixBase< DerivedSource > &p, const Eigen::MatrixBase< DerivedDir > &r, const Eigen::MatrixBase< DerivedSource > &q, const Eigen::MatrixBase< DerivedDir > &s, double &t, double &u, double eps=1e-6)
 Determine whether two line segments A,B intersect.
 
template<typename T >
bool serialize (const T &obj, const std::string &filename)
 
template<typename T >
bool serialize (const T &obj, const std::string &objectName, const std::string &filename, bool overwrite=false)
 
template<typename T >
bool serialize (const T &obj, const std::string &objectName, std::vector< char > &buffer)
 
template<typename T >
bool deserialize (T &obj, const std::string &filename)
 
template<typename T >
bool deserialize (T &obj, const std::string &objectName, const std::string &filename)
 
template<typename T >
bool deserialize (T &obj, const std::string &objectName, const std::vector< char > &buffer)
 
template<typename T >
bool serializer (bool serialize, T &obj, const std::string &filename)
 
template<typename T >
bool serializer (bool serialize, T &obj, const std::string &objectName, const std::string &filename, bool overwrite=false)
 
template<typename T >
bool serializer (bool serialize, T &obj, const std::string &objectName, std::vector< char > &buffer)
 
template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedIA >
void setdiff (const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedIA > &IA)
 Set difference of elements of matrices.
 
template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedIA , typename DerivedIB >
void setunion (const Eigen::DenseBase< DerivedA > &A, const Eigen::DenseBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedIA > &IA, Eigen::PlainObjectBase< DerivedIB > &IB)
 Union of elements of matrices (like matlab's union)
 
template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedIA , typename DerivedIB >
void setxor (const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedIA > &IA, Eigen::PlainObjectBase< DerivedIB > &IB)
 Set xor of elements of matrices.
 
template<typename DerivedP , typename DerivedN , typename DerivedS >
void shape_diameter_function (const std::function< double(const Eigen::Vector3f &, const Eigen::Vector3f &) > &shoot_ray, const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S)
 Compute shape diamater function per given point.
 
template<typename DerivedV , int DIM, typename DerivedF , typename DerivedP , typename DerivedN , typename DerivedS >
void shape_diameter_function (const igl::AABB< DerivedV, DIM > &aabb, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedP , typename DerivedN , typename DerivedS >
void shape_diameter_function (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedN > &N, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedS >
void shape_diameter_function (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const bool per_face, const int num_samples, Eigen::PlainObjectBase< DerivedS > &S)
 
bool shapeup_identity_projection (const Eigen::PlainObjectBase< Eigen::MatrixXd > &P, const Eigen::PlainObjectBase< Eigen::VectorXi > &SC, const Eigen::PlainObjectBase< Eigen::MatrixXi > &S, Eigen::PlainObjectBase< Eigen::MatrixXd > &projP)
 This projection does nothing but render points into projP.
 
bool shapeup_regular_face_projection (const Eigen::PlainObjectBase< Eigen::MatrixXd > &P, const Eigen::PlainObjectBase< Eigen::VectorXi > &SC, const Eigen::PlainObjectBase< Eigen::MatrixXi > &S, Eigen::PlainObjectBase< Eigen::MatrixXd > &projP)
 the projection assumes that the sets are vertices of polygons in cyclic order
 
template<typename DerivedP , typename DerivedSC , typename DerivedS , typename Derivedw >
bool shapeup_precomputation (const Eigen::PlainObjectBase< DerivedP > &P, const Eigen::PlainObjectBase< DerivedSC > &SC, const Eigen::PlainObjectBase< DerivedS > &S, const Eigen::PlainObjectBase< DerivedS > &E, const Eigen::PlainObjectBase< DerivedSC > &b, const Eigen::PlainObjectBase< Derivedw > &wShape, const Eigen::PlainObjectBase< Derivedw > &wSmooth, ShapeupData &sudata)
 This function precomputation the necessary matrices for the ShapeUp process, and prefactorizes them.
 
template<typename DerivedP , typename DerivedSC , typename DerivedS >
bool shapeup_solve (const Eigen::PlainObjectBase< DerivedP > &bc, const std::function< bool(const Eigen::PlainObjectBase< DerivedP > &, const Eigen::PlainObjectBase< DerivedSC > &, const Eigen::PlainObjectBase< DerivedS > &, Eigen::PlainObjectBase< DerivedP > &)> &local_projection, const Eigen::PlainObjectBase< DerivedP > &P0, const ShapeupData &sudata, const bool quietIterations, Eigen::PlainObjectBase< DerivedP > &P)
 This function solve the shapeup project optimization.
 
template<typename DerivedV , typename DerivedF , typename DerivedSE , typename DerivedE , typename DeriveduE , typename DerivedEMAP , typename uE2Etype , typename sharptype >
void sharp_edges (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const typename DerivedV::Scalar angle, Eigen::PlainObjectBase< DerivedSE > &SE, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DeriveduE > &uE, Eigen::PlainObjectBase< DerivedEMAP > &EMAP, std::vector< std::vector< uE2Etype > > &uE2E, std::vector< sharptype > &sharp)
 Given a mesh, compute sharp edges.
 
template<typename DerivedV , typename DerivedF , typename DerivedSE >
void sharp_edges (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const typename DerivedV::Scalar angle, Eigen::PlainObjectBase< DerivedSE > &SE)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void shortest_edge_and_midpoint (const int e, const Eigen::MatrixXd &V, const Eigen::MatrixXi &, const Eigen::MatrixXi &E, const Eigen::VectorXi &, const Eigen::MatrixXi &, const Eigen::MatrixXi &, double &cost, Eigen::RowVectorXd &p)
 Cost and placement function compatible with igl::decimate.
 
template<typename DerivedA , typename DerivedB , typename DerivedP >
DerivedA::Scalar signed_angle (const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< DerivedP > &P)
 Compute the signed angle subtended by the oriented 3d triangle (A,B,C) at some point P.
 
template<typename DerivedP , typename DerivedV , typename DerivedF , typename DerivedS , typename DerivedI , typename DerivedC , typename DerivedN >
void signed_distance (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const SignedDistanceType sign_type, const typename DerivedV::Scalar lower_bound, const typename DerivedV::Scalar upper_bound, Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedN > &N)
 Computes signed distance to a mesh.
 
template<typename DerivedP , typename DerivedV , typename DerivedF , typename DerivedS , typename DerivedI , typename DerivedC , typename DerivedN >
void signed_distance (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const SignedDistanceType sign_type, Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedN > &N)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedVN , typename DerivedEN , typename DerivedEMAP , typename Derivedq >
DerivedV::Scalar signed_distance_pseudonormal (const AABB< DerivedV, 3 > &tree, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedFN > &FN, const Eigen::MatrixBase< DerivedVN > &VN, const Eigen::MatrixBase< DerivedEN > &EN, const Eigen::MatrixBase< DerivedEMAP > &EMAP, const Eigen::MatrixBase< Derivedq > &q)
 Computes signed distance to mesh using pseudonormal with precomputed AABB tree and edge/vertice normals.
 
template<typename DerivedP , typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedVN , typename DerivedEN , typename DerivedEMAP , typename DerivedS , typename DerivedI , typename DerivedC , typename DerivedN >
void signed_distance_pseudonormal (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const AABB< DerivedV, 3 > &tree, const Eigen::MatrixBase< DerivedFN > &FN, const Eigen::MatrixBase< DerivedVN > &VN, const Eigen::MatrixBase< DerivedEN > &EN, const Eigen::MatrixBase< DerivedEMAP > &EMAP, Eigen::PlainObjectBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedN > &N)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.include/igl/signed_distance.h.
 
template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedVN , typename DerivedEN , typename DerivedEMAP , typename Derivedq , typename Scalar , typename Derivedc , typename Derivedn >
void signed_distance_pseudonormal (const AABB< DerivedV, 3 > &tree, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedFN > &FN, const Eigen::MatrixBase< DerivedVN > &VN, const Eigen::MatrixBase< DerivedEN > &EN, const Eigen::MatrixBase< DerivedEMAP > &EMAP, const Eigen::MatrixBase< Derivedq > &q, Scalar &s, Scalar &sqrd, int &i, Eigen::PlainObjectBase< Derivedc > &c, Eigen::PlainObjectBase< Derivedn > &n)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedE , typename DerivedEN , typename DerivedVN , typename Derivedq , typename Scalar , typename Derivedc , typename Derivedn >
void signed_distance_pseudonormal (const AABB< DerivedV, 2 > &tree, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedEN > &EN, const Eigen::MatrixBase< DerivedVN > &VN, const Eigen::MatrixBase< Derivedq > &q, Scalar &s, Scalar &sqrd, int &i, Eigen::PlainObjectBase< Derivedc > &c, Eigen::PlainObjectBase< Derivedn > &n)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename Derivedq >
DerivedV::Scalar signed_distance_winding_number (const AABB< DerivedV, 3 > &tree, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const igl::WindingNumberAABB< Derivedq, DerivedV, DerivedF > &hier, const Eigen::MatrixBase< Derivedq > &q)
 Computes signed distance to mesh using winding number with precomputed AABB.
 
template<typename DerivedV , typename DerivedF , typename Derivedq , typename Scalar , typename Derivedc >
void signed_distance_winding_number (const AABB< DerivedV, 3 > &tree, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const igl::WindingNumberAABB< Derivedq, DerivedV, DerivedF > &hier, const Eigen::MatrixBase< Derivedq > &q, Scalar &s, Scalar &sqrd, int &i, Eigen::PlainObjectBase< Derivedc > &c)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename Derivedq , typename Scalar , typename Derivedc >
void signed_distance_winding_number (const AABB< DerivedV, 2 > &tree, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< Derivedq > &q, Scalar &s, Scalar &sqrd, int &i, Eigen::PlainObjectBase< Derivedc > &c)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedP , typename DerivedV , typename DerivedF , typename DerivedS >
void signed_distance_fast_winding_number (const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const AABB< DerivedV, 3 > &tree, const igl::FastWindingNumberBVH &fwn_bvh, Eigen::PlainObjectBase< DerivedS > &S)
 Calculates signed distance at query points P, using fast winding number for sign.
 
template<typename Derivedq , typename DerivedV , typename DerivedF >
DerivedV::Scalar signed_distance_fast_winding_number (const Eigen::MatrixBase< Derivedq > &q, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const AABB< DerivedV, 3 > &tree, const igl::FastWindingNumberBVH &fwn_bvh)
 Calculates signed distance at query point q, using fast winding number for sign.
 
void simplify_polyhedron (const Eigen::MatrixXd &OV, const Eigen::MatrixXi &OF, Eigen::MatrixXd &V, Eigen::MatrixXi &F, Eigen::VectorXi &J)
 Simplify a polyhedron represented as a triangle mesh (OV,OF) by collapsing any edge that doesn't contribute to defining surface's pointset.
 
template<typename TX , typename TY , typename DerivedR , typename DerivedC >
void slice (const Eigen::SparseMatrix< TX > &X, const Eigen::DenseBase< DerivedR > &R, const Eigen::DenseBase< DerivedC > &C, Eigen::SparseMatrix< TY > &Y)
 Act like the matlab X(row_indices,col_indices) operator, where row_indices, col_indices are non-negative integer indices.
 
template<typename MatX , typename DerivedR , typename MatY >
void slice (const MatX &X, const Eigen::DenseBase< DerivedR > &R, const int dim, MatY &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<class T >
void slice (const std::vector< T > &X, std::vector< size_t > const &R, std::vector< T > &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY , typename DerivedR >
void slice (const Eigen::DenseBase< DerivedX > &X, const Eigen::DenseBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedY > &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedR , typename DerivedC , typename DerivedY >
void slice (const Eigen::DenseBase< DerivedX > &X, const Eigen::DenseBase< DerivedR > &R, const Eigen::DenseBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedY > &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedR >
DerivedX slice (const Eigen::DenseBase< DerivedX > &X, const Eigen::DenseBase< DerivedR > &R)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedR >
DerivedX slice (const Eigen::DenseBase< DerivedX > &X, const Eigen::DenseBase< DerivedR > &R, const int dim)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename TX , typename TY , typename DerivedI >
void slice_cached_precompute (const Eigen::SparseMatrix< TX > &X, const Eigen::Matrix< int, Eigen::Dynamic, 1 > &R, const Eigen::Matrix< int, Eigen::Dynamic, 1 > &C, Eigen::MatrixBase< DerivedI > &data, Eigen::SparseMatrix< TY > &Y)
 Act like the matlab X(row_indices,col_indices) operator, where row_indices, col_indices are non-negative integer indices.
 
template<typename TX , typename TY , typename DerivedI >
void slice_cached (const Eigen::SparseMatrix< TX > &X, const Eigen::MatrixBase< DerivedI > &data, Eigen::SparseMatrix< TY > &Y)
 Slice X by cached C,R indices into Y.
 
template<typename T , typename DerivedR , typename DerivedC >
void slice_into (const Eigen::SparseMatrix< T > &X, const Eigen::MatrixBase< DerivedR > &R, const Eigen::MatrixBase< DerivedC > &C, Eigen::SparseMatrix< T > &Y)
 Act like the matlab Y(row_indices,col_indices) = X.
 
template<typename MatX , typename MatY , typename DerivedR >
void slice_into (const MatX &X, const Eigen::MatrixBase< DerivedR > &R, const int dim, MatY &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY , typename DerivedR , typename DerivedC >
void slice_into (const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedR > &R, const Eigen::MatrixBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedY > &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedR , typename DerivedY >
void slice_into (const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedY > &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename XType , typename YType >
void slice_mask (const Eigen::SparseMatrix< XType > &X, const Eigen::Array< bool, Eigen::Dynamic, 1 > &R, const Eigen::Array< bool, Eigen::Dynamic, 1 > &C, Eigen::SparseMatrix< YType > &Y)
 Act like the matlab X(row_mask,col_mask) operator, where row_mask, col_mask are non-negative integer indices.
 
template<typename XType , typename YType >
void slice_mask (const Eigen::SparseMatrix< XType > &X, const Eigen::Array< bool, Eigen::Dynamic, 1 > &R, const int dim, Eigen::SparseMatrix< YType > &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY >
void slice_mask (const Eigen::DenseBase< DerivedX > &X, const Eigen::Array< bool, Eigen::Dynamic, 1 > &R, const Eigen::Array< bool, Eigen::Dynamic, 1 > &C, Eigen::PlainObjectBase< DerivedY > &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY >
void slice_mask (const Eigen::DenseBase< DerivedX > &X, const Eigen::Array< bool, Eigen::Dynamic, 1 > &R, const int dim, Eigen::PlainObjectBase< DerivedY > &Y)
 
template<typename DerivedX >
DerivedX slice_mask (const Eigen::DenseBase< DerivedX > &X, const Eigen::Array< bool, Eigen::Dynamic, 1 > &R, const Eigen::Array< bool, Eigen::Dynamic, 1 > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX >
DerivedX slice_mask (const Eigen::DenseBase< DerivedX > &X, const Eigen::Array< bool, Eigen::Dynamic, 1 > &R, const int dim)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename TX , typename TY , typename DerivedR , typename DerivedC >
void slice_sorted (const Eigen::SparseMatrix< TX > &X, const Eigen::DenseBase< DerivedR > &R, const Eigen::DenseBase< DerivedC > &C, Eigen::SparseMatrix< TY > &Y)
 Act like the matlab X(row_indices,col_indices) operator, where row_indices, col_indices are non-negative integer indices.
 
void slim_precompute (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::MatrixXd &V_init, SLIMData &data, MappingEnergyType slim_energy, const Eigen::VectorXi &b, const Eigen::MatrixXd &bc, double soft_p)
 Compute necessary information to start using SLIM.
 
Eigen::MatrixXd slim_solve (SLIMData &data, int iter_num)
 Run iter_num iterations of SLIM.
 
void slim_update_weights_and_closest_rotations_with_jacobians (const Eigen::MatrixXd &Ji, igl::MappingEnergyType slim_energy, double exp_factor, Eigen::MatrixXd &W, Eigen::MatrixXd &Ri)
 Internal Routine.
 
void slim_buildA (const Eigen::SparseMatrix< double > &Dx, const Eigen::SparseMatrix< double > &Dy, const Eigen::SparseMatrix< double > &Dz, const Eigen::MatrixXd &W, std::vector< Eigen::Triplet< double > > &IJV)
 Undocumented function related to SLIM optimization.
 
void smooth_corner_adjacency (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const double corner_threshold_radians, Eigen::VectorXi &CI, Eigen::VectorXi &CC)
 Determine the corner-to-face adjacency relationship that can be used for computing crease-aware per-corner normals.
 
void smooth_corner_adjacency (const Eigen::MatrixXi &FV, const Eigen::MatrixXi &FN, Eigen::VectorXi &CI, Eigen::VectorXi &CC)
 Determine the effective corner-to-face adjacency relationship implied by a set of indexed vertex positions (FV) and normals (FV) (e.g., those read in from a .obj file).
 
template<typename DerivedC , typename DerivedV , typename DerivedI , typename DerivedminD , typename DerivedVI >
void snap_points (const Eigen::MatrixBase< DerivedC > &C, const Eigen::MatrixBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedminD > &minD, Eigen::PlainObjectBase< DerivedVI > &VI)
 Snap list of points C to closest of another list of points V.
 
template<typename DerivedC , typename DerivedV , typename DerivedI , typename DerivedminD >
void snap_points (const Eigen::MatrixBase< DerivedC > &C, const Eigen::MatrixBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedminD > &minD)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedC , typename DerivedV , typename DerivedI >
void snap_points (const Eigen::MatrixBase< DerivedC > &C, const Eigen::MatrixBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedI > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalarq , typename Scalars >
bool snap_to_canonical_view_quat (const Eigen::Quaternion< Scalarq > &q, const double threshold, Eigen::Quaternion< Scalars > &s)
 Snap the quaternion q to the nearest canonical view quaternion.
 
template<typename Q_type >
bool snap_to_canonical_view_quat (const Q_type *q, const Q_type threshold, Q_type *s)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Qtype >
void snap_to_fixed_up (const Eigen::Quaternion< Qtype > &q, Eigen::Quaternion< Qtype > &s)
 Snap an arbitrary rotation to a rotation resulting from a rotation about the y-axis then the x-axis (maintaining fixed up like two_axis_valuator_fixed_up.)
 
template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedP >
DerivedA::Scalar solid_angle (const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< DerivedC > &C, const Eigen::MatrixBase< DerivedP > &P)
 Compute the signed solid angle subtended by the oriented 3d triangle (A,B,C) at some point P.
 
template<typename DerivedX , typename DerivedY , typename DerivedIX >
void sort (const Eigen::DenseBase< DerivedX > &X, const int dim, const bool ascending, Eigen::PlainObjectBase< DerivedY > &Y, Eigen::PlainObjectBase< DerivedIX > &IX)
 Sort the elements of a matrix X along a given dimension like matlabs sort function.
 
template<typename DerivedX , typename DerivedY >
void sort (const Eigen::DenseBase< DerivedX > &X, const int dim, const bool ascending, Eigen::PlainObjectBase< DerivedY > &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY , typename DerivedIX >
void sort_new (const Eigen::DenseBase< DerivedX > &X, const int dim, const bool ascending, Eigen::PlainObjectBase< DerivedY > &Y, Eigen::PlainObjectBase< DerivedIX > &IX)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY , typename DerivedIX >
void sort2 (const Eigen::DenseBase< DerivedX > &X, const int dim, const bool ascending, Eigen::PlainObjectBase< DerivedY > &Y, Eigen::PlainObjectBase< DerivedIX > &IX)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY , typename DerivedIX >
void sort3 (const Eigen::DenseBase< DerivedX > &X, const int dim, const bool ascending, Eigen::PlainObjectBase< DerivedY > &Y, Eigen::PlainObjectBase< DerivedIX > &IX)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<class T >
void sort (const std::vector< T > &unsorted, const bool ascending, std::vector< T > &sorted, std::vector< size_t > &index_map)
 Act like matlab's [Y,I] = SORT(X) for std library vectors.
 
template<typename DerivedM , typename DerivedR >
void sort_angles (const Eigen::MatrixBase< DerivedM > &M, Eigen::PlainObjectBase< DerivedR > &R)
 Sort angles in ascending order in a numerically robust way.
 
template<typename DerivedV , typename DerivedF , typename DerivedMV , typename DerivedP , typename DerivedFF , typename DerivedI >
void sort_triangles (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedMV > &MV, const Eigen::MatrixBase< DerivedP > &P, Eigen::PlainObjectBase< DerivedFF > &FF, Eigen::PlainObjectBase< DerivedI > &I)
 Sort triangles by depth (from back to front) using a painter's algorithm.
 
template<typename DerivedS , typename DerivedI >
void sort_vectors_ccw (const Eigen::PlainObjectBase< DerivedS > &P, const Eigen::PlainObjectBase< DerivedS > &N, Eigen::PlainObjectBase< DerivedI > &order, Eigen::PlainObjectBase< DerivedS > &sorted, Eigen::PlainObjectBase< DerivedI > &inv_order)
 Sorts a set of N coplanar vectors in a ccw order, and returns their order.
 
template<typename DerivedS , typename DerivedI >
void sort_vectors_ccw (const Eigen::PlainObjectBase< DerivedS > &P, const Eigen::PlainObjectBase< DerivedS > &N, Eigen::PlainObjectBase< DerivedI > &order, Eigen::PlainObjectBase< DerivedS > &sorted)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedS , typename DerivedI >
void sort_vectors_ccw (const Eigen::PlainObjectBase< DerivedS > &P, const Eigen::PlainObjectBase< DerivedS > &N, Eigen::PlainObjectBase< DerivedI > &order, Eigen::PlainObjectBase< DerivedI > &inv_order)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedS , typename DerivedI >
void sort_vectors_ccw (const Eigen::PlainObjectBase< DerivedS > &P, const Eigen::PlainObjectBase< DerivedS > &N, Eigen::PlainObjectBase< DerivedI > &order)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedX , typename DerivedY , typename DerivedI >
void sortrows (const Eigen::DenseBase< DerivedX > &X, const bool ascending, Eigen::PlainObjectBase< DerivedY > &Y, Eigen::PlainObjectBase< DerivedI > &I)
 Act like matlab's [Y,I] = sortrows(X)
 
template<typename DerivedX , typename DerivedY >
void sortrows (const Eigen::DenseBase< DerivedX > &X, const bool ascending, Eigen::PlainObjectBase< DerivedY > &Y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<class IndexVectorI , class IndexVectorJ , class ValueVector , typename T >
void sparse (const IndexVectorI &I, const IndexVectorJ &J, const ValueVector &V, const size_t m, const size_t n, Eigen::SparseMatrix< T > &X)
 Build a sparse matrix from list of indices and values (I,J,V), functions like the sparse function in matlab.
 
template<class IndexVector , class ValueVector , typename T >
void sparse (const IndexVector &I, const IndexVector &J, const ValueVector &V, Eigen::SparseMatrix< T > &X)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedD , typename T >
void sparse (const Eigen::PlainObjectBase< DerivedD > &D, Eigen::SparseMatrix< T > &X)
 Convert a full, dense matrix to a sparse one.
 
template<typename DerivedD >
Eigen::SparseMatrix< typename DerivedD::Scalar > sparse (const Eigen::PlainObjectBase< DerivedD > &D)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedI , typename Scalar >
void sparse_cached_precompute (const Eigen::MatrixBase< DerivedI > &I, const Eigen::MatrixBase< DerivedI > &J, Eigen::VectorXi &data, Eigen::SparseMatrix< Scalar > &X)
 Build a sparse matrix from list of indices and values (I,J,V), similarly to the sparse function in matlab.
 
template<typename Scalar >
void sparse_cached_precompute (const std::vector< Eigen::Triplet< Scalar > > &triplets, Eigen::VectorXi &data, Eigen::SparseMatrix< Scalar > &X)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar >
void sparse_cached (const std::vector< Eigen::Triplet< Scalar > > &triplets, const Eigen::VectorXi &data, Eigen::SparseMatrix< Scalar > &X)
 Build a sparse matrix from cached list of data and values.
 
template<typename DerivedV , typename Scalar >
void sparse_cached (const Eigen::MatrixBase< DerivedV > &V, const Eigen::VectorXi &data, Eigen::SparseMatrix< Scalar > &X)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedP0 , typename Func , typename DerivedS , typename DerivedV , typename DerivedI >
void sparse_voxel_grid (const Eigen::MatrixBase< DerivedP0 > &p0, const Func &scalarFunc, const double eps, const int expected_number_of_cubes, Eigen::PlainObjectBase< DerivedS > &CS, Eigen::PlainObjectBase< DerivedV > &CV, Eigen::PlainObjectBase< DerivedI > &CI)
 Given a point, p0, on an isosurface, construct a shell of epsilon sized cubes surrounding the surface.
 
template<typename T >
void speye (const int n, const int m, Eigen::SparseMatrix< T > &I)
 Builds an m by n sparse identity matrix like matlab's speye function.
 
template<typename T >
void speye (const int n, Eigen::SparseMatrix< T > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedSF , typename DerivedSVI >
void split_nonmanifold (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedSF > &SF, Eigen::PlainObjectBase< DerivedSVI > &SVI)
 Split a non-manifold (or non-orientable) mesh into a orientable manifold mesh possibly with more connected components and geometrically duplicate vertices.
 
template<typename DerivedV , typename DerivedF , typename DerivedSV , typename DerivedSF , typename DerivedSVI >
void split_nonmanifold (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedSV > &SV, Eigen::PlainObjectBase< DerivedSF > &SF, Eigen::PlainObjectBase< DerivedSVI > &SVI)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedL >
void squared_edge_lengths (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedL > &L)
 Constructs a list of squared lengths of edges opposite each index in a face (triangle/tet) list.
 
bool stdin_to_temp (FILE **temp_file)
 Write stdin/piped input to a temporary file which can than be preprocessed as it is (a normal file).
 
template<typename DerivedV , typename DerivedF , typename DerivedVT , typename DerivedFT , typename Scalar , typename DerivedUE , typename DerivedUT , typename DerivedOT >
void straighten_seams (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedVT > &VT, const Eigen::MatrixBase< DerivedFT > &FT, const Scalar tol, Eigen::PlainObjectBase< DerivedUE > &UE, Eigen::PlainObjectBase< DerivedUT > &UT, Eigen::PlainObjectBase< DerivedOT > &OT)
 Given a obj-style mesh with (V,F) defining the geometric surface of the mesh and (VT,FT) defining the parameterization/texture-mapping of the mesh in the uv-domain, find all seams and boundaries in the texture-mapping and "straighten" them, remapping vertices along the boundary and in the interior.
 
bool starts_with (const std::string &str, const std::string &prefix)
 Check if a string starts with a given prefix.
 
bool starts_with (const char *str, const char *prefix)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.include/igl/string_utils.h.
 
template<typename T >
void sum (const Eigen::SparseMatrix< T > &X, const int dim, Eigen::SparseVector< T > &S)
 Sum the columns or rows of a sparse matrix.
 
template<typename AType , typename DerivedB >
void sum (const Eigen::SparseMatrix< AType > &A, const int dim, Eigen::PlainObjectBase< DerivedB > &B)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void svd3x3 (const Eigen::Matrix< T, 3, 3 > &A, Eigen::Matrix< T, 3, 3 > &U, Eigen::Matrix< T, 3, 1 > &S, Eigen::Matrix< T, 3, 3 > &V)
 Super fast 3x3 SVD according to http://pages.cs.wisc.edu/~sifakis/project_pages/svd.html The resulting decomposition is A = U * diag(S[0], S[1], S[2]) * V'.
 
template<typename T >
void svd3x3_avx (const Eigen::Matrix< T, 3 *8, 3 > &A, Eigen::Matrix< T, 3 *8, 3 > &U, Eigen::Matrix< T, 3 *8, 1 > &S, Eigen::Matrix< T, 3 *8, 3 > &V)
 Super fast 3x3 SVD according to http://pages.cs.wisc.edu/~sifakis/project_pages/svd.html This is AVX version of svd3x3 (see svd3x3.h) which works on 8 matrices at a time These eight matrices are simply stacked in columns, the rest is the same as for svd3x3.
 
template<typename T >
void svd3x3_sse (const Eigen::Matrix< T, 3 *4, 3 > &A, Eigen::Matrix< T, 3 *4, 3 > &U, Eigen::Matrix< T, 3 *4, 1 > &S, Eigen::Matrix< T, 3 *4, 3 > &V)
 
void swept_volume (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const std::function< Eigen::Affine3d(const double t)> &transform, const size_t steps, const size_t grid_res, const size_t isolevel, Eigen::MatrixXd &SV, Eigen::MatrixXi &SF)
 Compute the surface of the swept volume of a solid object with surface (V,F) mesh under going rigid motion.
 
void swept_volume_bounding_box (const size_t &n, const std::function< Eigen::RowVector3d(const size_t vi, const double t)> &V, const size_t &steps, Eigen::AlignedBox3d &box)
 Construct an axis-aligned bounding box containing a shape undergoing a motion sampled at steps discrete momements.
 
void swept_volume_signed_distance (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const std::function< Eigen::Affine3d(const double t)> &transform, const size_t &steps, const Eigen::MatrixXd &GV, const Eigen::RowVector3i &res, const double h, const double isolevel, const Eigen::VectorXd &S0, Eigen::VectorXd &S)
 Compute the signed distance to a sweep surface of a mesh under-going an arbitrary motion V(t) discretely sampled at steps-many moments in time at a grid.
 
void swept_volume_signed_distance (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const std::function< Eigen::Affine3d(const double t)> &transform, const size_t &steps, const Eigen::MatrixXd &GV, const Eigen::RowVector3i &res, const double h, const double isolevel, Eigen::VectorXd &S)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar >
Scalar tan_half_angle (const Scalar &a, const Scalar &b, const Scalar &c)
 Compute the tangent of half of the angle opposite the side with length a, in a triangle with side lengths (a,b,c).
 
template<typename DerivedT , typename DerivedTT , typename DerivedTTi >
void tet_tet_adjacency (const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedTT > &TT, Eigen::PlainObjectBase< DerivedTTi > &TTi)
 Constructs the tet_tet adjacency matrix for a given tet mesh with tets T.
 
template<typename DerivedT , typename DerivedTT >
void tet_tet_adjacency (const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedTT > &TT)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedGV , typename DerivedGT >
void tetrahedralized_grid (const int nx, const int ny, const int nz, const TetrahedralizedGripType type, Eigen::PlainObjectBase< DerivedGV > &GV, Eigen::PlainObjectBase< DerivedGT > &GT)
 Construct vertices of a regular grid, suitable for input to igl::marching_tets
 
template<typename Derivedside , typename DerivedGT >
void tetrahedralized_grid (const Eigen::MatrixBase< Derivedside > &side, const TetrahedralizedGripType type, Eigen::PlainObjectBase< DerivedGT > &GT)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename VectorIndex , typename DerivedF_filled >
void topological_hole_fill (const Eigen::MatrixBase< DerivedF > &F, const std::vector< VectorIndex > &holes, Eigen::PlainObjectBase< DerivedF_filled > &F_filled)
 Topological fill hole on a mesh, with one additional vertex each hole Index of new abstract vertices will be F.maxCoeff() + (index of hole)
 
template<typename Q_type >
void trackball (const double w, const double h, const Q_type speed_factor, const double down_mouse_x, const double down_mouse_y, const double mouse_x, const double mouse_y, Q_type *quat)
 Applies a trackball drag to identity.
 
template<typename Q_type >
void trackball (const double w, const double h, const Q_type speed_factor, const Q_type *down_quat, const double down_mouse_x, const double down_mouse_y, const double mouse_x, const double mouse_y, Q_type *quat)
 Applies a trackball drag to a given rotation.
 
template<typename Scalardown_quat , typename Scalarquat >
void trackball (const double w, const double h, const double speed_factor, const Eigen::Quaternion< Scalardown_quat > &down_quat, const double down_mouse_x, const double down_mouse_y, const double mouse_x, const double mouse_y, Eigen::Quaternion< Scalarquat > &quat)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void transpose_blocks (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &A, const size_t k, const size_t dim, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &B)
 Transpose blocks of a matrix.
 
template<typename DerivedP1 , typename DerivedQ1 , typename DerivedR1 , typename DerivedP2 , typename DerivedQ2 , typename DerivedR2 >
bool tri_tri_overlap_test_3d (const Eigen::MatrixBase< DerivedP1 > &p1, const Eigen::MatrixBase< DerivedQ1 > &q1, const Eigen::MatrixBase< DerivedR1 > &r1, const Eigen::MatrixBase< DerivedP2 > &p2, const Eigen::MatrixBase< DerivedQ2 > &q2, const Eigen::MatrixBase< DerivedR2 > &r2)
 
template<typename DerivedP1 , typename DerivedQ1 , typename DerivedR1 , typename DerivedP2 , typename DerivedQ2 , typename DerivedR2 , typename DerivedS , typename DerivedT >
bool tri_tri_intersection_test_3d (const Eigen::MatrixBase< DerivedP1 > &p1, const Eigen::MatrixBase< DerivedQ1 > &q1, const Eigen::MatrixBase< DerivedR1 > &r1, const Eigen::MatrixBase< DerivedP2 > &p2, const Eigen::MatrixBase< DerivedQ2 > &q2, const Eigen::MatrixBase< DerivedR2 > &r2, bool &coplanar, Eigen::MatrixBase< DerivedS > &source, Eigen::MatrixBase< DerivedT > &target)
 
template<typename DerivedP1 , typename DerivedQ1 , typename DerivedR1 , typename DerivedP2 , typename DerivedQ2 , typename DerivedR2 >
bool tri_tri_overlap_test_2d (const Eigen::MatrixBase< DerivedP1 > &p1, const Eigen::MatrixBase< DerivedQ1 > &q1, const Eigen::MatrixBase< DerivedR1 > &r1, const Eigen::MatrixBase< DerivedP2 > &p2, const Eigen::MatrixBase< DerivedQ2 > &q2, const Eigen::MatrixBase< DerivedR2 > &r2)
 
template<typename DerivedE , typename Derivedcap >
void triangle_fan (const Eigen::MatrixBase< DerivedE > &E, Eigen::PlainObjectBase< Derivedcap > &cap)
 Given a list of faces tessellate all of the "exterior" edges forming another list of.
 
Eigen::MatrixXi triangle_fan (const Eigen::MatrixXi &E)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedTT , typename DerivedTTi >
void triangle_triangle_adjacency (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedTT > &TT, Eigen::PlainObjectBase< DerivedTTi > &TTi)
 Constructs the triangle-triangle adjacency matrix for a given mesh (V,F).
 
template<typename DerivedF , typename DerivedTT >
void triangle_triangle_adjacency (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedTT > &TT)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename TTT_type >
void triangle_triangle_adjacency_preprocess (const Eigen::MatrixBase< DerivedF > &F, std::vector< std::vector< TTT_type > > &TTT)
 Preprocessing for triangle_triangle_adjacency.
 
template<typename DerivedF , typename TTT_type , typename DerivedTT >
void triangle_triangle_adjacency_extractTT (const Eigen::MatrixBase< DerivedF > &F, std::vector< std::vector< TTT_type > > &TTT, Eigen::PlainObjectBase< DerivedTT > &TT)
 Extract the face adjacencies for triangle_triangle_adjacency.
 
template<typename DerivedF , typename TTT_type , typename DerivedTTi >
void triangle_triangle_adjacency_extractTTi (const Eigen::MatrixBase< DerivedF > &F, std::vector< std::vector< TTT_type > > &TTT, Eigen::PlainObjectBase< DerivedTTi > &TTi)
 Extract the face adjacencies indices for triangle_triangle_adjacency.
 
template<typename DerivedF , typename TTIndex , typename TTiIndex >
void triangle_triangle_adjacency (const Eigen::MatrixBase< DerivedF > &F, std::vector< std::vector< std::vector< TTIndex > > > &TT, std::vector< std::vector< std::vector< TTiIndex > > > &TTi)
 Adjacency list version, which works with non-manifold meshes.
 
template<typename DerivedF , typename TTIndex >
void triangle_triangle_adjacency (const Eigen::MatrixBase< DerivedF > &F, std::vector< std::vector< std::vector< TTIndex > > > &TT)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename TTIndex , typename TTiIndex >
void triangle_triangle_adjacency (const Eigen::MatrixBase< DerivedF > &F, const bool construct_TTi, std::vector< std::vector< std::vector< TTIndex > > > &TT, std::vector< std::vector< std::vector< TTiIndex > > > &TTi)
 
template<typename DerivedE , typename DerivedEMAP , typename uE2EType , typename TTIndex , typename TTiIndex >
void triangle_triangle_adjacency (const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedEMAP > &EMAP, const std::vector< std::vector< uE2EType > > &uE2E, const bool construct_TTi, std::vector< std::vector< std::vector< TTIndex > > > &TT, std::vector< std::vector< std::vector< TTiIndex > > > &TTi)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedEMAP , typename DeriveduEC , typename DeriveduEE , typename TTIndex , typename TTiIndex >
void triangle_triangle_adjacency (const Eigen::MatrixBase< DerivedEMAP > &EMAP, const Eigen::MatrixBase< DeriveduEC > &uEC, const Eigen::MatrixBase< DeriveduEE > &uEE, const bool construct_TTi, std::vector< std::vector< std::vector< TTIndex > > > &TT, std::vector< std::vector< std::vector< TTiIndex > > > &TTi)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedS , typename DerivedF >
void triangles_from_strip (const Eigen::MatrixBase< DerivedS > &S, Eigen::PlainObjectBase< DerivedF > &F)
 Create a list of triangles from a stream of indices along a strip.
 
template<typename XType , typename YType , typename DerivedGV , typename DerivedGF >
void triangulated_grid (const XType &nx, const YType &ny, Eigen::PlainObjectBase< DerivedGV > &GV, Eigen::PlainObjectBase< DerivedGF > &GF)
 Create a regular grid of elements (only 2D supported, currently) Vertex position order is compatible with igl::grid
 
template<typename XType , typename YType , typename DerivedGF >
void triangulated_grid (const XType &nx, const YType &ny, Eigen::PlainObjectBase< DerivedGF > &GF)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV >
DerivedV::Scalar turning_number (const Eigen::MatrixBase< DerivedV > &V)
 Compute the turning number of a closed curve in the plane.
 
template<typename Scalardown_quat , typename Scalarquat >
void two_axis_valuator_fixed_up (const int w, const int h, const double speed, const Eigen::Quaternion< Scalardown_quat > &down_quat, const int down_x, const int down_y, const int mouse_x, const int mouse_y, Eigen::Quaternion< Scalarquat > &quat)
 Applies a two-axis valuator drag rotation (as seen in Maya/Studio max) to a given rotation.
 
void uniformly_sample_two_manifold (const Eigen::MatrixXd &W, const Eigen::MatrixXi &F, const int k, const double push, Eigen::MatrixXd &WS)
 Attempt to sample a mesh uniformly with k-points by furthest point relaxation as described in "Fast Automatic Skinning Transformations" [Jacobson et al.
 
void uniformly_sample_two_manifold_at_vertices (const Eigen::MatrixXd &W, const int k, const double push, Eigen::VectorXi &S)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.include/igl/uniformly_sample_two_manifold.h.
 
template<typename T >
void unique (const std::vector< T > &A, std::vector< T > &C, std::vector< size_t > &IA, std::vector< size_t > &IC)
 Act like matlab's [C,IA,IC] = unique(X)
 
template<typename T >
void unique (const std::vector< T > &A, std::vector< T > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA , typename DerivedC , typename DerivedIA , typename DerivedIC >
void unique (const Eigen::MatrixBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedIA > &IA, Eigen::PlainObjectBase< DerivedIC > &IC)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA , typename DerivedC >
void unique (const Eigen::MatrixBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedE , typename DeriveduE , typename DerivedEMAP , typename uE2EType >
void unique_edge_map (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DeriveduE > &uE, Eigen::PlainObjectBase< DerivedEMAP > &EMAP, std::vector< std::vector< uE2EType > > &uE2E)
 Construct relationships between facet "half"-(or rather "viewed")-edges E to unique edges of the mesh seen as a graph.
 
template<typename DerivedF , typename DerivedE , typename DeriveduE , typename DerivedEMAP >
void unique_edge_map (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DeriveduE > &uE, Eigen::PlainObjectBase< DerivedEMAP > &EMAP)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedE , typename DeriveduE , typename DerivedEMAP , typename DeriveduEC , typename DeriveduEE >
void unique_edge_map (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &E, Eigen::PlainObjectBase< DeriveduE > &uE, Eigen::PlainObjectBase< DerivedEMAP > &EMAP, Eigen::PlainObjectBase< DeriveduEC > &uEC, Eigen::PlainObjectBase< DeriveduEE > &uEE)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedA , typename DerivedC , typename DerivedIA , typename DerivedIC >
void unique_rows (const Eigen::DenseBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedIA > &IA, Eigen::PlainObjectBase< DerivedIC > &IC)
 Act like matlab's [C,IA,IC] = unique(X,'rows')
 
template<typename DerivedF , typename DerivedFF , typename DerivedIA , typename DerivedIC >
void unique_simplices (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedFF > &FF, Eigen::PlainObjectBase< DerivedIA > &IA, Eigen::PlainObjectBase< DerivedIC > &IC)
 Find combinatorially unique simplices in F.
 
template<typename DerivedF , typename DerivedFF >
void unique_simplices (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedFF > &FF)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Derivedwin , typename Derivedmodel , typename Derivedproj , typename Derivedviewport , typename Derivedscene >
void unproject (const Eigen::MatrixBase< Derivedwin > &win, const Eigen::MatrixBase< Derivedmodel > &model, const Eigen::MatrixBase< Derivedproj > &proj, const Eigen::MatrixBase< Derivedviewport > &viewport, Eigen::PlainObjectBase< Derivedscene > &scene)
 Eigen reimplementation of gluUnproject.
 
template<typename Scalar >
Eigen::Matrix< Scalar, 3, 1 > unproject (const Eigen::Matrix< Scalar, 3, 1 > &win, const Eigen::Matrix< Scalar, 4, 4 > &model, const Eigen::Matrix< Scalar, 4, 4 > &proj, const Eigen::Matrix< Scalar, 4, 1 > &viewport)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename Derivedobj >
int unproject_in_mesh (const Eigen::Vector2f &pos, const Eigen::Matrix4f &model, const Eigen::Matrix4f &proj, const Eigen::Vector4f &viewport, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< Derivedobj > &obj, std::vector< igl::Hit > &hits)
 Unproject a screen location (using current opengl viewport, projection, and model view) to a 3D position inside a given mesh.
 
template<typename DerivedV , typename DerivedF , typename Derivedobj >
int unproject_in_mesh (const Eigen::Vector2f &pos, const Eigen::Matrix4f &model, const Eigen::Matrix4f &proj, const Eigen::Vector4f &viewport, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< Derivedobj > &obj)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Derivedobj >
int unproject_in_mesh (const Eigen::Vector2f &pos, const Eigen::Matrix4f &model, const Eigen::Matrix4f &proj, const Eigen::Vector4f &viewport, const std::function< void(const Eigen::Vector3f &, const Eigen::Vector3f &, std::vector< igl::Hit > &) > &shoot_ray, Eigen::PlainObjectBase< Derivedobj > &obj, std::vector< igl::Hit > &hits)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedUV , typename DerivedM , typename DerivedVP , typename Derivedorigin , typename Deriveddir >
void unproject_on_line (const Eigen::MatrixBase< DerivedUV > &UV, const Eigen::MatrixBase< DerivedM > &M, const Eigen::MatrixBase< DerivedVP > &VP, const Eigen::MatrixBase< Derivedorigin > &origin, const Eigen::MatrixBase< Deriveddir > &dir, typename DerivedUV::Scalar &t)
 Given a screen space point (u,v) and the current projection matrix (e.g.
 
template<typename DerivedUV , typename DerivedM , typename DerivedVP , typename Derivedorigin , typename Deriveddir , typename DerivedZ >
void unproject_on_line (const Eigen::MatrixBase< DerivedUV > &UV, const Eigen::MatrixBase< DerivedM > &M, const Eigen::MatrixBase< DerivedVP > &VP, const Eigen::MatrixBase< Derivedorigin > &origin, const Eigen::MatrixBase< Deriveddir > &dir, Eigen::PlainObjectBase< DerivedZ > &Z)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedUV , typename DerivedM , typename DerivedVP , typename DerivedP , typename DerivedZ >
void unproject_on_plane (const Eigen::MatrixBase< DerivedUV > &UV, const Eigen::MatrixBase< DerivedM > &M, const Eigen::MatrixBase< DerivedVP > &VP, const Eigen::MatrixBase< DerivedP > &P, Eigen::PlainObjectBase< DerivedZ > &Z)
 Given a screen space point (u,v) and the current projection matrix (e.g.
 
template<typename DerivedV , typename DerivedF , typename Derivedbc >
bool unproject_onto_mesh (const Eigen::Vector2f &pos, const Eigen::Matrix4f &model, const Eigen::Matrix4f &proj, const Eigen::Vector4f &viewport, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, int &fid, Eigen::PlainObjectBase< Derivedbc > &bc)
 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.
 
template<typename Derivedbc >
bool unproject_onto_mesh (const Eigen::Vector2f &pos, const Eigen::Matrix4f &model, const Eigen::Matrix4f &proj, const Eigen::Vector4f &viewport, const std::function< bool(const Eigen::Vector3f &, const Eigen::Vector3f &, igl::Hit &) > &shoot_ray, int &fid, Eigen::PlainObjectBase< Derivedbc > &bc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Derivedpos , typename Derivedmodel , typename Derivedproj , typename Derivedviewport , typename Deriveds , typename Deriveddir >
void unproject_ray (const Eigen::MatrixBase< Derivedpos > &pos, const Eigen::MatrixBase< Derivedmodel > &model, const Eigen::MatrixBase< Derivedproj > &proj, const Eigen::MatrixBase< Derivedviewport > &viewport, Eigen::PlainObjectBase< Deriveds > &s, Eigen::PlainObjectBase< Deriveddir > &dir)
 Construct a ray (source point + direction vector) given a screen space positions (e.g.
 
template<typename DerivedA , typename DerivedU , typename DerivedG , typename DerivedJ >
void unzip_corners (const std::vector< std::reference_wrapper< DerivedA > > &A, Eigen::PlainObjectBase< DerivedU > &U, Eigen::PlainObjectBase< DerivedG > &G, Eigen::PlainObjectBase< DerivedJ > &J)
 Given a triangle mesh where corners of each triangle index different matrices of attributes (e.g.
 
template<typename DerivedF , typename SType , typename DerivedNF >
void upsample (const int n_verts, const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< SType > &S, Eigen::PlainObjectBase< DerivedNF > &NF)
 Subdivide without moving vertices: Given the triangle mesh [V, F], where n_verts = V.rows(), computes newV and a sparse matrix S s.t.
 
template<typename DerivedV , typename DerivedF , typename DerivedNV , typename DerivedNF >
void upsample (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedNV > &NV, Eigen::PlainObjectBase< DerivedNF > &NF, const int number_of_subdivs=1)
 Subdivide a mesh without moving vertices: loop subdivision but odd vertices stay put and even vertices are just edge midpoints.
 
template<typename MatV , typename MatF >
void upsample (MatV &V, MatF &F, const int number_of_subdivs=1)
 
template<typename DerivedF , typename Scalar >
void vector_area_matrix (const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< Scalar > &A)
 Constructs the symmetric area matrix A, s.t.
 
int verbose (const char *msg,...)
 Provide a wrapper for printf, called verbose that functions exactly like printf if VERBOSE is defined and does exactly nothing if VERBOSE is undefined.
 
template<typename DerivedA , typename DerivedC , typename Derivedcounts >
void vertex_components (const Eigen::SparseCompressedBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< Derivedcounts > &counts)
 Compute connected components of a graph represented by an adjacency matrix.
 
template<typename DerivedA , typename DerivedC >
void vertex_components (const Eigen::SparseCompressedBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedC >
void vertex_components (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedC > &C)
 Compute the connected components for a mesh given its faces.
 
template<typename DerivedF , typename VFType , typename VFiType >
void vertex_triangle_adjacency (const typename DerivedF::Scalar n, const Eigen::MatrixBase< DerivedF > &F, std::vector< std::vector< VFType > > &VF, std::vector< std::vector< VFiType > > &VFi)
 vertex_face_adjacency constructs the vertex-face topology of a given mesh (V,F)
 
template<typename DerivedV , typename DerivedF , typename IndexType >
void vertex_triangle_adjacency (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, std::vector< std::vector< IndexType > > &VF, std::vector< std::vector< IndexType > > &VFi)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedF , typename DerivedVF , typename DerivedNI >
void vertex_triangle_adjacency (const Eigen::MatrixBase< DerivedF > &F, const int n, Eigen::PlainObjectBase< DerivedVF > &VF, Eigen::PlainObjectBase< DerivedNI > &NI)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedT , typename Derivedvol >
void volume (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< Derivedvol > &vol)
 Compute volume for all tets of a given tet mesh (V,T)
 
template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedD , typename Derivedvol >
void volume (const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, const Eigen::MatrixBase< DerivedC > &C, const Eigen::MatrixBase< DerivedD > &D, Eigen::PlainObjectBase< Derivedvol > &vol)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename VecA , typename VecB , typename VecC , typename VecD >
VecA::Scalar volume_single (const VecA &a, const VecB &b, const VecC &c, const VecD &d)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedL , typename Derivedvol >
void volume (const Eigen::MatrixBase< DerivedL > &L, Eigen::PlainObjectBase< Derivedvol > &vol)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename DerivedGV , typename Derivedside >
void voxel_grid (const Eigen::AlignedBox< Scalar, 3 > &box, const int s, const int pad_count, Eigen::PlainObjectBase< DerivedGV > &GV, Eigen::PlainObjectBase< Derivedside > &side)
 Construct the cell center positions of a regular voxel grid (lattice) made of perfectly square voxels.
 
template<typename DerivedV , typename DerivedGV , typename Derivedside >
void voxel_grid (const Eigen::MatrixBase< DerivedV > &V, const typename DerivedV::Scalar offset, const int s, const int pad_count, Eigen::PlainObjectBase< DerivedGV > &GV, Eigen::PlainObjectBase< Derivedside > &side)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedO , typename DerivedW >
void winding_number (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedO > &O, Eigen::PlainObjectBase< DerivedW > &W)
 Computes the generalized winding number at each dim-dimensional query point in O with respect to the oriented one-codimensional mesh (V,F).
 
template<typename DerivedV , typename DerivedF , typename Derivedp >
DerivedV::Scalar winding_number (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< Derivedp > &p)
 Compute winding number of a single point.
 
template<typename DerivedV , typename DerivedF >
bool write_triangle_mesh (const std::string str, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, FileEncoding encoding=FileEncoding::Ascii)
 write mesh to a file with automatic detection of file format.
 
template<typename DerivedWI , typename DerivedP , typename DerivedO >
bool writeBF (const std::string &filename, const Eigen::PlainObjectBase< DerivedWI > &WI, const Eigen::PlainObjectBase< DerivedP > &P, const Eigen::PlainObjectBase< DerivedO > &O)
 Write a bones forest to a file.
 
template<typename DerivedW >
bool writeDMAT (const std::string file_name, const Eigen::MatrixBase< DerivedW > &W, const bool ascii=true)
 Write a matrix using ascii dmat file type.
 
template<typename Scalar >
bool writeDMAT (const std::string file_name, const std::vector< std::vector< Scalar > > &W, const bool ascii=true)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar >
bool writeDMAT (const std::string file_name, const std::vector< Scalar > &W, const bool ascii=true)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Scalar , typename Index >
bool writeMESH (const std::string mesh_file_name, const std::vector< std::vector< Scalar > > &V, const std::vector< std::vector< Index > > &T, const std::vector< std::vector< Index > > &F)
 save a tetrahedral volume mesh to a .mesh file
 
template<typename DerivedV , typename DerivedT , typename DerivedF >
bool writeMESH (const std::string str, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, const Eigen::MatrixBase< DerivedF > &F)
 save a tetrahedral volume mesh to a .mesh file
 
bool writeMSH (const std::string &msh, const Eigen::MatrixXd &X, const Eigen::MatrixXi &Tri, const Eigen::MatrixXi &Tet, const Eigen::MatrixXi &TriTag, const Eigen::MatrixXi &TetTag, const std::vector< std::string > &XFields, const std::vector< Eigen::MatrixXd > &XF, const std::vector< std::string > &EFields, const std::vector< Eigen::MatrixXd > &TriF, const std::vector< Eigen::MatrixXd > &TetF)
 write triangle surface mesh and tetrahedral volume mesh to .msh file
 
template<typename DerivedV , typename DerivedF , typename DerivedCN , typename DerivedFN , typename DerivedTC , typename DerivedFTC >
bool writeOBJ (const std::string str, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedCN > &CN, const Eigen::MatrixBase< DerivedFN > &FN, const Eigen::MatrixBase< DerivedTC > &TC, const Eigen::MatrixBase< DerivedFTC > &FTC)
 Write a mesh in an ascii obj file.
 
template<typename DerivedV , typename DerivedF >
bool writeOBJ (const std::string str, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename T >
bool writeOBJ (const std::string &str, const Eigen::MatrixBase< DerivedV > &V, const std::vector< std::vector< T > > &F)
 Write a mesh of mixed tris and quads to an ascii obj file.
 
template<typename DerivedV , typename DerivedF , typename DerivedC >
bool writeOFF (const std::string str, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedC > &C)
 Export geometry and colors-by-vertex to an ascii OFF file.
 
template<typename DerivedV , typename DerivedF >
bool writeOFF (const std::string str, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV , typename DerivedVD , typename DerivedFD , typename DerivedED >
bool writePLY (std::ostream &ply_stream, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedUV > &UV, const Eigen::MatrixBase< DerivedVD > &VD, const std::vector< std::string > &VDheader, const Eigen::MatrixBase< DerivedFD > &FD, const std::vector< std::string > &FDheader, const Eigen::MatrixBase< DerivedED > &ED, const std::vector< std::string > &EDheader, const std::vector< std::string > &comments, FileEncoding encoding)
 write triangular mesh to ply file
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV , typename DerivedVD , typename DerivedFD , typename DerivedED >
bool writePLY (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedUV > &UV, const Eigen::MatrixBase< DerivedVD > &VD, const std::vector< std::string > &VDheader, const Eigen::MatrixBase< DerivedFD > &FD, const std::vector< std::string > &FDheader, const Eigen::MatrixBase< DerivedED > &ED, const std::vector< std::string > &EDheader, const std::vector< std::string > &comments, FileEncoding encoding)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
bool writePLY (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedE >
bool writePLY (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedF > &E)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedUV >
bool writePLY (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedUV > &UV)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV >
bool writePLY (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedUV > &UV)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
bool writePLY (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, FileEncoding encoding)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedE >
bool writePLY (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, FileEncoding encoding)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedUV , typename DerivedVD >
bool writePLY (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedUV > &UV, const Eigen::MatrixBase< DerivedVD > &VD=Eigen::MatrixXd(0, 0), const std::vector< std::string > &VDheader={}, const std::vector< std::string > &comments={})
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV , typename DerivedVD >
bool writePLY (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedE > &E, const Eigen::MatrixBase< DerivedN > &N, const Eigen::MatrixBase< DerivedUV > &UV, const Eigen::MatrixBase< DerivedVD > &VD=Eigen::MatrixXd(0, 0), const std::vector< std::string > &VDheader={}, const std::vector< std::string > &comments={})
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF , typename DerivedN >
bool writeSTL (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedN > &N, FileEncoding encoding=FileEncoding::Ascii)
 Write a mesh to an stl file.
 
template<typename DerivedV , typename DerivedF >
bool writeSTL (const std::string &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, FileEncoding encoding=FileEncoding::Ascii)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool writeTGF (const std::string tgf_filename, const std::vector< std::vector< double > > &C, const std::vector< std::vector< int > > &E)
 Write a graph to a .tgf file.
 
bool writeTGF (const std::string tgf_filename, const Eigen::MatrixXd &C, const Eigen::MatrixXi &E)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename DerivedV , typename DerivedF >
bool writeWRL (const std::string &str, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F)
 Write mesh to a .wrl file.
 
template<typename DerivedV , typename DerivedF , typename DerivedC >
bool writeWRL (const std::string &str, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedC > &C)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Variables

const float IDENTITY_QUAT_F [4] = {0,0,0,1}
 
const float XY_PLANE_QUAT_F [4] = {0,0,0,1}
 
const float XZ_PLANE_QUAT_F [4] = {-SQRT_2_OVER_2,0,0,SQRT_2_OVER_2}
 
const float YZ_PLANE_QUAT_F [4] = {-0.5,-0.5,-0.5,0.5}
 
const float CANONICAL_VIEW_QUAT_F [][4]
 
const double IDENTITY_QUAT_D [4] = {0,0,0,1}
 
const double XY_PLANE_QUAT_D [4] = {0,0,0,1}
 
const double XZ_PLANE_QUAT_D [4] = {-SQRT_2_OVER_2,0,0,SQRT_2_OVER_2}
 
const double YZ_PLANE_QUAT_D [4] = {-0.5,-0.5,-0.5,0.5}
 
const double CANONICAL_VIEW_QUAT_D [][4]
 
const double DOUBLE_EPS = 1.0e-14
 Standard value for double epsilon.
 
const double DOUBLE_EPS_SQ = 1.0e-28
 Standard value for double epsilon²
 
const float FLOAT_EPS = 1.0e-7f
 Standard value for single epsilon.
 
const float FLOAT_EPS_SQ = 1.0e-14f
 Standard value for single epsilon²
 
const float GOLD_AMBIENT [4] = { 51.0/255.0, 43.0/255.0,33.3/255.0,1.0f }
 
const float GOLD_DIFFUSE [4] = { 255.0/255.0,228.0/255.0,58.0/255.0,1.0f }
 
const float GOLD_SPECULAR [4] = { 255.0/255.0,235.0/255.0,80.0/255.0,1.0f }
 
const float SILVER_AMBIENT [4] = { 0.2f, 0.2f, 0.2f, 1.0f }
 
const float SILVER_DIFFUSE [4] = { 1.0f, 1.0f, 1.0f, 1.0f }
 
const float SILVER_SPECULAR [4] = { 1.0f, 1.0f, 1.0f, 1.0f }
 
const float CYAN_AMBIENT [4] = { 59.0/255.0, 68.0/255.0,255.0/255.0,1.0f }
 
const float CYAN_DIFFUSE [4] = { 94.0/255.0,185.0/255.0,238.0/255.0,1.0f }
 
const float CYAN_SPECULAR [4] = { 163.0/255.0,221.0/255.0,255.0/255.0,1.0f }
 
const float DENIS_PURPLE_DIFFUSE [4] = { 80.0/255.0,64.0/255.0,255.0/255.0,1.0f }
 
const float LADISLAV_ORANGE_DIFFUSE [4] = {1.0f, 125.0f / 255.0f, 19.0f / 255.0f, 0.0f}
 
const float FAST_GREEN_DIFFUSE [4] = { 113.0f/255.0f, 239.0f/255.0f, 46.0f/255.0f, 1.0f}
 
const float FAST_RED_DIFFUSE [4] = { 255.0f/255.0f, 65.0f/255.0f, 46.0f/255.0f, 1.0f}
 
const float FAST_BLUE_DIFFUSE [4] = { 106.0f/255.0f, 106.0f/255.0f, 255.0f/255.0f, 1.0f}
 
const float FAST_GRAY_DIFFUSE [4] = { 150.0f/255.0f, 150.0f/255.0f, 150.0f/255.0f, 1.0f}
 
const float WHITE [4] = { 255.0/255.0,255.0/255.0,255.0/255.0,1.0f }
 
const float BLACK [4] = { 0.0/255.0,0.0/255.0,0.0/255.0,1.0f }
 
const float WHITE_AMBIENT [4] = { 255.0/255.0,255.0/255.0,255.0/255.0,1.0f }
 
const float WHITE_DIFFUSE [4] = { 255.0/255.0,255.0/255.0,255.0/255.0,1.0f }
 
const float WHITE_SPECULAR [4] = { 255.0/255.0,255.0/255.0,255.0/255.0,1.0f }
 
const float BBW_POINT_COLOR [4] = {239./255.,213./255.,46./255.,255.0/255.0}
 
const float BBW_LINE_COLOR [4] = {106./255.,106./255.,255./255.,255./255.}
 
const float MIDNIGHT_BLUE_DIFFUSE [4] = { 21.0f/255.0f, 27.0f/255.0f, 84.0f/255.0f, 1.0f}
 
const float EASTER_RED_DIFFUSE [4] = {0.603922,0.494118f,0.603922f,1.0f}
 
const float WN_OPEN_BOUNDARY_COLOR [4] = {154./255.,0./255.,0./255.,1.0f}
 
const float WN_NON_MANIFOLD_EDGE_COLOR [4] = {201./255., 51./255.,255./255.,1.0f}
 
const char CHAR_ONE = 1
 Often one needs a reference to a dummy variable containing one as its value, for example when using AntTweakBar's TwSetParam( "3D View", "opened", TW_PARAM_INT32, 1, &INT_ONE);.
 
const int INT_ONE = 1
 
const unsigned int UNSIGNED_INT_ONE = 1
 
const double DOUBLE_ONE = 1
 
const float FLOAT_ONE = 1
 
constexpr double PI = 3.1415926535897932384626433832795
 π
 
const char CHAR_ZERO = 0
 
const int INT_ZERO = 0
 
const unsigned int UNSIGNED_INT_ZERO = 0
 
const double DOUBLE_ZERO = 0
 
const float FLOAT_ZERO = 0
 

Typedef Documentation

◆ decimate_cost_and_placement_callback

using igl::decimate_cost_and_placement_callback = typedef std::function<void( const int , const Eigen::MatrixXd & , const Eigen::MatrixXi & , const Eigen::MatrixXi & , const Eigen::VectorXi & , const Eigen::MatrixXi & , const Eigen::MatrixXi & , double & , Eigen::RowVectorXd & )>

Function handle used to control the cost of each edge collapse in igl::decimate.

See decimate.h for more details.

Parameters
[in]eindex into E of edge to be collapsed
[in]V#V by dim list of vertex positions, lesser index of E(e,:) will be set to midpoint of edge.
[in]F#F by 3 list of face indices into V.
[in]E#E by 2 list of edge indices into V.
[in]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i)
[in]EI#E by 2 list of edge flap corners (see above).
[out]costcost of collapsing edge e
[out]pplacement of merged vertex resulting from collapse

◆ decimate_stopping_condition_callback

using igl::decimate_stopping_condition_callback = typedef std::function<bool( const Eigen::MatrixXd & , const Eigen::MatrixXi & , const Eigen::MatrixXi & , const Eigen::VectorXi & , const Eigen::MatrixXi & , const Eigen::MatrixXi & , const igl::min_heap< std::tuple<double,int,int> > & , const Eigen::VectorXi & , const Eigen::MatrixXd & , const int , const int , const int , const int , const int )>

Function handle used to control whether the queue processing in igl::decimate should stop.

See decimate.h for more details.

Parameters
[in]V#V by dim list of vertex positions, lesser index of E(e,:) will be set to midpoint of edge.
[in]F#F by 3 list of face indices into V.
[in]E#E by 2 list of edge indices into V.
[in]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i) @param [in] EI #E by 2 list of edge flap corners (see above). @param [in] Q queue containing pairs of costs and edge indices and insertion "time" @param [in] EQ #E list of "time" of last time pushed into Q
[in]C#E by dim list of stored placements
[in]eindex into E of attempted collapsed edge. Set to -1 if Q is empty or contains only infinite cost edges.
[in]e1index into E of edge collpased on left.
[in]e2index into E of edge collpased on right.
[in]f1index into F of face collpased on left.
[in]f2index into F of face collpased on right.
Returns
whether to stop

◆ decimate_pre_collapse_callback

using igl::decimate_pre_collapse_callback = typedef std::function<bool( const Eigen::MatrixXd & , const Eigen::MatrixXi & , const Eigen::MatrixXi & , const Eigen::VectorXi & , const Eigen::MatrixXi & , const Eigen::MatrixXi & , const igl::min_heap< std::tuple<double,int,int> > & , const Eigen::VectorXi & , const Eigen::MatrixXd & , const int )>

Function handle called just before collapse_edge is attempted.

If this function returns false then the collapse is aborted.

See decimate.h for more details.

Parameters
[in]V#V by dim list of vertex positions, lesser index of E(e,:) will be set to midpoint of edge.
[in]F#F by 3 list of face indices into V.
[in]E#E by 2 list of edge indices into V.
[in]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) e=(j->i)
[in]EI#E by 2 list of edge flap corners (see above).
[in]Qqueue containing pairs of costs and edge indices and insertion "time"
[in]EQ#E list of "time" of last time pushed into Q
[in]C#E by dim list of stored placements
[in]eindex into E of attempted collapsed edge. Set to -1 if Q is empty or contains only infinite cost edges.
Returns
true if collapse should be carried out

◆ decimate_post_collapse_callback

using igl::decimate_post_collapse_callback = typedef std::function<void( const Eigen::MatrixXd & , const Eigen::MatrixXi & , const Eigen::MatrixXi & , const Eigen::VectorXi & , const Eigen::MatrixXi & , const Eigen::MatrixXi & , const igl::min_heap< std::tuple<double,int,int> > & , const Eigen::VectorXi & , const Eigen::MatrixXd & , const int , const int , const int , const int , const int , const bool )>

Function handle called just after collapse_edge is attempted.

See decimate.h for more details.

Parameters
[in]V#V by dim list of vertex positions, lesser index of E(e,:) will be set to midpoint of edge.
[in]F#F by 3 list of face indices into V.
[in]E#E by 2 list of edge indices into V.
[in]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) e=(j->i)
[in]EI#E by 2 list of edge flap corners (see above).
[in]Qqueue containing pairs of costs and edge indices and insertion "time"
[in]EQ#E list of "time" of last time pushed into Q
[in]C#E by dim list of stored placements
[in]eindex into E of attempted collapsed edge. Set to -1 if Q is empty or contains only infinite cost edges.
[in]e1index into E of edge collpased on left.
[in]e2index into E of edge collpased on right.
[in]f1index into F of face collpased on left.
[in]f2index into F of face collpased on right.
[in]collapsedwhether collapse actual took place

◆ DEFAULT_URBG

using igl::DEFAULT_URBG = typedef std::mt19937

◆ min_heap

template<class T >
using igl::min_heap = typedef std::priority_queue< T, std::vector<T >, std::greater<T > >

Templated min heap (reverses sort order of std::priority_queue)

Template Parameters
Ttype of elements in heap

◆ shapeup_projection_function

using igl::shapeup_projection_function = typedef std::function< bool( const Eigen::PlainObjectBase<Eigen::MatrixXd>&, const Eigen::PlainObjectBase<Eigen::VectorXi>&, const Eigen::PlainObjectBase<Eigen::MatrixXi>&, Eigen::PlainObjectBase<Eigen::MatrixXd>&)>

Every function here defines a local projection for ShapeUp, and must have the following structure to qualify:

Parameters
[in]P#P by 3 set of points, either the initial solution, or from previous iteration.
[in]SC#Set by 1 cardinalities of sets in S
[in]S#Sets by max(SC) independent sets where the local projection applies. Values beyond column SC(i)-1 in row S(i,:) are "don't care"
[out]projP#S by 3*max(SC) in format xyzxyzxyz, where the projected points correspond to each set in S in the same order.
Returns
Return value appears to be ignored

include/igl/shapeup.h

Enumeration Type Documentation

◆ ARAPEnergyType

Enum for choosing ARAP energy type.

Enumerator
ARAP_ENERGY_TYPE_SPOKES 

"As-rigid-as-possible Surface Modeling" by [Sorkine and Alexa 2007], rotations defined at vertices affecting incident edges, default

ARAP_ENERGY_TYPE_SPOKES_AND_RIMS 

Adapted version of "As-rigid-as-possible Surface Modeling" by [Sorkine and Alexa 2007] presented in section 4.2 of or "A simple geometric model for elastic deformation" by [Chao et al. 2010], rotations defined at vertices affecting incident edges and opposite edges.

ARAP_ENERGY_TYPE_ELEMENTS 

"A local-global approach to mesh parameterization" by [Liu et al. 2010] or "A simple geometric model for elastic deformation" by [Chao et al. 2010], rotations defined at elements (triangles or tets)

ARAP_ENERGY_TYPE_DEFAULT 

Choose one automatically: spokes and rims for surfaces, elements for planar meshes and tets (not fully supported)

NUM_ARAP_ENERGY_TYPES 

Total number of types.

◆ ColorMapType

Enumerator
COLOR_MAP_TYPE_INFERNO 
COLOR_MAP_TYPE_JET 
COLOR_MAP_TYPE_MAGMA 
COLOR_MAP_TYPE_PARULA 
COLOR_MAP_TYPE_PLASMA 
COLOR_MAP_TYPE_VIRIDIS 
COLOR_MAP_TYPE_TURBO 
NUM_COLOR_MAP_TYPES 

◆ EigsType

Type of eigen values to extract.

Enumerator
EIGS_TYPE_SM 

Smallest magnitude eigen values.

EIGS_TYPE_LM 

Largest magnitude eigen values.

NUM_EIGS_TYPES 

Total number of types.

◆ FileEncoding

enum class igl::FileEncoding
strong

File encoding types for writing files.

Enumerator
Binary 
Ascii 

◆ BrushType

enum class igl::BrushType : int
strong

Kelvinlets brush type.

Enumerator
GRAB 
SCALE 
TWIST 
PINCH 

◆ MappingEnergyType

Energy Types used for Parameterization/Mapping.

Refer to SLIM [Rabinovich et al. 2017] for more details

Enumerator
ARAP 
LOG_ARAP 
SYMMETRIC_DIRICHLET 
CONFORMAL 
EXP_CONFORMAL 
EXP_SYMMETRIC_DIRICHLET 
NUM_SLIM_ENERGY_TYPES 

◆ MassMatrixType

Type of mass matrix.

Enumerator
MASSMATRIX_TYPE_BARYCENTRIC 

Lumping area of each element to corner vertices in equal parts.

MASSMATRIX_TYPE_VORONOI 

Lumping area by Voronoi dual area (clamped to be positive according to Meyer et al.

2003)

MASSMATRIX_TYPE_FULL 

Full (non-diagonal mass matrix) for piecewise linear functions.

MASSMATRIX_TYPE_DEFAULT 

Use MASSMATRIX_TYPE_VORONOI for triangles and MASSMATRIX_TYPE_BARYCENTRIC for tetrahedra.

NUM_MASSMATRIX_TYPES 

Total number of mass matrix types.

◆ MeshBooleanType

Boolean operation types.

Enumerator
MESH_BOOLEAN_TYPE_UNION 

A ∪ B.

MESH_BOOLEAN_TYPE_INTERSECT 

A ∩ B.

MESH_BOOLEAN_TYPE_MINUS 

A \ B.

MESH_BOOLEAN_TYPE_XOR 

A ⊕ B.

MESH_BOOLEAN_TYPE_RESOLVE 

Resolve intersections without removing any non-coplanar faces.

NUM_MESH_BOOLEAN_TYPES 

Total number of Boolean options.

◆ NormalType

Type of mesh normal computation method.

Enumerator
PER_VERTEX_NORMALS 

Normals computed per vertex based on incident faces.

PER_FACE_NORMALS 

Normals computed per face.

PER_CORNER_NORMALS 

Normals computed per corner (aka wedge) based on incident faces without sharp edge.

◆ PerEdgeNormalsWeightingType

Weighting schemes for per edge normals.

Enumerator
PER_EDGE_NORMALS_WEIGHTING_TYPE_UNIFORM 

Incident face normals have uniform influence on edge normal.

PER_EDGE_NORMALS_WEIGHTING_TYPE_AREA 

Incident face normals are averaged weighted by area.

PER_EDGE_NORMALS_WEIGHTING_TYPE_DEFAULT 

Area weights.

NUM_PER_EDGE_NORMALS_WEIGHTING_TYPE 

Total number of weighting types.

◆ PerVertexNormalsWeightingType

Weighting schemes for computing per-vertex normals.

Note
It would be nice to support more or all of the methods here: "A comparison of algorithms for vertex normal computation"
Enumerator
PER_VERTEX_NORMALS_WEIGHTING_TYPE_UNIFORM 

Incident face normals have uniform influence on vertex normal.

PER_VERTEX_NORMALS_WEIGHTING_TYPE_AREA 

Incident face normals are averaged weighted by area.

PER_VERTEX_NORMALS_WEIGHTING_TYPE_ANGLE 

Incident face normals are averaged weighted by incident angle of vertex.

PER_VERTEX_NORMALS_WEIGHTING_TYPE_DEFAULT 

Area weights.

NUM_PER_VERTEX_NORMALS_WEIGHTING_TYPE 

Total number of weighting types.

◆ SignedDistanceType

Types of signing a distance field.

Enumerator
SIGNED_DISTANCE_TYPE_PSEUDONORMAL 

Use fast pseudo-normal test [Bærentzen & Aanæs 2005].

SIGNED_DISTANCE_TYPE_WINDING_NUMBER 

Use winding number [Jacobson, Kavan Sorking-Hornug 2013].

SIGNED_DISTANCE_TYPE_DEFAULT 

Default.

SIGNED_DISTANCE_TYPE_UNSIGNED 

Unsigned (absolute value)

SIGNED_DISTANCE_TYPE_FAST_WINDING_NUMBER 

Use Fast winding number [Barill, Dickson, Schmidt, Levin, Jacobson 2018].

NUM_SIGNED_DISTANCE_TYPE 

Total number of signed distance types.

◆ SolverStatus

Solver status type used by min_quad_with_fixed.

Enumerator
SOLVER_STATUS_CONVERGED 
SOLVER_STATUS_MAX_ITER 
SOLVER_STATUS_ERROR 
NUM_SOLVER_STATUSES 

◆ TetrahedralizedGripType

Types of tetrahedralizations of a cubical cell.

Enumerator
TETRAHEDRALIZED_GRID_TYPE_5 

1 cube → 5 tets

TETRAHEDRALIZED_GRID_TYPE_6_ROTATIONAL 

1 cube → 6 tets with rotatonal symmetry

NUM_TETRAHEDRALIZED_GRID_TYPE 

Total number of tetrahedralization types.

◆ WindingNumberMethod

Enumerator
EXACT_WINDING_NUMBER_METHOD 
APPROX_SIMPLE_WINDING_NUMBER_METHOD 
APPROX_CACHE_WINDING_NUMBER_METHOD 
NUM_WINDING_NUMBER_METHODS 

Number of winding number methods.

Function Documentation

◆ accumarray() [1/2]

template<typename DerivedS , typename DerivedV , typename DerivedA >
void igl::accumarray ( const Eigen::MatrixBase< DerivedS > &  S,
const Eigen::MatrixBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedA > &  A 
)

Accumulate values in V using subscripts in S.

Like Matlab's accumarray.

Parameters
[in]S#S list of subscripts
[in]V#V list of values
[out]Amax(subs)+1 list of accumulated values

◆ accumarray() [2/2]

template<typename DerivedS , typename DerivedA >
void igl::accumarray ( const Eigen::MatrixBase< DerivedS > &  S,
const typename DerivedA::Scalar  V,
Eigen::PlainObjectBase< DerivedA > &  A 
)

Accumulate constant value V using subscripts in S.

Like Matlab's accumarray.

Parameters
[in]S#S list of subscripts
[in]Vsingle value used for all
[out]Amax(subs)+1 list of accumulated values

◆ active_set()

template<typename AT , typename DerivedB , typename Derivedknown , typename DerivedY , typename AeqT , typename DerivedBeq , typename AieqT , typename DerivedBieq , typename Derivedlx , typename Derivedux , typename DerivedZ >
igl::SolverStatus igl::active_set ( const Eigen::SparseMatrix< AT > &  A,
const Eigen::PlainObjectBase< DerivedB > &  B,
const Eigen::PlainObjectBase< Derivedknown > &  known,
const Eigen::PlainObjectBase< DerivedY > &  Y,
const Eigen::SparseMatrix< AeqT > &  Aeq,
const Eigen::PlainObjectBase< DerivedBeq > &  Beq,
const Eigen::SparseMatrix< AieqT > &  Aieq,
const Eigen::PlainObjectBase< DerivedBieq > &  Bieq,
const Eigen::PlainObjectBase< Derivedlx > &  lx,
const Eigen::PlainObjectBase< Derivedux > &  ux,
const igl::active_set_params params,
Eigen::PlainObjectBase< DerivedZ > &  Z 
)

Minimize convex quadratic energy subject to linear inequality constraints.

min ½ Zᵀ A Z + Zᵀ B + constant
 Z
subject to
       Aeq Z = Beq
       Aieq Z <= Bieq
       lx <= Z <= ux
       Z(known) = Y

that Z(known) = Y, optionally also subject to the constraints Aeq*Z = Beq, and further optionally subject to the linear inequality constraints that Aieq*Z <= Bieq and constant inequality constraints lx <= x <= ux

Parameters
[in]An by n matrix of quadratic coefficients
[in]Bn by 1 column of linear coefficients
[in]knownlist of indices to known rows in Z
[in]Ylist of fixed values corresponding to known rows in Z
[in]Aeqmeq by n list of linear equality constraint coefficients
[in]Beqmeq by 1 list of linear equality constraint constant values
[in]Aieqmieq by n list of linear inequality constraint coefficients
[in]Bieqmieq by 1 list of linear inequality constraint constant values
[in]lxn by 1 list of lower bounds [] implies -Inf
[in]uxn by 1 list of upper bounds [] implies Inf
[in]paramsstruct of additional parameters (see below)
[in,out]Zif not empty, is taken to be an n by 1 list of initial guess values. Set to solution on output.
Returns
true on success, false on error
Note
Benchmark: For a harmonic solve on a mesh with 325K facets, matlab 2.2 secs, igl/min_quad_with_fixed.h 7.1 secs
Precondition
rows of [Aeq;Aieq] must be linearly independent. Should be using QR decomposition otherwise: https://v8doc.sas.com/sashtml/ormp/chap5/sect32.htm
Warning
This solver is fairly experimental. It works reasonably well for bbw problems but doesn't generalize well to other problems. NASOQ and OSQP are better general purpose solvers.

◆ adjacency_list() [1/2]

template<typename Index , typename IndexVector >
void igl::adjacency_list ( const Eigen::MatrixBase< Index > &  F,
std::vector< std::vector< IndexVector > > &  A,
bool  sorted = false 
)

Constructs the graph adjacency list of a given mesh (V,F)

Template Parameters
Tshould be a eigen sparse matrix primitive type like int or double
Parameters
[in]F#F by dim list of mesh faces (must be triangles)
[out]Avector<vector<T> > containing at row i the adjacent vertices of vertex i
[in]sortedflag that indicates if the list should be sorted counter-clockwise. Input assumed to be manifold.

Example:

// Mesh in (V,F)
vector<vector<double> > A;
void adjacency_list(const Eigen::MatrixBase< Index > &F, std::vector< std::vector< IndexVector > > &A, bool sorted=false)
Constructs the graph adjacency list of a given mesh (V,F)
See also
adjacency_matrix edges, cotmatrix, diag

◆ adjacency_list() [2/2]

template<typename Index >
void igl::adjacency_list ( const std::vector< std::vector< Index > > &  F,
std::vector< std::vector< Index > > &  A 
)

Constructs the graph adjacency list of a given polygon mesh (V,F)

Template Parameters
Tshould be a eigen sparse matrix primitive type like int or double
Parameters
[in]F#F list of polygon face index lists
[out]Avector<vector<T> > containing at row i the adjacent vertices of vertex i

◆ adjacency_matrix() [1/2]

template<typename DerivedF , typename T >
void igl::adjacency_matrix ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< T > &  A 
)

Constructs the graph adjacency matrix of a given mesh (V,F)

Template Parameters
Tshould be a eigen sparse matrix primitive type like int or double
Parameters
[in]F#F by dim list of mesh simplices
[out]Amax(F)+1 by max(F)+1 adjacency matrix, each row i corresponding to V(i,:)

Example

// Mesh in (V,F)
Eigen::SparseMatrix<double> A;
// sum each row
SparseVector<double> Asum;
sum(A,1,Asum);
// Convert row sums into diagonal of sparse matrix
SparseMatrix<double> Adiag;
diag(Asum,Adiag);
// Build uniform laplacian
SparseMatrix<double> U;
U = A-Adiag;
void adjacency_matrix(const Eigen::MatrixBase< DerivedF > &F, Eigen::SparseMatrix< T > &A)
Constructs the graph adjacency matrix of a given mesh (V,F)
void sum(const Eigen::SparseMatrix< T > &X, const int dim, Eigen::SparseVector< T > &S)
Sum the columns or rows of a sparse matrix.
See also
edges, cotmatrix, diag

◆ adjacency_matrix() [2/2]

template<typename DerivedI , typename DerivedC , typename T >
void igl::adjacency_matrix ( const Eigen::MatrixBase< DerivedI > &  I,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::SparseMatrix< T > &  A 
)

Constructs an vertex adjacency for a polygon mesh.

Parameters
[in]I#I vectorized list of polygon corner indices into rows of some matrix V
[in]C#polygons+1 list of cumulative polygon sizes so that C(i+1)-C(i) = size of the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the indices of the ith polygon
[out]Amax(I)+1 by max(I)+1 adjacency matrix, each row i corresponding to V(i,:)

◆ all()

template<typename AType , typename DerivedB >
void igl::all ( const Eigen::SparseMatrix< AType > &  A,
const int  dim,
Eigen::PlainObjectBase< DerivedB > &  B 
)

Check whether all values are logically true along a dimension.

Note
For Dense matrices use: A.rowwise().all() or A.colwise().all()
Parameters
[in]Am by n sparse matrix
[in]dimdimension along which to check for all (1 or 2)
[out]Bn-long vector (if dim == 1) or m-long vector (if dim == 2)

◆ all_pairs_distances()

template<typename Mat >
void igl::all_pairs_distances ( const Mat &  V,
const Mat &  U,
const bool  squared,
Mat &  D 
)

Compute distances between each point i in V and point j in U.

D = all_pairs_distances(V,U)
Template Parameters
matrixclass like MatrixXd
Parameters
[in]V#V by dim list of points
[in]U#U by dim list of points
[in]squaredwhether to return squared distances
[out]D#V by #U matrix of distances, where D(i,j) gives the distance or squareed distance between V(i,:) and U(j,:)

◆ ambient_occlusion() [1/3]

template<typename DerivedP , typename DerivedN , typename DerivedS >
void igl::ambient_occlusion ( const std::function< bool(const Eigen::Vector3f &, const Eigen::Vector3f &) > &  shoot_ray,
const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
const int  num_samples,
Eigen::PlainObjectBase< DerivedS > &  S 
)

Compute ambient occlusion per given point using ray-mesh intersection function handle.

Parameters
[in]shoot_rayfunction handle that outputs hits of a given ray against a mesh (embedded in function handles as captured variable/data)
[in]P#P by 3 list of origin points
[in]N#P by 3 list of origin normals
[in]num_samplesnumber of samples to use (e.g., 1000)
[out]S#P list of ambient occlusion values between 1 (fully occluded) and 0 (not occluded)

◆ ambient_occlusion() [2/3]

template<typename DerivedV , int DIM, typename DerivedF , typename DerivedP , typename DerivedN , typename DerivedS >
void igl::ambient_occlusion ( const igl::AABB< DerivedV, DIM > &  aabb,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
const int  num_samples,
Eigen::PlainObjectBase< DerivedS > &  S 
)

Compute ambient occlusion per given point for mesh (V,F) with precomputed AABB tree.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh face indices into V
[in]P#P by 3 list of origin points
[in]N#P by 3 list of origin normals
[in]num_samplesnumber of samples to use (e.g., 1000)
[out]S#P list of ambient occlusion values between 1 (fully occluded) and 0 (not occluded)

◆ ambient_occlusion() [3/3]

template<typename DerivedV , typename DerivedF , typename DerivedP , typename DerivedN , typename DerivedS >
void igl::ambient_occlusion ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
const int  num_samples,
Eigen::PlainObjectBase< DerivedS > &  S 
)

Compute ambient occlusion per given point for mesh (V,F)

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh face indices into V
[in]P#P by 3 list of origin points
[in]N#P by 3 list of origin normals
[in]num_samplesnumber of samples to use (e.g., 1000)
[out]S#P list of ambient occlusion values between 1 (fully occluded) and 0 (not occluded)

◆ angular_distance()

double igl::angular_distance ( const Eigen::Quaterniond &  A,
const Eigen::Quaterniond &  B 
)

The "angular distance" between two unit quaternions is the angle of the smallest rotation (treated as an Axis and Angle) that takes A to B.

Parameters
[in]Aunit quaternion
[in]Bunit quaternion
Returns
angular distance

◆ any()

template<typename AType , typename DerivedB >
void igl::any ( const Eigen::SparseMatrix< AType > &  A,
const int  dim,
Eigen::PlainObjectBase< DerivedB > &  B 
)

Check whether any values are logically true along a dimension.

Note
Dense matrices use: A.rowwise().any() or A.colwise().any()
Parameters
[in]Am by n sparse matrix
[in]dimdimension along which to check for any (1 or 2)
[out]Bn-long vector (if dim == 1) or m-long vector (if dim == 2)

◆ arap_precomputation()

template<typename DerivedV , typename DerivedF , typename Derivedb >
bool igl::arap_precomputation ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const int  dim,
const Eigen::MatrixBase< Derivedb > &  b,
ARAPData data 
)

Compute necessary information to start using an ARAP deformation using local-global solver as described in "As-rigid-as-possible surface modeling" [Sorkine and Alexa 2007].

Parameters
[in]V#V by dim list of mesh positions
[in]F#F by simplex-size list of triangle|tet indices into V
[in]dimdimension being used at solve time. For deformation usually dim = V.cols(), for surface parameterization V.cols() = 3 and dim = 2
[in]b#b list of "boundary" fixed vertex indices into V
[out]datastruct containing necessary precomputation
Returns
whether initialization succeeded

include/igl/arap.h

◆ arap_solve()

template<typename Derivedbc , typename DerivedU >
bool igl::arap_solve ( const Eigen::MatrixBase< Derivedbc > &  bc,
ARAPData data,
Eigen::MatrixBase< DerivedU > &  U 
)

Conduct arap solve.

Parameters
[in]bc#b by dim list of boundary conditions
[in]datastruct containing necessary precomputation and parameters
[in,out]U#V by dim initial guess

include/igl/arap.h

Note
While the libigl guidelines require outputs to be of type PlainObjectBase so that the user does not need to worry about allocating memory for the output, in this case, the user is required to give an initial guess and hence fix the size of the problem domain. Taking a reference to MatrixBase in this case thus allows the user to provide e.g. a map to the position data, allowing seamless interoperability with user-defined datastructures without requiring a copy.

◆ arap_dof_precomputation()

template<typename LbsMatrixType , typename SSCALAR >
bool igl::arap_dof_precomputation ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const LbsMatrixType &  M,
const Eigen::Matrix< int, Eigen::Dynamic, 1 > &  G,
ArapDOFData< LbsMatrixType, SSCALAR > &  data 
)

Precomputes the system to optimize for "Fast Automatic Skinning Transformations" [Jacobson et al. 2012] skinning degrees of freedom optimization using as-rigid-as-possible energy.

This consists of building constructor matrices (to compute covariance matrices from transformations and to build the poisson solve right hand side from rotation matrix entries) and also prefactoring the poisson system.

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by {3|4} list of face indices
[in]M#V * dim by #handles * dim * (dim+1) matrix such that new_V(:) = LBS(V,W,A) = reshape(M * A,size(V)), where A is a column vectors formed by the entries in each handle's dim by dim+1 transformation matrix. Specifcally, A = reshape(permute(Astack,[3 1 2]),n*dim*(dim+1),1) or A = [Lxx;Lyx;Lxy;Lyy;tx;ty], and likewise for other dim if Astack(:,:,i) is the dim by (dim+1) transformation at handle i handles are ordered according to P then BE (point handles before bone handles)
[in]G#V list of group indices (1 to k) for each vertex, such that vertex i is assigned to group G(i)
[out]datastructure containing all necessary precomputation for calling arap_dof_update
Returns
true on success, false on error
See also
lbs_matrix_column

include/igl/arap_dof.h

◆ arap_dof_recomputation()

template<typename LbsMatrixType , typename SSCALAR >
bool igl::arap_dof_recomputation ( const Eigen::Matrix< int, Eigen::Dynamic, 1 > &  fixed_dim,
const Eigen::SparseMatrix< double > &  A_eq,
ArapDOFData< LbsMatrixType, SSCALAR > &  data 
)

Should always be called after arap_dof_precomputation, but may be called in between successive calls to arap_dof_update, recomputes precomputation given that there are only changes in free and fixed.

Parameters
[in]fixed_dimlist of transformation element indices for fixed (or partailly fixed) handles: not necessarily the complement of 'free' NOTE: the constraints for fixed transformations still need to be present in A_eq
[in]A_eqdim*#constraint_points by m*dim*(dim+1) matrix of linear equality constraint coefficients. Each row corresponds to a linear constraint, so that A_eq * L = Beq says that the linear transformation entries in the column L should produce the user supplied positional constraints for each handle in Beq. The row A_eq(i*dim+d) corresponds to the constrain on coordinate d of position i
[out]datastructure containing all necessary precomputation for calling arap_dof_update
Returns
true on success, false on error
See also
lbs_matrix_column

include/igl/arap_dof.h

◆ arap_dof_update()

template<typename LbsMatrixType , typename SSCALAR >
bool igl::arap_dof_update ( const ArapDOFData< LbsMatrixType, SSCALAR > &  data,
const Eigen::Matrix< double, Eigen::Dynamic, 1 > &  B_eq,
const Eigen::MatrixXd &  L0,
const int  max_iters,
const double  tol,
Eigen::MatrixXd &  L 
)

Optimizes the transformations attached to each weight function based on precomputed system.

Parameters
[in]dataprecomputation data struct output from arap_dof_precomputation
[in]Beqdim*#constraint_points constraint values.
[in]L0#handles * dim * dim+1 list of initial guess transformation entries, also holds fixed transformation entries for fixed handles
[in]max_itersmaximum number of iterations
[in]tolstopping criteria parameter. If variables (linear transformation matrix entries) change by less than 'tol' the optimization terminates, 0.75 (weak tolerance) 0.0 (extreme tolerance)
[out]L#handles * dim * dim+1 list of final optimized transformation entries, allowed to be the same as L

include/igl/arap_dof.h

◆ arap_linear_block()

template<typename MatV , typename MatF , typename MatK >
void igl::arap_linear_block ( const MatV &  V,
const MatF &  F,
const int  d,
const igl::ARAPEnergyType  energy,
MatK &  Kd 
)

Constructs a block of the matrix which constructs the linear terms of a given arap energy.

When treating rotations as knowns (arranged in a column) then this constructs Kd of K such that the linear portion of the energy is as a column:

  K * R = [Kx Z  ... Ky Z  ... 
           Z  Kx ... Z  Ky ... 
           ... ]

These blocks are also used to build the "covariance scatter matrices". Here we want to build a scatter matrix that multiplies against positions (treated as known) producing covariance matrices to fit each rotation. Notice that in the case of the RHS of the poisson solve the rotations are known and the positions unknown, and vice versa for rotation fitting. These linear block just relate the rotations to the positions, linearly in each.

Template Parameters
MatVvertex position matrix, e.g. Eigen::MatrixXd
MatFface index matrix, e.g. Eigen::MatrixXd
Scalare.g. double
Parameters
[in]V#V by dim list of initial domain positions
[in]F#F by #simplex size list of triangle indices into V
[in]dcoordinate of linear constructor to build
[in]energyARAPEnergyType enum value defining which energy is being used. See ARAPEnergyType.h for valid options and explanations.
[out]Kd#V by #V/#F block of the linear constructor matrix corresponding to coordinate d
See also
ARAPEnergyType

◆ arap_linear_block_spokes()

template<typename MatV , typename MatF , typename MatK >
void igl::arap_linear_block_spokes ( const MatV &  V,
const MatF &  F,
const int  d,
MatK &  Kd 
)

Constructs a block of the matrix which constructs the linear terms for spokes energy.

Template Parameters
MatVvertex position matrix, e.g. Eigen::MatrixXd
MatFface index matrix, e.g. Eigen::MatrixXd
Scalare.g. double
Parameters
[in]V#V by dim list of initial domain positions
[in]F#F by #simplex size list of triangle indices into V
[in]dcoordinate of linear constructor to build (0 index) See ARAPEnergyType.h for valid options and explanations.
[out]Kd#V by #V block of the linear constructor matrix corresponding to coordinate d

◆ arap_linear_block_spokes_and_rims()

template<typename MatV , typename MatF , typename MatK >
void igl::arap_linear_block_spokes_and_rims ( const MatV &  V,
const MatF &  F,
const int  d,
MatK &  Kd 
)

Constructs a block of the matrix which constructs the linear terms for spokes and rims energy.

Template Parameters
MatVvertex position matrix, e.g. Eigen::MatrixXd
MatFface index matrix, e.g. Eigen::MatrixXd
Scalare.g. double
Parameters
[in]V#V by dim list of initial domain positions
[in]F#F by #simplex size list of triangle indices into V
[in]dcoordinate of linear constructor to build (0 index) See ARAPEnergyType.h for valid options and explanations.
[out]Kd#V by #V block of the linear constructor matrix corresponding to coordinate d

◆ arap_linear_block_elements()

template<typename MatV , typename MatF , typename MatK >
void igl::arap_linear_block_elements ( const MatV &  V,
const MatF &  F,
const int  d,
MatK &  Kd 
)

Constructs a block of the matrix which constructs the linear terms for per element energy.

Template Parameters
MatVvertex position matrix, e.g. Eigen::MatrixXd
MatFface index matrix, e.g. Eigen::MatrixXd
Scalare.g. double
Parameters
[in]V#V by dim list of initial domain positions
[in]F#F by #simplex size list of triangle indices into V
[in]dcoordinate of linear constructor to build (0 index) See ARAPEnergyType.h for valid options and explanations.
[out]Kd#V by #F block of the linear constructor matrix corresponding to coordinate d

◆ arap_rhs()

template<typename DerivedV , typename DerivedF , typename DerivedK >
void igl::arap_rhs ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const int  dim,
const igl::ARAPEnergyType  energy,
Eigen::SparseCompressedBase< DerivedK > &  K 
)

Right-hand side constructor of global poisson solve for various Arap energies.

Parameters
[in]V#V by Vdim list of initial domain positions
[in]F#F by 3 list of triangle indices into V
[in]dimdimension being used at solve time. For deformation usually dim = V.cols(), for surface parameterization V.cols() = 3 and dim = 2
[in]energyigl::ARAPEnergyType enum value defining which energy is being used. See igl::ARAPEnergyType.h for valid options and explanations.
[out]K#V*dim by #(F|V)*dim*dim matrix such that: b = K * reshape(permute(R,[3 1 2]),size(V|F,1)*size(V,2)*size(V,2),1);
See also
arap_linear_block

◆ AtA_cached_precompute()

template<typename Scalar >
void igl::AtA_cached_precompute ( const Eigen::SparseMatrix< Scalar > &  A,
AtA_cached_data data,
Eigen::SparseMatrix< Scalar > &  AtA 
)

Computes At * W * A, where A is sparse and W is diagonal.

Divides the construction in two phases, one for fixing the sparsity pattern, and one to populate it with values. Compared to evaluating it directly, this version is slower for the first time (since it requires a precomputation), but faster to the subsequent evaluations.

Parameters
[in]Am x n sparse matrix
[in,out]datastores the precomputed sparsity pattern, data.W contains the optional diagonal weights (stored as a dense vector). If W is not provided, it is replaced by the identity.
[out]AtAm by m matrix computed as AtA * W * A

Example:

AtA_data = igl::AtA_cached_data();
AtA_data.W = W;
if (s.AtA.rows() == 0)
igl::AtA_cached_precompute(s.A,s.AtA_data,s.AtA);
else
igl::AtA_cached(s.A,s.AtA_data,s.AtA);
void AtA_cached_precompute(const Eigen::SparseMatrix< Scalar > &A, AtA_cached_data &data, Eigen::SparseMatrix< Scalar > &AtA)
Computes At * W * A, where A is sparse and W is diagonal.
void AtA_cached(const Eigen::SparseMatrix< Scalar > &A, const AtA_cached_data &data, Eigen::SparseMatrix< Scalar > &AtA)
Computes At * W * A, where A is sparse and W is diagonal precomputed into data.
Hold precomputed data for AtA_cached.
Definition AtA_cached.h:18

◆ AtA_cached()

template<typename Scalar >
void igl::AtA_cached ( const Eigen::SparseMatrix< Scalar > &  A,
const AtA_cached_data data,
Eigen::SparseMatrix< Scalar > &  AtA 
)

Computes At * W * A, where A is sparse and W is diagonal precomputed into data.

Parameters
[in]Am x n sparse matrix
[in]datastores the precomputed sparsity pattern, data.W contains the optional diagonal weights (stored as a dense vector). If W is not provided, it is replaced by the identity.
[out]AtAm by m matrix computed as AtA * W * A

◆ average_from_edges_onto_vertices()

template<typename DerivedF , typename DerivedE , typename DerivedoE , typename DeriveduE , typename DeriveduV >
void igl::average_from_edges_onto_vertices ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedoE > &  oE,
const Eigen::MatrixBase< DeriveduE > &  uE,
Eigen::PlainObjectBase< DeriveduV > &  uV 
)

Move a scalar field defined on edges to vertices by averaging.

Parameters
[in]F#F by 3 triangle mesh connectivity
[in]E#E by 3 mapping from each halfedge to each edge
[in]oE#E by 3 orientation as generated by orient_halfedges
[in]uE#E by 1 list of scalars
[out]uV#V by 1 list of scalar defined on vertices
See also
orient_halfedges

◆ average_onto_faces()

template<typename DerivedF , typename DerivedS , typename DerivedSF >
void igl::average_onto_faces ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedSF > &  SF 
)

Move a scalar field defined on vertices to faces by averaging.

Parameters
[in]F#F by ss list of simples/faces
[in]S#V by dim list of per-vertex values
[out]SF#F by dim list of per-face values

◆ average_onto_vertices()

template<typename DerivedV , typename DerivedF , typename DerivedS , typename DerivedSV >
void igl::average_onto_vertices ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedSV > &  SV 
)

Move a scalar field defined on faces to vertices by averaging.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh face indices into rows of V
[in]S#F by 1 scalar field defined on faces
[out]SV#V by 1 scalar field defined on vertices

◆ avg_edge_length()

template<typename DerivedV , typename DerivedF >
double igl::avg_edge_length ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F 
)

Compute the average edge length for the given triangle mesh.

Template Parameters
DerivedVderived from vertex positions matrix type: i.e. MatrixXd
DerivedFderived from face indices matrix type: i.e. MatrixXi
DerivedLderived from edge lengths matrix type: i.e. MatrixXd
Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by simplex-size list of mesh faces (must be simplex)
Returns
average edge length
See also
adjacency_matrix

◆ axis_angle_to_quat()

template<typename Q_type >
void igl::axis_angle_to_quat ( const Q_type *  axis,
const Q_type  angle,
Q_type *  out 
)

Convert axis angle representation of a rotation to a quaternion.

A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w),

such that q = x*i + y*j + z*k + w

Parameters
[in]axis3d vector
[in]anglescalar
[out]outpointer to new quaternion

◆ barycenter()

template<typename DerivedV , typename DerivedF , typename DerivedBC >
void igl::barycenter ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedBC > &  BC 
)

Computes the barycenter of every simplex.

Parameters
[in]V#V x dim matrix of vertex coordinates
[in]F#F x simplex_size matrix of indices of simplex corners into V
[out]BC#F x dim matrix of 3d vertices

◆ barycentric_coordinates() [1/2]

template<typename DerivedP , typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedD , typename DerivedL >
void igl::barycentric_coordinates ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< DerivedC > &  C,
const Eigen::MatrixBase< DerivedD > &  D,
Eigen::PlainObjectBase< DerivedL > &  L 
)

Compute barycentric coordinates of each point in a corresponding tetrahedron.

Parameters
[in]P#P by 3 Query points in 3d
[in]A#P by 3 Tet corners in 3d
[in]B#P by 3 Tet corners in 3d
[in]C#P by 3 Tet corners in 3d
[in]D#P by 3 Tet corners in 3d
[out]L#P by 4 list of barycentric coordinates

◆ barycentric_coordinates() [2/2]

template<typename DerivedP , typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedL >
void igl::barycentric_coordinates ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedL > &  L 
)

Compute barycentric coordinates in a triangle.

Parameters
[in]P#P by dim Query points
[in]A#P by dim Triangle corners
[in]B#P by dim Triangle corners
[in]C#P by dim Triangle corners
[out]L#P by 3 list of barycentric coordinates

◆ barycentric_interpolation()

template<typename DerivedD , typename DerivedF , typename DerivedB , typename DerivedI , typename DerivedX >
void igl::barycentric_interpolation ( const Eigen::MatrixBase< DerivedD > &  D,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedX > &  X 
)

Interpolate data on a triangle mesh using barycentric coordinates.

Parameters
[in]D#D by dim list of per-vertex data
[in]F#F by 3 list of triangle indices
[in]B#X by 3 list of barycentric corodinates
[in]I#X list of triangle indices
[out]X#X by dim list of interpolated data

◆ basename()

std::string igl::basename ( const std::string &  path)

Extract basename of file path (like PHP's basename).

E.g., /etc/sudoers.d → sudoers.d

Parameters
[in]pathstring containing input path
Returns
string containing basename (see php's basename)
See also
dirname, pathinfo

◆ bbw()

template<typename DerivedV , typename DerivedEle , typename Derivedb , typename Derivedbc , typename DerivedW >
bool igl::bbw ( const Eigen::PlainObjectBase< DerivedV > &  V,
const Eigen::PlainObjectBase< DerivedEle > &  Ele,
const Eigen::PlainObjectBase< Derivedb > &  b,
const Eigen::PlainObjectBase< Derivedbc > &  bc,
BBWData data,
Eigen::PlainObjectBase< DerivedW > &  W 
)

Compute Bounded Biharmonic Weights on a given domain (V,Ele) with a given set of boundary conditions.

Template Parameters
DerivedVderived type of eigen matrix for V (e.g. MatrixXd)
DerivedFderived type of eigen matrix for F (e.g. MatrixXi)
Derivedbderived type of eigen matrix for b (e.g. VectorXi)
Derivedbcderived type of eigen matrix for bc (e.g. MatrixXd)
DerivedWderived type of eigen matrix for W (e.g. MatrixXd)
Parameters
[in]V#V by dim vertex positions
[in]Ele#Elements by simplex-size list of element indices
[in]b#b boundary indices into V
[in]bc#b by #W list of boundary values
[in,out]dataobject containing options, initial guess --> solution and results
[out]W#V by #W list of unnormalized weights to normalize use igl::normalize_row_sums(W,W);
Returns
true on success, false on failure

◆ bezier() [1/3]

template<typename DerivedV , typename DerivedP >
void igl::bezier ( const Eigen::MatrixBase< DerivedV > &  V,
const typename DerivedV::Scalar  t,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Evaluate a polynomial Bezier Curve at single parameter value.

Parameters
[in]V#V by dim list of Bezier control points
[in]tevaluation parameter within [0,1]
[out]P1 by dim output point

◆ bezier() [2/3]

template<typename DerivedV , typename DerivedT , typename DerivedP >
void igl::bezier ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Evaluate a polynomial Bezier Curve at many parameter values.

Parameters
[in]V#V by dim list of Bezier control points
[in]T#T evaluation parameters within [0,1]
[out]P#T by dim output points

◆ bezier() [3/3]

template<typename VMat , typename DerivedT , typename DerivedP >
void igl::bezier ( const std::vector< VMat > &  spline,
const Eigen::MatrixBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Evaluate a polynomial Bezier spline with a fixed parameter set for each sub-curve.

Template Parameters
VMattype of matrix of each list of control points
DerivedTDerived type of evaluation parameters
DerivedPDerived type of output points
Parameters
[in]spline#curves list of lists of Bezier control points
[in]T#T evaluation parameters within [0,1] to use for each spline
[out]P#curves*#T by dim output points

◆ bfs() [1/3]

template<typename AType , typename DerivedD , typename DerivedP >
void igl::bfs ( const AType &  A,
const size_t  s,
Eigen::PlainObjectBase< DerivedD > &  D,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Traverse a directed graph represented by an adjacency list using.

breadth first search; outputs Eigen types.

Parameters
[in]A#V list of adjacency lists or #V by #V adjacency matrix
[in]sstarting node (index into A)
[out]D#V list of indices into rows of A in the order in which graph nodes are discovered.
[out]P#V list of indices into rows of A of predecessor in resulting spanning tree {-1 indicates root/not discovered), order corresponds to V not D.

◆ bfs() [2/3]

template<typename AType , typename DType , typename PType >
void igl::bfs ( const std::vector< std::vector< AType > > &  A,
const size_t  s,
std::vector< DType > &  D,
std::vector< PType > &  P 
)

Traverse a directed graph represented by an adjacency list using.

breadth first search; inputs adjacency lists, outputs lists.

Parameters
[in]A#V list of adjacency lists
[in]sstarting node (index into A)
[out]D#V list of indices into rows of A in the order in which graph nodes are discovered.
[out]P#V list of indices into rows of A of predecessor in resulting spanning tree {-1 indicates root/not discovered), order corresponds to V not D.

◆ bfs() [3/3]

template<typename AType , typename DType , typename PType >
void igl::bfs ( const Eigen::SparseCompressedBase< AType > &  A,
const size_t  s,
std::vector< DType > &  D,
std::vector< PType > &  P 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ bfs_orient()

template<typename DerivedF , typename DerivedFF , typename DerivedC >
void igl::bfs_orient ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedFF > &  FF,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Consistently orient faces in orientable patches using BFS.

Parameters
[in]F#F by 3 list of faces
[out]FF#F by 3 list of faces (OK if same as F)
[out]C#F list of component ids

◆ biharmonic_coordinates() [1/2]

template<typename DerivedV , typename DerivedT , typename SType , typename DerivedW >
bool igl::biharmonic_coordinates ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedT > &  T,
const std::vector< std::vector< SType > > &  S,
Eigen::PlainObjectBase< DerivedW > &  W 
)

Compute "discrete biharmonic generalized barycentric coordinates" as described in "Linear Subspace Design for Real-Time Shape Deformation" [Wang et al.

2015]. Not to be confused with "Bounded Biharmonic Weights for Real-Time Deformation" [Jacobson et al. 2011] or "Biharmonic Coordinates" (2D complex barycentric coordinates) [Weber et al. 2012]. These weights minimize a discrete version of the squared Laplacian energy subject to positional interpolation constraints at selected vertices (point handles) and transformation interpolation constraints at regions (region handles).

Template Parameters
STypeshould be a simple index type e.g. int,size_t
Parameters
[in]V#V by dim list of mesh vertex positions
[in]T#T by dim+1 list of / triangle indices into V if dim=2 \ tetrahedron indices into V if dim=3
[in]S#point-handles+#region-handles list of lists of selected vertices for each handle. Point handles should have singleton lists and region handles should have lists of size at least dim+1 (and these points should be in general position).
[out]W#V by #points-handles+(#region-handles * dim+1) matrix of weights so that columns correspond to each handles generalized barycentric coordinates (for point-handles) or animation space weights (for region handles).
Returns
true only on success

Example:

MatrixXd W;
const size_t dim = T.cols()-1;
MatrixXd H(W.cols(),dim);
{
int c = 0;
for(int h = 0;h<S.size();h++)
{
if(S[h].size()==1)
{
H.row(c++) = V.block(S[h][0],0,1,dim);
}else
{
H.block(c,0,dim+1,dim).setIdentity();
c+=dim+1;
}
}
}
assert( (V-(W*H)).array().maxCoeff() < 1e-7 );
bool biharmonic_coordinates(const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, const std::vector< std::vector< SType > > &S, Eigen::PlainObjectBase< DerivedW > &W)
Compute "discrete biharmonic generalized barycentric coordinates" as described in "Linear Subspace De...

◆ biharmonic_coordinates() [2/2]

template<typename DerivedV , typename DerivedT , typename SType , typename DerivedW >
bool igl::biharmonic_coordinates ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedT > &  T,
const std::vector< std::vector< SType > > &  S,
const int  k,
Eigen::PlainObjectBase< DerivedW > &  W 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]kpower of Laplacian (experimental)

◆ bijective_composite_harmonic_mapping() [1/2]

template<typename DerivedV , typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedU >
bool igl::bijective_composite_harmonic_mapping ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< Derivedb > &  b,
const Eigen::MatrixBase< Derivedbc > &  bc,
Eigen::PlainObjectBase< DerivedU > &  U 
)

Compute a injective planar mapping of a triangulated polygon (V,F) subjected to boundary conditions (b,bc).

The mapping should be bijective in the sense that no triangles' areas become negative (this assumes they started positive). This mapping is computed by "composing" harmonic mappings between incremental morphs of the boundary conditions. This is a bit like a discrete version of "Bijective Composite Mean Value Mappings" [Schneider et al. 2013] but with a discrete harmonic map (cf. harmonic coordinates) instead of mean value coordinates. This is inspired by "Embedding a triangular graph within a given boundary" [Xu et al. 2011].

Parameters
[in]V#V by 2 list of triangle mesh vertex positions
[in]F#F by 3 list of triangle indices into V
[in]b#b list of boundary indices into V
[in]bc#b by 2 list of boundary conditions corresponding to b
[out]U#V by 2 list of output mesh vertex locations
Returns
true if and only if U contains a successful bijectie mapping

◆ bijective_composite_harmonic_mapping() [2/2]

template<typename DerivedV , typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedU >
bool igl::bijective_composite_harmonic_mapping ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< Derivedb > &  b,
const Eigen::MatrixBase< Derivedbc > &  bc,
const int  min_steps,
const int  max_steps,
const int  num_inner_iters,
const bool  test_for_flips,
Eigen::PlainObjectBase< DerivedU > &  U 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]min_stepsminimum number of steps to take from V(b,:) to bc
[in]max_stepsminimum number of steps to take from V(b,:) to bc (if max_steps == min_steps then no further number of steps will be tried)
[in]num_inner_itersnumber of iterations of harmonic solves to run after for each morph step (to try to push flips back in)
[in]test_for_flipswhether to check if flips occurred (and trigger more steps). if test_for_flips = false then this function always returns true

◆ blkdiag() [1/2]

template<typename Scalar >
void igl::blkdiag ( const std::vector< Eigen::SparseMatrix< Scalar > > &  L,
Eigen::SparseMatrix< Scalar > &  Y 
)

Given a list of matrices place them along the diagonal as blocks of the output matrix.

Like matlab's blkdiag.

Parameters
[in]Llist of matrices {A,B, ...}
[out]YA.rows()+B.rows()+... by A.cols()+B.cols()+... block diagonal
See also
cat, repdiag

◆ blkdiag() [2/2]

template<typename DerivedY >
void igl::blkdiag ( const std::vector< DerivedY > &  L,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ blue_noise()

template<typename DerivedV , typename DerivedF , typename DerivedB , typename DerivedFI , typename DerivedP , typename URBG = DEFAULT_URBG>
void igl::blue_noise ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const typename DerivedV::Scalar  r,
Eigen::PlainObjectBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedFI > &  FI,
Eigen::PlainObjectBase< DerivedP > &  P,
URBG &&  urbg = igl::generate_default_urbg() 
)

"Fast Poisson Disk Sampling in Arbitrary Dimensions" [Bridson 2007].

For very dense samplings this is faster than (up to 2x) cyCodeBase's implementation of "Sample Elimination for Generating Poisson Disk Sample Sets" [Yuksel 2015]. YMMV

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3 list of mesh triangle indices into rows of V
[in]rPoisson disk radius (evaluated according to Euclidean distance on V)
[out]B#P by 3 list of barycentric coordinates, ith row are coordinates of ith sampled point in face FI(i)
[out]FI#P list of indices into F
[out]P#P by dim list of sample positions.
[in,out]urbgAn instance of UnformRandomBitGenerator (e.g., std::minstd_rand(0))
See also
random_points_on_mesh

◆ bone_parents()

template<typename DerivedBE , typename DerivedP >
void igl::bone_parents ( const Eigen::MatrixBase< DerivedBE > &  BE,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Recover "parent" bones from directed graph representation.

Parameters
[in]BE#BE by 2 list of directed bone edges
[out]P#BE by 1 list of parent indices into BE, -1 means root.

◆ boundary_conditions()

bool igl::boundary_conditions ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  Ele,
const Eigen::MatrixXd &  C,
const Eigen::VectorXi &  P,
const Eigen::MatrixXi &  BE,
const Eigen::MatrixXi &  CE,
const Eigen::MatrixXi &  CF,
Eigen::VectorXi &  b,
Eigen::MatrixXd &  bc 
)

Compute boundary conditions for automatic weights computation.

This function expects that the given mesh (V,Ele) has sufficient samples (vertices) exactly at point handle locations and exactly along bone and cage edges/faces.

Parameters
[in]V#V by dim list of domain vertices
[in]Ele#Ele by simplex-size list of simplex indices
[in]C#C by dim list of handle positions
[in]P#P by 1 list of point handle indices into C
[in]BE#BE by 2 list of bone edge indices into C
[in]CE#CE by 2 list of cage edge indices into P
[in]CF#CF by 3 list of (triangular) cage face indices into P
[out]b#b list of boundary indices (indices into V of vertices which have known, fixed values)
[out]bc#b by #weights list of known/fixed values for boundary vertices (notice the #b != #weights in general because #b will include all the intermediary samples along each bone, etc.. The ordering of the weights corresponds to [P;BE]
Returns
false if boundary conditions are suspicious: P and BE are empty bc is empty some column of bc doesn't have a 0 (assuming bc has >1 columns) some column of bc doesn't have a 1 (assuming bc has >1 columns)

◆ boundary_facets() [1/4]

template<typename DerivedT , typename DerivedF , typename DerivedJ , typename DerivedK >
void igl::boundary_facets ( const Eigen::MatrixBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedJ > &  J,
Eigen::PlainObjectBase< DerivedK > &  K 
)

Determine boundary faces (edges) of tetrahedra (triangles) stored in T (analogous to qptoolbox's outline and boundary_faces).

Parameters
[in]Ttetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra
[out]Flist of boundary faces, n by 3 (2), where n is the number of boundary faces
[out]Jlist of indices into T, n by 1
[out]Klist of indices revealing across from which vertex is this facet

◆ boundary_facets() [2/4]

template<typename DerivedT , typename DerivedF >
void igl::boundary_facets ( const Eigen::MatrixBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedF > &  F 
)

Determine boundary faces (edges) of tetrahedra (triangles) stored in T.

Parameters
[in]Ttetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra
[out]Flist of boundary faces, n by 3 (2), where n is the number of boundary faces

◆ boundary_facets() [3/4]

template<typename DerivedT , typename Ret >
Ret igl::boundary_facets ( const Eigen::MatrixBase< DerivedT > &  T)

Determine boundary faces (edges) of tetrahedra (triangles) stored in T.

Parameters
[in]Ttetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra
Returns
list of boundary faces, n by 3 (2), where n is the number of boundary faces

◆ boundary_facets() [4/4]

template<typename IntegerT , typename IntegerF >
void igl::boundary_facets ( const std::vector< std::vector< IntegerT > > &  T,
std::vector< std::vector< IntegerF > > &  F 
)

Determine boundary faces (edges) of tetrahedra (triangles) stored in T; inputs and outputs lists.

Parameters
[in]Ttetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra
[out]Flist of boundary faces, n by 3 (2), where n is the number of boundary faces

◆ boundary_loop() [1/3]

template<typename DerivedF , typename Index >
void igl::boundary_loop ( const Eigen::MatrixBase< DerivedF > &  F,
std::vector< std::vector< Index > > &  L 
)

Compute list of ordered boundary loops for a manifold mesh.

Template Parameters
Indexindex type
Parameters
[in]F#F by dim list of mesh faces
[out]Llist of loops where L[i] = ordered list of boundary vertices in loop i

◆ boundary_loop() [2/3]

template<typename DerivedF , typename Index >
void igl::boundary_loop ( const Eigen::MatrixBase< DerivedF > &  F,
std::vector< Index > &  L 
)

Compute ordered boundary loops for a manifold mesh and return the longest loop in terms of vertices.

Template Parameters
Indexindex type
Parameters
[in]F#F by dim list of mesh faces
[out]Lordered list of boundary vertices of longest boundary loop

◆ boundary_loop() [3/3]

template<typename DerivedF , typename DerivedL >
void igl::boundary_loop ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedL > &  L 
)

Compute ordered boundary loops for a manifold mesh and return the longest loop in terms of vertices.

Template Parameters
Indexindex type
Parameters
[in]F#F by dim list of mesh faces
[out]Lordered list of boundary vertices of longest boundary loop

◆ bounding_box() [1/2]

template<typename DerivedV , typename DerivedBV , typename DerivedBF >
void igl::bounding_box ( const Eigen::MatrixBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedBV > &  BV,
Eigen::PlainObjectBase< DerivedBF > &  BF 
)

Build a triangle mesh of the bounding box of a given list of vertices.

Parameters
[in]V#V by dim list of rest domain positions
[out]BV2^dim by dim list of bounding box corners positions
[out]BF#BF by dim list of simplex facets

◆ bounding_box() [2/2]

template<typename DerivedV , typename DerivedBV , typename DerivedBF >
void igl::bounding_box ( const Eigen::MatrixBase< DerivedV > &  V,
const typename DerivedV::Scalar  pad,
Eigen::PlainObjectBase< DerivedBV > &  BV,
Eigen::PlainObjectBase< DerivedBF > &  BF 
)

◆ bounding_box_diagonal()

double igl::bounding_box_diagonal ( const Eigen::MatrixXd &  V)

Compute the length of the diagonal of a given meshes axis-aligned bounding box.

Parameters
[in]V#V by 3 list of vertex/point positions
Returns
length of bounding box diagonal

◆ CANONICAL_VIEW_QUAT()

template<typename Q_type >
Q_type igl::CANONICAL_VIEW_QUAT ( int  i,
int  j 
)

◆ CANONICAL_VIEW_QUAT< float >()

template<>
float igl::CANONICAL_VIEW_QUAT< float > ( int  i,
int  j 
)

◆ CANONICAL_VIEW_QUAT< double >()

template<>
double igl::CANONICAL_VIEW_QUAT< double > ( int  i,
int  j 
)

◆ cat() [1/5]

template<typename Scalar >
void igl::cat ( const int  dim,
const Eigen::SparseMatrix< Scalar > &  A,
const Eigen::SparseMatrix< Scalar > &  B,
Eigen::SparseMatrix< Scalar > &  C 
)

Perform concatenation of a two sparse matrices along a single dimension If dim == 1, then C = [A;B]; If dim == 2 then C = [A B].

This is an attempt to act like matlab's cat function.

Template Parameters
Scalarscalar data type for sparse matrices like double or int
Matmatrix type for all matrices (e.g. MatrixXd, SparseMatrix)
MatCmatrix type for output matrix (e.g. MatrixXd) needs to support resize
Parameters
[in]dimdimension along which to concatenate, 1 or 2
[in]Afirst input matrix
[in]Bsecond input matrix
[out]Coutput matrix

◆ cat() [2/5]

template<typename Derived , class MatC >
void igl::cat ( const int  dim,
const Eigen::MatrixBase< Derived > &  A,
const Eigen::MatrixBase< Derived > &  B,
MatC &  C 
)

Perform concatenation of a two dense matrices along a single dimension If dim == 1, then C = [A;B]; If dim == 2 then C = [A B].

Parameters
[in]dimdimension along which to concatenate, 1 or 2
[in]Afirst input matrix
[in]Bsecond input matrix
[out]Coutput matrix
Note
If you're using Dense matrices you might be better off using the << operator

◆ cat() [3/5]

template<class Mat >
Mat igl::cat ( const int  dim,
const Mat &  A,
const Mat &  B 
)

Perform concatenation of a two dense matrices along a single dimension If dim == 1, then C = [A;B]; If dim == 2 then C = [A B].

Parameters
[in]dimdimension along which to concatenate, 1 or 2
[in]Afirst input matrix
[in]Bsecond input matrix
Returns
C output matrix
Note
If you're using Dense matrices you might be better off using the << operator

◆ cat() [4/5]

template<class Mat >
void igl::cat ( const std::vector< std::vector< Mat > > &  A,
Mat &  C 
)

Concatenate a "matrix" of sub-blocks C = [A0;A1;A2;...;An] where Ai = [A[i][0] A[i][1] ... A[i][m]];.

Parameters
[in]Aa list of list of matrices (sizes must be compatibile)
[out]Coutput matrix

◆ cat() [5/5]

template<typename T , typename DerivedC >
void igl::cat ( const int  dim,
const std::vector< T > &  A,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Concatenate a std::vector of matrices along the specified dimension.

Parameters
[in]dimdimension along which to concatenate, 1 or 2
[in]Astd::vector of eigen matrices. Must have identical # cols if dim == 1 or rows if dim == 2
[out]Coutput matrix

◆ ceil()

template<typename DerivedX , typename DerivedY >
void igl::ceil ( const Eigen::PlainObjectBase< DerivedX > &  X,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

Ceil a given matrix to nearest integers.

Parameters
[in]Xm by n matrix of scalars
[out]Ym by n matrix of ceiled integers

◆ centroid() [1/2]

template<typename DerivedV , typename DerivedF , typename Derivedc , typename Derivedvol >
void igl::centroid ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< Derivedc > &  c,
Derivedvol &  vol 
)

Computes the centroid and enclosed volume of a closed mesh using a surface integral.

Parameters
[in]V#V by dim list of rest domain positions
[in]F#F by 3 list of triangle indices into V
[out]cdim vector of centroid coordinates
[out]voltotal volume of solid.

◆ centroid() [2/2]

template<typename DerivedV , typename DerivedF , typename Derivedc >
void igl::centroid ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< Derivedc > &  c 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ circulation() [1/3]

std::vector< int > igl::circulation ( const int  e,
const bool  ccw,
const Eigen::VectorXi &  EMAP,
const Eigen::MatrixXi &  EF,
const Eigen::MatrixXi &  EI 
)

Return list of faces around the end point of an edge.

Assumes data-structures are built from an edge-manifold closed mesh.

Parameters
[in]eindex into E of edge to circulate
[in]ccwwhether to continue in ccw direction of edge (circulate around E(e,1))
[in]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i)
[in]EI#E by 2 list of edge flap corners (see above).
Returns
list of faces touched by circulation (in cyclically order).
See also
edge_flaps

◆ circulation() [2/3]

void igl::circulation ( const int  e,
const bool  ccw,
const Eigen::VectorXi &  EMAP,
const Eigen::MatrixXi &  EF,
const Eigen::MatrixXi &  EI,
Eigen::VectorXi &  vN 
)

Return list of faces around the end point of an edge.

Assumes data-structures are built from an edge-manifold closed mesh.

Parameters
[in]eindex into E of edge to circulate
[in]ccwwhether to continue in ccw direction of edge (circulate around E(e,1))
[in]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i)
[in]EI#E by 2 list of edge flap corners (see above).
[out]vNlist of of faces touched by circulation (in cyclically order).
See also
edge_flaps

◆ circulation() [3/3]

void igl::circulation ( const int  e,
const bool  ccw,
const Eigen::MatrixXi &  F,
const Eigen::VectorXi &  EMAP,
const Eigen::MatrixXi &  EF,
const Eigen::MatrixXi &  EI,
std::vector< int > &  Nv,
std::vector< int > &  Nf 
)

Return list of faces around the end point of an edge.

Assumes data-structures are built from an edge-manifold closed mesh.

Parameters
[in]eindex into E of edge to circulate
[in]ccwwhether to continue in ccw direction of edge (circulate around E(e,1))
[in]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i) @param [in] EI #E by 2 list of edge flap corners (see above). @param [out] Nv #Nv list of "next" vertex indices
[out]Nf#Nf list of face indices
See also
edge_flaps

◆ circumradius()

template<typename DerivedV , typename DerivedF , typename DerivedR >
void igl::circumradius ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedR > &  R 
)

Compute the circumradius of each triangle in a mesh (V,F)

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3 list of triangle indices into V
[out]R#F list of circumradius

◆ collapse_edge() [1/6]

bool igl::collapse_edge ( const int  e,
const Eigen::RowVectorXd &  p,
Eigen::MatrixXd &  V,
Eigen::MatrixXi &  F,
Eigen::MatrixXi &  E,
Eigen::VectorXi &  EMAP,
Eigen::MatrixXi &  EF,
Eigen::MatrixXi &  EI,
int &  e1,
int &  e2,
int &  f1,
int &  f2 
)

Attempt to collapse a given edge of a mesh.

Assumes (V,F) is a closed manifold mesh (except for previously collapsed faces which should be set to: [IGL_COLLAPSE_EDGE_NULL IGL_COLLAPSE_EDGE_NULL IGL_COLLAPSE_EDGE_NULL]. Collapses exactly two faces and exactly 3 edges from E (e and one side of each face gets collapsed to the other). This is implemented in a way that it can be repeatedly called until satisfaction and then the garbage in F can be collected by removing NULL faces.

Parameters
[in]eindex into E of edge to try to collapse. E(e,:) = [s d] or [d s] so that s<d, then d is collapsed to s.
[in]pdim list of vertex position where to place merged vertex [mesh inputs]
[in,out]V#V by dim list of vertex positions, lesser index of E(e,:) will be set to midpoint of edge.
[in,out]F#F by 3 list of face indices into V.
[in,out]E#E by 2 list of edge indices into V.
[in,out]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in,out]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i)
[in,out]EI#E by 2 list of edge flap corners (see above). [mesh inputs]
[out]e1index into E of edge collpased on left
[out]e2index into E of edge collpased on right
[out]f1index into F of face collpased on left
[out]f2index into F of face collpased on right
Returns
true if edge was collapsed

◆ collapse_edge() [2/6]

bool igl::collapse_edge ( const int  e,
const Eigen::RowVectorXd &  p,
std::vector< int > &  Nsv,
const std::vector< int > &  Nsf,
std::vector< int > &  Ndv,
const std::vector< int > &  Ndf,
Eigen::MatrixXd &  V,
Eigen::MatrixXi &  F,
Eigen::MatrixXi &  E,
Eigen::VectorXi &  EMAP,
Eigen::MatrixXi &  EF,
Eigen::MatrixXi &  EI,
int &  e1,
int &  e2,
int &  f1,
int &  f2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]Nsv#Nsv vertex circulation around s (see circulation)
[in]Nsf#Nsf face circulation around s
[in]Ndv#Ndv vertex circulation around d
[in]Ndf#Ndf face circulation around d

◆ collapse_edge() [3/6]

bool igl::collapse_edge ( const int  e,
const Eigen::RowVectorXd &  p,
Eigen::MatrixXd &  V,
Eigen::MatrixXi &  F,
Eigen::MatrixXi &  E,
Eigen::VectorXi &  EMAP,
Eigen::MatrixXi &  EF,
Eigen::MatrixXi &  EI 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ collapse_edge() [4/6]

bool igl::collapse_edge ( const decimate_cost_and_placement_callback cost_and_placement,
const decimate_pre_collapse_callback pre_collapse,
const decimate_post_collapse_callback post_collapse,
Eigen::MatrixXd &  V,
Eigen::MatrixXi &  F,
Eigen::MatrixXi &  E,
Eigen::VectorXi &  EMAP,
Eigen::MatrixXi &  EF,
Eigen::MatrixXi &  EI,
igl::min_heap< std::tuple< double, int, int > > &  Q,
Eigen::VectorXi &  EQ,
Eigen::MatrixXd &  C,
int &  e,
int &  e1,
int &  e2,
int &  f1,
int &  f2 
)

Collapse least-cost edge from a priority queue and update queue.

See decimate.h for more details.

Parameters
[in]cost_and_placementfunction computing cost of collapsing an edge and 3d position where it should be placed: cost_and_placement(V,F,E,EMAP,EF,EI,cost,placement); If the edges is collapsed then this function will be called on all edges of all faces previously incident on the endpoints of the collapsed edge.
[in]pre_collapsecallback called with index of edge whose collapse is about to be attempted. This function should return whether to proceed with the collapse: returning true means "yes, try to collapse", returning false means "No, consider this edge 'uncollapsable', behave as if collapse_edge(e) returned false. @param [in] post_collapse callback called with index of edge whose collapse was just attempted and a flag revealing whether this was successful. @param [in,out] V #V by dim list of vertex positions, lesser index of E(e,:) will be set to midpoint of edge. @param [in,out] F #F by 3 list of face indices into V. @param [in,out] E #E by 2 list of edge indices into V. @param [in,out] EMAP #F*3 list of indices into E, mapping each directed edge to unique unique edge in E @param [in,out] EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) e=(j->i) @param [in,out] EI #E by 2 list of edge flap corners (see above). @param [in] Q queue containing pairs of costs and edge indices and insertion "time" @param [in] EQ #E list of "time" of last time pushed into Q
[in]C#E by dim list of stored placements
[out]eindex into E of attempted collapsed edge. Set to -1 if Q is empty or contains only infinite cost edges.
[out]e1index into E of edge collpased on left.
[out]e2index into E of edge collpased on right.
[out]f1index into F of face collpased on left.
[out]f2index into F of face collpased on right.

◆ collapse_edge() [5/6]

bool igl::collapse_edge ( const decimate_cost_and_placement_callback cost_and_placement,
Eigen::MatrixXd &  V,
Eigen::MatrixXi &  F,
Eigen::MatrixXi &  E,
Eigen::VectorXi &  EMAP,
Eigen::MatrixXi &  EF,
Eigen::MatrixXi &  EI,
igl::min_heap< std::tuple< double, int, int > > &  Q,
Eigen::VectorXi &  EQ,
Eigen::MatrixXd &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ collapse_edge() [6/6]

bool igl::collapse_edge ( const decimate_cost_and_placement_callback cost_and_placement,
const decimate_pre_collapse_callback pre_collapse,
const decimate_post_collapse_callback post_collapse,
Eigen::MatrixXd &  V,
Eigen::MatrixXi &  F,
Eigen::MatrixXi &  E,
Eigen::VectorXi &  EMAP,
Eigen::MatrixXi &  EF,
Eigen::MatrixXi &  EI,
igl::min_heap< std::tuple< double, int, int > > &  Q,
Eigen::VectorXi &  EQ,
Eigen::MatrixXd &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ collapse_small_triangles()

void igl::collapse_small_triangles ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const double  eps,
Eigen::MatrixXi &  FF 
)

Given a triangle mesh (V,F) compute a new mesh (VV,FF) which contains the original faces and vertices of (V,F) except any small triangles have been removed via collapse.

We are not following the rules in "Mesh Optimization" [Hoppe et al] Section 4.2. But for our purposes we don't care about this criteria.

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of triangle indices into V
[in]epsepsilon for smallest allowed area treated as fraction of squared bounding box diagonal
[out]FF#FF by 3 list of triangle indices into V

◆ colon() [1/2]

template<typename L , typename S , typename H , typename T >
void igl::colon ( const L  low,
const S  step,
const H  hi,
Eigen::Matrix< T, Eigen::Dynamic, 1 > &  I 
)

Colon operator like matlab's colon operator.

Enumerates values between low and hi with step step.

Template Parameters
Lshould be a eigen matrix primitive type like int or double
Sshould be a eigen matrix primitive type like int or double
Hshould be a eigen matrix primitive type like int or double
Tshould be a eigen matrix primitive type like int or double
Parameters
[in]lowstarting value if step is valid then this is always the first element of I
[in]stepstep difference between sequential elements returned in I, remember this will be cast to template T at compile time. If low<hi then step must be positive. If low>hi then step must be negative. Otherwise I will be set to empty.
[in]hiending 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<low
[out]Ilist of values from low to hi with step size step
Note
This should be potentially replaced with eigen's LinSpaced() function

If step = 1, it's about 5 times faster to use: X = Eigen::VectorXi::LinSpaced(n,0,n-1); than X = igl::colon<int>(0,n-1);

◆ colon() [2/2]

template<typename L , typename H , typename T >
void igl::colon ( const L  low,
const H  hi,
Eigen::Matrix< T, Eigen::Dynamic, 1 > &  I 
)

Colon operator like matlab's colon operator.

Enumerates values between low and hi with unit step.

Template Parameters
Lshould be a eigen matrix primitive type like int or double
Hshould be a eigen matrix primitive type like int or double
Tshould be a eigen matrix primitive type like int or double
Parameters
[in]lowstarting value if step is valid then this is always the first element of I
[in]stepstep difference between sequential elements returned in I, remember this will be cast to template T at compile time. If low<hi then step must be positive. If low>hi then step must be negative. Otherwise I will be set to empty.
[in]hiending 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<low
[out]Ilist of values from low to hi with step size step

◆ colormap() [1/5]

template<typename T >
void igl::colormap ( const ColorMapType  cm,
const T  f,
T *  rgb 
)

Compute [r,g,b] values of the selected colormap for a given factor f between 0 and 1.

Parameters
[in]ccolormap enum
[in]ffactor determining color value as if 0 was min and 1 was max
[out]rgbred, green, blue value

◆ colormap() [2/5]

template<typename T >
void igl::colormap ( const ColorMapType  cm,
const T  f,
T &  r,
T &  g,
T &  b 
)

Compute [r,g,b] values of the selected colormap for a given factor f between 0 and 1.

Parameters
[in]ccolormap enum
[in]ffactor determining color value as if 0 was min and 1 was max
[out]rred value
[out]ggreen value
[out]bblue value

◆ colormap() [3/5]

template<typename T >
void igl::colormap ( const double  palette[256][3],
const T  x_in,
T &  r,
T &  g,
T &  b 
)

Compute [r,g,b] values of the colormap palette for a given factor f between 0 and 1.

Parameters
[in]palette256 by 3 array of color values
[in]x_infactor determining color value as if 0 was min and 1 was max
[out]rred value
[out]ggreen value
[out]bblue value

◆ colormap() [4/5]

template<typename DerivedZ , typename DerivedC >
void igl::colormap ( const ColorMapType  cm,
const Eigen::MatrixBase< DerivedZ > &  Z,
const bool  normalize,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Compute [r,g,b] values of the colormap palette for a given factors between 0 and 1.

Parameters
[in]cmselected colormap palette to interpolate from
[in]Z#Z list of factors
[in]normalizewhether to normalize Z to be tightly between [0,1]
[out]C#C by 3 list of rgb colors

◆ colormap() [5/5]

template<typename DerivedZ , typename DerivedC >
void igl::colormap ( const ColorMapType  cm,
const Eigen::MatrixBase< DerivedZ > &  Z,
const double  min_Z,
const double  max_Z,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Compute [r,g,b] values of the colormap palette for a given factors between min_Z and max_Z

Parameters
[in]cmselected colormap palette to interpolate from
[in]Z#Z list of factors
[in]min_zvalue at "0"
[in]max_zvalue at "1"
[out]C#C by 3 list of rgb colors

◆ column_to_quats()

bool igl::column_to_quats ( const Eigen::VectorXd &  Q,
std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &  vQ 
)

de-"Columnize" a list of quaternions (q1x,q1y,q1z,q1w,q2x,q2y,q2z,q2w,...)

Parameters
[in]Qn*4-long list of coefficients
[out]vQn-long list of quaternions
Returns
false if n%4!=0

◆ columnize()

template<typename DerivedA , typename DerivedB >
void igl::columnize ( const Eigen::PlainObjectBase< DerivedA > &  A,
const int  k,
const int  dim,
Eigen::PlainObjectBase< DerivedB > &  B 
)

"Columnize" a stack of block matrices.

If A = [A1,A2,A3,...,Ak] with each A* an m by n block then this produces the column vector whose entries are B(j*m*k+i*k+b) = A(i,b*n+j); or if A = [A1;A2;...;Ak] then B(j*m*k+i*k+b) = A(i+b*m,j);

Template Parameters
Tshould be a eigen matrix primitive type like int or double
Parameters
[in]Am*k by n (dim: 1) or m by n*k (dim: 2) eigen Matrix of type T values
[in]knumber of blocks
[in]dimdimension in which blocks are stacked
[out]Bm*n*k eigen vector of type T values,
See also
transpose_blocks

◆ comb_cross_field()

template<typename DerivedV , typename DerivedF >
void igl::comb_cross_field ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedV > &  PD1in,
const Eigen::MatrixBase< DerivedV > &  PD2in,
Eigen::PlainObjectBase< DerivedV > &  PD1out,
Eigen::PlainObjectBase< DerivedV > &  PD2out 
)

Computes principal matchings of the vectors of a cross field across face edges, and generates a combed cross field defined on the mesh faces.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 4 eigen Matrix of face (quad) indices
[in]PD1in#F by 3 eigen Matrix of the first per face cross field vector
[in]PD2in#F by 3 eigen Matrix of the second per face cross field vector
[out]PD1out#F by 3 eigen Matrix of the first combed cross field vector
[out]PD2out#F by 3 eigen Matrix of the second combed cross field vector

◆ comb_frame_field()

template<typename DerivedV , typename DerivedF , typename DerivedP >
void igl::comb_frame_field ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedP > &  PD1,
const Eigen::MatrixBase< DerivedP > &  PD2,
const Eigen::MatrixBase< DerivedP > &  BIS1_combed,
const Eigen::MatrixBase< DerivedP > &  BIS2_combed,
Eigen::PlainObjectBase< DerivedP > &  PD1_combed,
Eigen::PlainObjectBase< DerivedP > &  PD2_combed 
)

Computes principal matchings of the vectors of a frame field across face edges, and generates a combed frame field defined on the mesh faces.

This makes use of a combed cross field generated by combing the field created by the bisectors of the frame field.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 4 eigen Matrix of face (quad) indices
[in]PD1#F by 3 eigen Matrix of the first per face cross field vector
[in]PD2#F by 3 eigen Matrix of the second per face cross field vector
[in]BIS1_combed#F by 3 eigen Matrix of the first combed bisector field vector
[in]BIS2_combed#F by 3 eigen Matrix of the second combed bisector field vector
[out]PD1_combed#F by 3 eigen Matrix of the first combed cross field vector
[out]PD2_combed#F by 3 eigen Matrix of the second combed cross field vector

◆ comb_line_field()

template<typename DerivedV , typename DerivedF >
void igl::comb_line_field ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedV > &  PD1in,
Eigen::PlainObjectBase< DerivedV > &  PD1out 
)

Computes principal matchings of the vectors of a cross field across face edges, and generates a combed cross field defined on the mesh faces.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 4 eigen Matrix of face (quad) indices
[in]PD1in#F by 3 eigen Matrix of the first per face cross field vector
[out]PD1out#F by 3 eigen Matrix of the first combed cross field vector

◆ combine() [1/2]

template<typename DerivedVV , typename DerivedFF , typename DerivedV , typename DerivedF , typename DerivedVsizes , typename DerivedFsizes >
void igl::combine ( const std::vector< DerivedVV > &  VV,
const std::vector< DerivedFF > &  FF,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedVsizes > &  Vsizes,
Eigen::PlainObjectBase< DerivedFsizes > &  Fsizes 
)

Concatenate k meshes into a single >=k connected component mesh with a single vertex list and face list.

Similar to Maya's Combine operation.

Parameters
[in]VVk-long list of lists of mesh vertex positions
[in]FFk-long list of lists of mesh face indices so that FF[i] indexes VV[i]
[out]VVV[0].rows()+...+VV[k-1].rows() by VV[0].cols() list of mesh vertex positions
[out]FFF[0].rows()+...+FF[k-1].rows() by FF[0].cols() list of mesh faces indices into V
[out]Vsizesk list so that Vsizes(i) is the #vertices in the ith input
[out]Fsizesk list so that Fsizes(i) is the #faces in the ith input

Example

// Suppose you have mesh A (VA,FA) and mesh B (VB,FB)
igl::combine<Eigen::MatrixXd,Eigen::MatrixXi>({VA,VB},{FA,FB},V,F);

◆ combine() [2/2]

template<typename DerivedVV , typename DerivedFF , typename DerivedV , typename DerivedF >
void igl::combine ( const std::vector< DerivedVV > &  VV,
const std::vector< DerivedFF > &  FF,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ compute_frame_field_bisectors() [1/2]

template<typename DerivedV , typename DerivedF >
void igl::compute_frame_field_bisectors ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedV > &  B1,
const Eigen::MatrixBase< DerivedV > &  B2,
const Eigen::MatrixBase< DerivedV > &  PD1,
const Eigen::MatrixBase< DerivedV > &  PD2,
Eigen::PlainObjectBase< DerivedV > &  BIS1,
Eigen::PlainObjectBase< DerivedV > &  BIS2 
)

Compute bisectors of a frame field defined on mesh faces.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 3 eigen Matrix of face (triangle) indices
[in]B1#F by 3 eigen Matrix of face (triangle) base vector 1
[in]B2#F by 3 eigen Matrix of face (triangle) base vector 2
[in]PD1#F by 3 eigen Matrix of the first per face frame field vector
[in]PD2#F by 3 eigen Matrix of the second per face frame field vector
[out]BIS1#F by 3 eigen Matrix of the first per face frame field bisector
[out]BIS2#F by 3 eigen Matrix of the second per face frame field bisector

◆ compute_frame_field_bisectors() [2/2]

template<typename DerivedV , typename DerivedF >
void igl::compute_frame_field_bisectors ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedV > &  PD1,
const Eigen::MatrixBase< DerivedV > &  PD2,
Eigen::PlainObjectBase< DerivedV > &  BIS1,
Eigen::PlainObjectBase< DerivedV > &  BIS2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ connect_boundary_to_infinity() [1/3]

template<typename DerivedF , typename DerivedFO >
void igl::connect_boundary_to_infinity ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedFO > &  FO 
)

Connect all boundary edges to a fictitious point at infinity.

Parameters
[in]F#F by 3 list of face indices into some V
[out]FO#F+#O by 3 list of face indices into [V;inf inf inf], original F are guaranteed to come first. If (V,F) was a manifold mesh, now it is closed with a possibly non-manifold vertex at infinity (but it will be edge-manifold).

◆ connect_boundary_to_infinity() [2/3]

template<typename DerivedF , typename DerivedFO >
void igl::connect_boundary_to_infinity ( const Eigen::MatrixBase< DerivedF > &  F,
const typename DerivedF::Scalar  inf_index,
Eigen::PlainObjectBase< DerivedFO > &  FO 
)

Connect all boundary edges to a fictitious point at infinity.

Parameters
[in]F#F by 3 list of face indices into some V
[in]inf_indexindex of point at infinity (usually V.rows() or F.maxCoeff())
[out]FO#F+#O by 3 list of face indices into [V;inf inf inf], original F are guaranteed to come first. If (V,F) was a manifold mesh, now it is closed with a possibly non-manifold vertex at infinity (but it will be edge-manifold).

◆ connect_boundary_to_infinity() [3/3]

template<typename DerivedV , typename DerivedF , typename DerivedVO , typename DerivedFO >
void igl::connect_boundary_to_infinity ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedVO > &  VO,
Eigen::PlainObjectBase< DerivedFO > &  FO 
)

Connect all boundary edges to a fictitious point at infinity.

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of face indices into some V
[out]VO#V+1 by 3 list of vertex positions, original V are guaranteed to come first. Last point is inf, inf, inf
[out]FO#F+#O by 3 list of face indices into VO

◆ connected_components()

template<typename Atype , typename DerivedC , typename DerivedK >
int igl::connected_components ( const Eigen::SparseMatrix< Atype > &  A,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedK > &  K 
)

Determine the connected components of a graph described by the input adjacency matrix (similar to MATLAB's graphconncomp or gptoolbox's conncomp, but A is transposed for unsymmetric graphs).

Parameters
[in]A#A by #A adjacency matrix (treated as describing an directed graph)
[out]C#A list of component indices into [0,#K-1]
[out]K#K list of sizes of each component
Returns
number of connected components

◆ cotmatrix() [1/2]

template<typename DerivedV , typename DerivedF , typename Scalar >
void igl::cotmatrix ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< Scalar > &  L 
)

Constructs the cotangent stiffness matrix (discrete laplacian) for a given mesh (V,F).

Template Parameters
DerivedVderived type of eigen matrix for V (e.g. derived from MatrixXd)
DerivedFderived type of eigen matrix for F (e.g. derived from MatrixXi)
Scalarscalar type for eigen sparse matrix (e.g. double)
Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by simplex_size list of mesh elements (triangles or tetrahedra)
[out]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)

◆ cotmatrix() [2/2]

template<typename DerivedV , typename DerivedI , typename DerivedC , typename Scalar >
void igl::cotmatrix ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedI > &  I,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::SparseMatrix< Scalar > &  L,
Eigen::SparseMatrix< Scalar > &  M,
Eigen::SparseMatrix< Scalar > &  P 
)

Cotangent Laplacian (and mass matrix) for polygon meshes according to "Polygon Laplacian Made Simple" [Bunge et al. 2020].

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]I#I vectorized list of polygon corner indices into rows of some matrix V
[in]C#polygons+1 list of cumulative polygon sizes so that C(i+1)-C(i) = size of the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the indices of the ith polygon
[out]L#V by #V polygon Laplacian made simple matrix
[out]M#V by #V mass matrix
[out]P#V+#polygons by #V prolongation operator

◆ cotmatrix_entries() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedC >
void igl::cotmatrix_entries ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Compute the cotmatrix contributions (cotangents) of each angle in mesh (V,F)

Parameters
[in]V#V by dim list of rest domain positions
[in]F#F by {3|4} list of {triangle|tetrahedra} indices into V
[out]C#F by 3 list of 1/2*cotangents corresponding angles for triangles, columns correspond to edges [1,2],[2,0],[0,1] or C #F by 6 list of 1/6*cotangents of dihedral angles*edge lengths for tets, columns along edges [1,2],[2,0],[0,1],[3,0],[3,1],[3,2]
See also
cotmatrix

◆ cotmatrix_entries() [2/2]

template<typename Derivedl , typename DerivedC >
void igl::cotmatrix_entries ( const Eigen::MatrixBase< Derivedl > &  l,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Compute the cotmatrix contributions (cotangents) of each angle in mesh with edge lengths (l)

Parameters
[in]l#F by 3 list of triangle edge lengths (see edge_lengths)
[out]C#F by 3 list of 1/2*cotangents corresponding angles for triangles, columns correspond to edges [1,2],[2,0],[0,1]
See also
cotmatrix

◆ cotmatrix_intrinsic()

template<typename Derivedl , typename DerivedF , typename Scalar >
void igl::cotmatrix_intrinsic ( const Eigen::MatrixBase< Derivedl > &  l,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< Scalar > &  L 
)

Constructs the cotangent stiffness matrix (discrete laplacian) for a given mesh with faces F and edge lengths l.

Parameters
[in]l#F by 3 list of (half-)edge lengths
[in]F#F by 3 list of face indices into some (not necessarily determined/embedable) list of vertex positions V. It is assumed #V == F.maxCoeff()+1
[out]L#V by #V sparse Laplacian matrix
See also
cotmatrix, intrinsic_delaunay_cotmatrix

◆ count() [1/2]

template<typename XType , typename SType >
void igl::count ( const Eigen::SparseMatrix< XType > &  X,
const int  dim,
Eigen::SparseVector< SType > &  S 
)

Count the number of non-zeros in the columns or rows of a sparse matrix.

Parameters
[in]Xm by n sparse matrix
[in]dimdimension along which to sum (1 or 2)
[out]Sn-long sparse vector (if dim == 1) or m-long sparse vector (if dim == 2)
Note
If your looking for dense matrix matlab like sum for eigen matrics just use: M.colwise().count() or M.rowwise().count()

◆ count() [2/2]

template<typename XType , typename DerivedS >
void igl::count ( const Eigen::SparseMatrix< XType > &  X,
const int  dim,
Eigen::PlainObjectBase< DerivedS > &  S 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Outputs a dense vector.

◆ covariance_scatter_matrix()

void igl::covariance_scatter_matrix ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const ARAPEnergyType  energy,
Eigen::SparseMatrix< double > &  CSM 
)

Construct the covariance scatter matrix for a given arap energy.

Parameters
[in]V#V by Vdim list of initial domain positions
[in]F#F by 3 list of triangle indices into V
[in]energyARAPEnergyType enum value defining which energy is being used. See ARAPEnergyType.h for valid options and explanations.
[out]CSMdim*#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
See also
arap_linear_block, arap, ARAPEnergyType

◆ cr_vector_curvature_correction() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarK >
void igl::cr_vector_curvature_correction ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarK > &  K 
)

Computes the vector Crouzeix-Raviart curvature correction term of Oded Stein, Alec Jacobson, Max Wardetzky, Eitan Grinspun, 2020.

"A Smoothness Energy without Boundary Distortion for Curved Surfaces", but using the basis functions by Oded Stein, Max Wardetzky, Alec Jacobson, Eitan Grinspun, 2020. "A Simple Discretization of the Vector Dirichlet Energy"

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh face indices into rows of V
[in]E#F by 4 a mapping from each halfedge to each edge
[in]oE#F by 3 the orientation (e.g., -1 or 1) of each halfedge compared to the orientation of the actual edge, as computed with orient_halfedges. will be computed if not provided.
[out]K2*|HE| by 2*|HE| computed curvature correction matrix

◆ cr_vector_curvature_correction() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarK >
void igl::cr_vector_curvature_correction ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarK > &  K 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

E and oE are computed and output.

◆ cr_vector_curvature_correction_intrinsic() [1/3]

template<typename DerivedF , typename DerivedL_sq , typename Derivedtheta , typename Derivedkappa , typename DerivedE , typename DerivedOE , typename ScalarK >
void igl::cr_vector_curvature_correction_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedL_sq > &  l_sq,
const Eigen::MatrixBase< Derivedtheta > &  theta,
const Eigen::MatrixBase< Derivedkappa > &  kappa,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarK > &  K 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

intrinsic version.

Parameters
[in]l_sq#F by 3 list of squared edge lengths of each halfedge
[in]theta#F by 3 list of the tip angles at each halfedge
[in]kappa#V by 1 list of the Gaussian curvature at each vertex

include/igl/cr_vector_curvature_correction.h

◆ cr_vector_curvature_correction_intrinsic() [2/3]

template<typename DerivedF , typename DerivedL_sq , typename DerivedE , typename DerivedOE , typename ScalarK >
void igl::cr_vector_curvature_correction_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedL_sq > &  l_sq,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarK > &  K 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. include/igl/cr_vector_curvature_correction.h.

◆ cr_vector_curvature_correction_intrinsic() [3/3]

template<typename DerivedF , typename DerivedL_sq , typename Derivedtheta , typename DerivedE , typename DerivedOE , typename ScalarK >
void igl::cr_vector_curvature_correction_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedL_sq > &  l_sq,
const Eigen::MatrixBase< Derivedtheta > &  theta,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarK > &  K 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. include/igl/cr_vector_curvature_correction.h.

◆ cr_vector_laplacian() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarL >
void igl::cr_vector_laplacian ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarL > &  L 
)

Computes the CR vector Laplacian matrix.

See Oded Stein, Max Wardetzky, Alec Jacobson, Eitan Grinspun, 2020. "A Simple Discretization of the Vector Dirichlet Energy"

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh face indices into rows of V
[in]E#F by 3 a mapping from each halfedge to each edge
[in]oE#F by 3 the orientation (e.g., -1 or 1) of each halfedge compared to the orientation of the actual edge, as computed with orient_halfedges. will be computed if not provided.
[out]L2*|HE| by 2*|HE| computed Laplacian matrix

◆ cr_vector_laplacian() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarL >
void igl::cr_vector_laplacian ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarL > &  L 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

E and oE are computed and output.

◆ cr_vector_laplacian_intrinsic() [1/2]

template<typename DerivedF , typename DerivedL_sq , typename DeriveddA , typename DerivedE , typename DerivedOE , typename ScalarL >
void igl::cr_vector_laplacian_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedL_sq > &  l_sq,
const Eigen::MatrixBase< DeriveddA > &  dA,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarL > &  L 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

intrinsic version.

Parameters
[in]l_sq#F by 3 list of squared edge lengths of each halfedge
[in]dA#F list of double areas

include/igl/cr_vector_laplacian.h

◆ cr_vector_laplacian_intrinsic() [2/2]

template<typename DerivedF , typename DerivedL_sq , typename DerivedE , typename DerivedOE , typename ScalarL >
void igl::cr_vector_laplacian_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedL_sq > &  l_sq,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarL > &  L 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. include/igl/cr_vector_laplacian.h.

◆ cr_vector_mass() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename ScalarM >
void igl::cr_vector_mass ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
Eigen::SparseMatrix< ScalarM > &  M 
)

Computes the CR vector mass matrix, using an arrangement of all parallel degrees of freedom first, and all perpendicular degrees of freedom next.

See Oded Stein, Max Wardetzky, Alec Jacobson, Eitan Grinspun, 2020. "A Simple Discretization of the Vector Dirichlet Energy"

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh face indices into rows of V
[in]E#F by 3 a mapping from each halfedge to each edge
[out]L2*|HE| by 2*|HE| computed Mass matrix

◆ cr_vector_mass() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename ScalarM >
void igl::cr_vector_mass ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::SparseMatrix< ScalarM > &  M 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

E are (possibly?) computed and output.

◆ cr_vector_mass_intrinsic()

template<typename DerivedF , typename DeriveddA , typename DerivedE , typename ScalarM >
void igl::cr_vector_mass_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DeriveddA > &  dA,
const Eigen::MatrixBase< DerivedE > &  E,
Eigen::SparseMatrix< ScalarM > &  M 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

intrinsic version.

Parameters
[in]dA#F list of double areas

include/igl/cr_vector_mass.h

◆ cross() [1/2]

void igl::cross ( const double *  a,
const double *  b,
double *  out 
)

Cross product; out = cross(a,b)

Parameters
[in]aleft 3d vector
[in]bright 3d vector
[out]outresult 3d vector

◆ cross() [2/2]

template<typename DerivedA , typename DerivedB , typename DerivedC >
void igl::cross ( const Eigen::PlainObjectBase< DerivedA > &  A,
const Eigen::PlainObjectBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Computes rowwise cross product C = cross(A,B,2);.

Parameters
[in]A#A by 3 list of row-vectors
[in]B#A by 3 list of row-vectors
[out]C#A by 3 list of row-vectors

◆ cross_field_mismatch()

template<typename DerivedV , typename DerivedF , typename DerivedM >
void igl::cross_field_mismatch ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedV > &  PD1,
const Eigen::MatrixBase< DerivedV > &  PD2,
const bool  isCombed,
Eigen::PlainObjectBase< DerivedM > &  mismatch 
)

Calculates the mismatch (integer), at each face edge, of a cross field defined on the mesh faces.

The integer mismatch is a multiple of pi/2 that transforms the cross on one side of the edge to the cross on the other side. It represents the deviation from a Lie connection across the edge.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 3 eigen Matrix of face (quad) indices
[in]PD1#F by 3 eigen Matrix of the first per face cross field vector
[in]PD2#F by 3 eigen Matrix of the second per face cross field vector
[in]isCombedboolean, specifying whether the field is combed (i.e. matching has been precomputed. If not, the field is combed first.
[out]mismatch#F by 3 eigen Matrix containing the integer mismatch of the cross field across all face edges

◆ crouzeix_raviart_cotmatrix() [1/2]

template<typename DerivedV , typename DerivedF , typename LT , typename DerivedE , typename DerivedEMAP >
void igl::crouzeix_raviart_cotmatrix ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< LT > &  L,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP 
)

Compute the Crouzeix-Raviart cotangent stiffness matrix.

See for example "Discrete Quadratic Curvature Energies" [Wardetzky, Bergou, Harmon, Zorin, Grinspun 2007]

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by 3/4 list of triangle/tetrahedron indices
[out]L#E by #E edge/face-based diagonal cotangent matrix
[out]E#E by 2/3 list of edges/faces
[out]EMAP#F*3/4 list of indices mapping allE to E
See also
crouzeix_raviart_massmatrix

◆ crouzeix_raviart_cotmatrix() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedEMAP , typename LT >
void igl::crouzeix_raviart_cotmatrix ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
Eigen::SparseMatrix< LT > &  L 
)

Compute the Crouzeix-Raviart cotangent stiffness matrix.

See for example "Discrete Quadratic Curvature Energies" [Wardetzky, Bergou, Harmon, Zorin, Grinspun 2007]

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by 3/4 list of triangle/tetrahedron indices
[in]E#E by 2/3 list of edges/faces
[in]EMAP#F*3/4 list of indices mapping allE to E
[out]L#E by #E edge/face-based diagonal cotangent matrix
See also
crouzeix_raviart_massmatrix

◆ crouzeix_raviart_massmatrix() [1/2]

template<typename MT , typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedEMAP >
void igl::crouzeix_raviart_massmatrix ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< MT > &  M,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP 
)

CROUZEIX_RAVIART_MASSMATRIX Compute the Crouzeix-Raviart mass matrix where M(e,e) is just the sum of the areas of the triangles on either side of an edge e.

See for example "Discrete Quadratic Curvature Energies" [Wardetzky, Bergou, Harmon, Zorin, Grinspun 2007]

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by 3/4 list of triangle/tetrahedron indices
[out]M#E by #E edge/face-based diagonal mass matrix
[out]E#E by 2/3 list of edges/faces
[out]EMAP#F*3/4 list of indices mapping allE to E
See also
crouzeix_raviart_cotmatrix

◆ crouzeix_raviart_massmatrix() [2/2]

template<typename MT , typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedEMAP >
void igl::crouzeix_raviart_massmatrix ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
Eigen::SparseMatrix< MT > &  M 
)

CROUZEIX_RAVIART_MASSMATRIX Compute the Crouzeix-Raviart mass matrix where M(e,e) is just the sum of the areas of the triangles on either side of an edge e.

See for example "Discrete Quadratic Curvature Energies" [Wardetzky, Bergou, Harmon, Zorin, Grinspun 2007]

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by 3/4 list of triangle/tetrahedron indices
[in]E#E by 2/3 list of edges/faces
[in]EMAP#F*3/4 list of indices mapping allE to E
[out]M#E by #E edge/face-based diagonal mass matrix
See also
crouzeix_raviart_cotmatrix

◆ cumprod()

template<typename DerivedX , typename DerivedY >
void igl::cumprod ( const Eigen::MatrixBase< DerivedX > &  X,
const int  dim,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

Computes a cumulative product of the columns of X, like matlab's cumprod.

Template Parameters
DerivedXType of matrix X
DerivedYType of matrix Y
Parameters
[in]Xm by n Matrix to be cumulatively multiplied.
[in]dimdimension to take cumulative product (1 or 2)
[out]Ym by n Matrix containing cumulative product.

◆ cumsum() [1/2]

template<typename DerivedX , typename DerivedY >
void igl::cumsum ( const Eigen::MatrixBase< DerivedX > &  X,
const int  dim,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

Computes a cumulative sum of the columns of X, like matlab's cumsum.

Template Parameters
DerivedXType of matrix X
DerivedYType of matrix Y
Parameters
[in]Xm by n Matrix to be cumulatively summed.
[in]dimdimension to take cumulative sum (1 or 2)
[out]Ym by n Matrix containing cumulative sum.

◆ cumsum() [2/2]

template<typename DerivedX , typename DerivedY >
void igl::cumsum ( const Eigen::MatrixBase< DerivedX > &  X,
const int  dim,
const bool  zero_prefix,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

Computes a cumulative sum of the columns of [0;X].

Parameters
[in]Xm by n Matrix to be cumulatively summed.
[in]dimdimension to take cumulative sum (1 or 2)
[in]zero_prefixwhether to use zero prefix
[out]Yif zero_prefix == false m by n Matrix containing cumulative sum else m+1 by n Matrix containing cumulative sum if dim=1 or m by n+1 Matrix containing cumulative sum if dim=2

◆ curved_hessian_energy() [1/3]

template<typename DerivedV , typename DerivedF , typename ScalarQ >
void igl::curved_hessian_energy ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< ScalarQ > &  Q 
)

Computes the curved Hessian energy using the Crouzeix-Raviart discretization.

See Oded Stein, Alec Jacobson, Max Wardetzky, Eitan Grinspun, 2020. "A Smoothness Energy without Boundary Distortion for Curved Surfaces"

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh faces (must be triangles)
[out]Q#V by #V Hessian energy matrix

◆ curved_hessian_energy() [2/3]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarQ >
void igl::curved_hessian_energy ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarQ > &  Q 
)

Computes the curved Hessian energy using the Crouzeix-Raviart discretization.

See Oded Stein, Alec Jacobson, Max Wardetzky, Eitan Grinspun, 2020. "A Smoothness Energy without Boundary Distortion for Curved Surfaces"

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh faces (must be triangles)
[in]E#F by 3 a mapping from each halfedge to each edge
[in]oE#F by 3 the orientation (e.g., -1 or 1) of each halfedge
[out]Q#V by #V Hessian energy matrix

◆ curved_hessian_energy() [3/3]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarQ >
void igl::curved_hessian_energy ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarQ > &  Q 
)

Computes the curved Hessian energy using the Crouzeix-Raviart discretization.

See Oded Stein, Alec Jacobson, Max Wardetzky, Eitan Grinspun, 2020. "A Smoothness Energy without Boundary Distortion for Curved Surfaces"

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh faces (must be triangles)
[out]E#F by 3 a mapping from each halfedge to each edge
[out]oE#F by 3 the orientation (e.g., -1 or 1) of each halfedge
[out]Q#V by #V Hessian energy matrix

◆ curved_hessian_energy_intrinsic() [1/2]

template<typename DerivedF , typename DerivedL_sq , typename DerivedE , typename DerivedOE , typename ScalarQ >
void igl::curved_hessian_energy_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedL_sq > &  l_sq,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarQ > &  Q 
)

Computes the curved Hessian energy using the Crouzeix-Raviart discretization.

See Oded Stein, Alec Jacobson, Max Wardetzky, Eitan Grinspun, 2020. "A Smoothness Energy without Boundary Distortion for Curved Surfaces"

Parameters
[in]F#F by 3 list of mesh face indices into rows of V
[in]l_sq#F by 3 list of squared edge lengths of each halfedge
[in]E#F by 3 a mapping from each halfedge to each edge
[in]oE#F by 3 the orientation (e.g., -1 or 1) of each halfedge compared to the orientation of the actual edge, as computed with orient_halfedges. will be computed if not provided.
[out]Q#V by #V Hessian energy matrix

◆ curved_hessian_energy_intrinsic() [2/2]

template<typename DerivedF , typename DerivedL_sq , typename DeriveddA , typename DerivedE , typename DerivedOE , typename ScalarQ >
void igl::curved_hessian_energy_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedL_sq > &  l_sq,
const Eigen::MatrixBase< DeriveddA > &  dA,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarQ > &  Q 
)

Computes the curved Hessian energy using the Crouzeix-Raviart discretization.

See Oded Stein, Alec Jacobson, Max Wardetzky, Eitan Grinspun, 2020. "A Smoothness Energy without Boundary Distortion for Curved Surfaces"

Parameters
[in]F#F by 3 list of mesh face indices into rows of V
[in]l_sq#F by 3 list of squared edge lengths of each halfedge
[in]dA#F list of double areas
[in]E#F by 3 a mapping from each halfedge to each edge
[in]oE#F by 3 the orientation (e.g., -1 or 1) of each halfedge compared to the orientation of the actual edge, as computed with orient_halfedges. will be computed if not provided.
[out]Q#V by #V Hessian energy matrix

◆ cut_mesh() [1/4]

template<typename DerivedV , typename DerivedF , typename DerivedC , typename DerivedI >
void igl::cut_mesh ( Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedC > &  cuts,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Given a mesh and a list of edges that are to be cut, the function generates a new disk-topology mesh that has the cuts at its boundary.

Note
Assumes mesh is edge-manifold.
Parameters
[in,out]V#V by 3 list of the vertex positions
[in,out]F#F by 3 list of the faces
[in]cuts#F by 3 list of boolean flags, indicating the edges that need to be cut (has 1 at the face edges that are to be cut, 0 otherwise)
[out]I#V by 1 list of the map between Vn to original V index.

◆ cut_mesh() [2/4]

template<typename DerivedV , typename DerivedF , typename DerivedFF , typename DerivedFFi , typename DerivedC , typename DerivedI >
void igl::cut_mesh ( Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::MatrixBase< DerivedFF > &  FF,
Eigen::MatrixBase< DerivedFFi > &  FFi,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Given a mesh and a list of edges that are to be cut, the function generates a new disk-topology mesh that has the cuts at its boundary.

Note
Assumes mesh is edge-manifold.
Parameters
[in,out]V#V by 3 list of the vertex positions
[in,out]F#F by 3 list of the faces
[in,out]FF#F by #3 adjacent matrix, the element i,j is the id of the triangle adjacent to the j edge of triangle i
[in,out]FFi#F by #3 adjacent matrix, the element i,j is the id of edge of the triangle TT(i,j) that is adjacent with triangle i
[in]C#F by 3 list of boolean flags, indicating the edges that need to be cut (has 1 at the face edges that are to be cut, 0 otherwise)
[out]I#V by 1 list of the map between Vn to original V index.
See also
triangle_triangle_adjacency

◆ cut_mesh() [3/4]

template<typename DerivedV , typename DerivedF , typename DerivedC >
void igl::cut_mesh ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedC > &  cuts,
Eigen::PlainObjectBase< DerivedV > &  Vn,
Eigen::PlainObjectBase< DerivedF > &  Fn 
)

Given a mesh and a list of edges that are to be cut, the function generates a new disk-topology mesh that has the cuts at its boundary.

Note
Assumes mesh is edge-manifold.
Parameters
[in,out]V#V by 3 list of the vertex positions
[in,out]F#F by 3 list of the faces
[in]cuts#F by 3 list of boolean flags, indicating the edges that need to be cut (has 1 at the face edges that are to be cut, 0 otherwise)
[out]Vn#V by 3 list of the vertex positions of the cut mesh. This matrix will be similar to the original vertices except some rows will be duplicated.
[out]Fn#F by 3 list of the faces of the cut mesh(must be triangles). This matrix will be similar to the original face matrix except some indices will be redirected to point to the newly duplicated vertices.

◆ cut_mesh() [4/4]

template<typename DerivedV , typename DerivedF , typename DerivedC , typename DerivedI >
void igl::cut_mesh ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedC > &  cuts,
Eigen::PlainObjectBase< DerivedV > &  Vn,
Eigen::PlainObjectBase< DerivedF > &  Fn,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Given a mesh and a list of edges that are to be cut, the function generates a new disk-topology mesh that has the cuts at its boundary.

Note
Assumes mesh is edge-manifold.
Parameters
[in,out]V#V by 3 list of the vertex positions
[in,out]F#F by 3 list of the faces
[in]cuts#F by 3 list of boolean flags, indicating the edges that need to be cut (has 1 at the face edges that are to be cut, 0 otherwise)
[out]Vn#V by 3 list of the vertex positions of the cut mesh. This matrix will be similar to the original vertices except some rows will be duplicated.
[out]Fn#F by 3 list of the faces of the cut mesh(must be triangles). This matrix will be similar to the original face matrix except some indices will be redirected to point to the newly duplicated vertices.
[out]I#V by 1 list of the map between Vn to original V index.

◆ cut_mesh_from_singularities()

template<typename DerivedV , typename DerivedF , typename DerivedM , typename DerivedO >
void igl::cut_mesh_from_singularities ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedM > &  MMatch,
Eigen::PlainObjectBase< DerivedO > &  seams 
)

Given a mesh (V,F) and the integer mismatch of a cross field per edge (mismatch), finds the cut_graph connecting the singularities (seams) and the degree of the singularities singularity_index.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of faces
[in]mismatch#F by 3 list of per corner integer mismatch
[out]seams#F by 3 list of per corner booleans that denotes if an edge is a seam or not

◆ cut_to_disk()

template<typename DerivedF , typename Index >
void igl::cut_to_disk ( const Eigen::MatrixBase< DerivedF > &  F,
std::vector< std::vector< Index > > &  cuts 
)

Given a triangle mesh, computes a set of edge cuts sufficient to carve the mesh into a topological disk, without disconnecting any connected components.

Nothing else about the cuts (including number, total length, or smoothness) is guaranteed to be optimal.

Simply-connected components without boundary (topological spheres) are left untouched (delete any edge if you really want a disk). All other connected components are cut into disks. Meshes with boundary are supported; boundary edges will be included as cuts.

The cut mesh itself can be materialized using cut_mesh().

Implements the triangle-deletion approach described by Gu et al's "Geometry Images."

Template Parameters
IndexIntegrable type large enough to represent the total number of faces and edges in the surface represented by F, and all entries of F.
Parameters
[in]F#F by 3 list of the faces (must be triangles)
[out]cutsList of cuts. Each cut is a sequence of vertex indices (where pairs of consecutive vertices share a face), is simple, and is either a closed loop (in which the first and last indices are identical) or an open curve. Cuts are edge-disjoint.

◆ cylinder()

template<typename DerivedV , typename DerivedF >
void igl::cylinder ( const int  axis_devisions,
const int  height_devisions,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

Construct a triangle mesh of a cylinder (without caps)

Parameters
[in]axis_devisionsnumber of vertices around the cylinder
[in]height_devisionsnumber of vertices up the cylinder
[out]V#V by 3 list of mesh vertex positions
[out]F#F by 3 list of triangle indices into V

◆ dated_copy() [1/2]

bool igl::dated_copy ( const std::string &  src_path,
const std::string &  dir 
)

Copy the given file to a new file with the same basename in dir directory with the current date and time as a suffix.

Parameters
[in]src_pathpath to source file
[in]dirdirectory of destination file
Returns
whether the copy was successful

Example:

dated_copy("/path/to/foo","/bar/");
// copies /path/to/foo to /bar/foo-2013-12-12T18-10-56
bool dated_copy(const std::string &src_path, const std::string &dir)
Copy the given file to a new file with the same basename in dir directory with the current date and t...

◆ dated_copy() [2/2]

bool igl::dated_copy ( const std::string &  src_path)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Uses current working directory.

◆ decimate() [1/5]

bool igl::decimate ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const size_t  max_m,
Eigen::MatrixXd &  U,
Eigen::MatrixXi &  G,
Eigen::VectorXi &  J,
Eigen::VectorXi &  I 
)

Assumes (V,F) is a manifold mesh (possibly with boundary) collapses edges until desired number of faces is achieved.

This uses default edge cost and merged vertex placement functions {edge length, edge midpoint}.

See include/igl/decimate.h for more details.

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by 3 list of face indices into V.
[in]max_mdesired number of output faces
[out]U#U by dim list of output vertex posistions (can be same ref as V)
[out]G#G by 3 list of output face indices into U (can be same ref as G)
[out]J#G list of indices into F of birth face
[out]I#U list of indices into V of birth vertices
Returns
true if m was reached (otherwise #G > m)

◆ decimate() [2/5]

bool igl::decimate ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const size_t  max_m,
Eigen::MatrixXd &  U,
Eigen::MatrixXi &  G,
Eigen::VectorXi &  J 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ decimate() [3/5]

bool igl::decimate ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const decimate_cost_and_placement_callback cost_and_placement,
const decimate_stopping_condition_callback stopping_condition,
const decimate_pre_collapse_callback pre_collapse,
const decimate_post_collapse_callback post_collapse,
const Eigen::MatrixXi &  E,
const Eigen::VectorXi &  EMAP,
const Eigen::MatrixXi &  EF,
const Eigen::MatrixXi &  EI,
Eigen::MatrixXd &  U,
Eigen::MatrixXi &  G,
Eigen::VectorXi &  J,
Eigen::VectorXi &  I 
)

Collapses edges of a closed manifold mesh (V,F) using user defined callbacks in a priority queue.

Functions control the cost and placement of each collapse the stopping criteria for queue processing and the callbacks for pre and post collapse operations. See the first implementation in decimate.cpp for an example of how to deal with open/non-manifold meshes and how to adjust cost and placement functions accordingly.

See include/igl/decimate.h for more details.

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by 3 list of face indices into V.
[in]cost_and_placementfunction computing cost of collapsing an edge and 3d position where it should be placed: cost_and_placement(V,F,E,EMAP,EF,EI,cost,placement);
[in]stopping_conditionfunction returning whether to stop collapsing edges based on current state. Guaranteed to be called after successfully collapsing edge e removing edges (e,e1,e2) and faces (f1,f2): bool should_stop = stopping_condition(V,F,E,EMAP,EF,EI,Q,Qit,C,e,e1,e2,f1,f2);
[in]pre_collapsecallback called with index of edge whose collapse is about to be attempted (see collapse_edge)
[in]post_collapsecallback called with index of edge whose collapse was just attempted and a flag revealing whether this was successful (see collapse_edge)
[in]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i)
[in]EI#E by 2 list of edge flap corners (see above).
[out]U#U by dim list of output vertex posistions (can be same ref as V)
[out]G#G by 3 list of output face indices into U (can be same ref as G)
[out]J#G list of indices into F of birth face
[out]I#U list of indices into V of birth vertices
Returns
true if m was reached (otherwise #G > m)
See also
connect_boundary_to_infinity

◆ decimate() [4/5]

bool igl::decimate ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const decimate_cost_and_placement_callback cost_and_placement,
const decimate_stopping_condition_callback stopping_condition,
const decimate_pre_collapse_callback pre_collapse,
const decimate_post_collapse_callback post_collapse,
Eigen::MatrixXd &  U,
Eigen::MatrixXi &  G,
Eigen::VectorXi &  J,
Eigen::VectorXi &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ decimate() [5/5]

bool igl::decimate ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const decimate_cost_and_placement_callback cost_and_placement,
const decimate_stopping_condition_callback stopping_condition,
Eigen::MatrixXd &  U,
Eigen::MatrixXi &  G,
Eigen::VectorXi &  J,
Eigen::VectorXi &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ decimate_trivial_callbacks()

void igl::decimate_trivial_callbacks ( decimate_pre_collapse_callback always_try,
decimate_post_collapse_callback never_care 
)

Function to build trivial pre and post collapse actions.

Parameters
[out]always_tryfunction that always returns true (always attempt the next edge collapse)
[out]never_carefuction that is always a no-op (never have a post collapse response)

◆ default_num_threads()

unsigned int igl::default_num_threads ( unsigned int  force_num_threads = 0)

Returns the default number of threads used in libigl.

The value returned by the first call to this function is cached. The following strategy is used to determine the default number of threads:

  1. User-provided argument force_num_threads if != 0.
  2. Environment variable IGL_NUM_THREADS if > 0.
  3. Hardware concurrency if != 0.
  4. A fallback value of 8 is used otherwise.
Note
It is safe to call this method from multiple threads.
Parameters
[in]force_num_threadsUser-provided default value.
Returns
Default number of threads.

◆ deform_skeleton() [1/2]

void igl::deform_skeleton ( const Eigen::MatrixXd &  C,
const Eigen::MatrixXi &  BE,
const std::vector< Eigen::Affine3d, Eigen::aligned_allocator< Eigen::Affine3d > > &  vA,
Eigen::MatrixXd &  CT,
Eigen::MatrixXi &  BET 
)

Deform a skeleton.

Parameters
[in]C#C by 3 list of joint positions
[in]BE#BE by 2 list of bone edge indices
[in]vA#BE list of bone transformations
[out]CT#BE*2 by 3 list of deformed joint positions
[out]BET#BE by 2 list of bone edge indices (maintains order)

◆ deform_skeleton() [2/2]

void igl::deform_skeleton ( const Eigen::MatrixXd &  C,
const Eigen::MatrixXi &  BE,
const Eigen::MatrixXd &  T,
Eigen::MatrixXd &  CT,
Eigen::MatrixXi &  BET 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]T#BE*4 by 3 list of stacked transformation matrix

◆ delaunay_triangulation()

template<typename DerivedV , typename Orient2D , typename InCircle , typename DerivedF >
void igl::delaunay_triangulation ( const Eigen::MatrixBase< DerivedV > &  V,
Orient2D  orient2D,
InCircle  incircle,
Eigen::PlainObjectBase< DerivedF > &  F 
)

Given a set of points in 2D, return a Delaunay triangulation of these points.

Parameters
[in]V#V by 2 list of vertex positions
[in]orient2DA functor such that orient2D(pa, pb, pc) returns 1 if pa,pb,pc forms a conterclockwise triangle. -1 if pa,pb,pc forms a clockwise triangle. 0 if pa,pb,pc are collinear. where the argument pa,pb,pc are of type Scalar[2].
[in]incircleA functor such that incircle(pa, pb, pc, pd) returns 1 if pd is on the positive size of circumcirle of (pa,pb,pc) -1 if pd is on the positive size of circumcirle of (pa,pb,pc) 0 if pd is cocircular with pa, pb, pc.
[out]F#F by 3 of faces in Delaunay triangulation.

◆ dfs() [1/2]

template<typename AType , typename DerivedD , typename DerivedP , typename DerivedC >
void igl::dfs ( const std::vector< std::vector< AType > > &  A,
const size_t  s,
Eigen::PlainObjectBase< DerivedD > &  D,
Eigen::PlainObjectBase< DerivedP > &  P,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Traverse a directed graph represented by an adjacency list using depth first search.

Parameters
[in]A#V list of adjacency lists
[in]sstarting node (index into A)
[out]D#V list of indices into rows of A in the order in which graph nodes are discovered.
[out]P#V list of indices into rows of A of predecessor in resulting spanning tree {-1 indicates root/not discovered), order corresponds to V not D.
[out]C#V list of indices into rows of A in order that nodes are "closed" (all descendants have been discovered)

◆ dfs() [2/2]

template<typename AType , typename DType , typename PType , typename CType >
void igl::dfs ( const std::vector< std::vector< AType > > &  A,
const size_t  s,
std::vector< DType > &  D,
std::vector< PType > &  P,
std::vector< CType > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ dihedral_angles()

template<typename DerivedV , typename DerivedT , typename Derivedtheta , typename Derivedcos_theta >
void igl::dihedral_angles ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedT > &  T,
Eigen::PlainObjectBase< Derivedtheta > &  theta,
Eigen::PlainObjectBase< Derivedcos_theta > &  cos_theta 
)

Compute dihedral angles for all tets of a given tet mesh (V,T).

Parameters
[in]V#V by dim list of vertex positions
[in]T#V by 4 list of tet indices
[out]theta#T by 6 list of dihedral angles (in radians)
[out]cos_theta#T by 6 list of cosine of dihedral angles (in radians)

◆ dihedral_angles_intrinsic()

template<typename DerivedL , typename DerivedA , typename Derivedtheta , typename Derivedcos_theta >
void igl::dihedral_angles_intrinsic ( const Eigen::MatrixBase< DerivedL > &  L,
const Eigen::MatrixBase< DerivedA > &  A,
Eigen::PlainObjectBase< Derivedtheta > &  theta,
Eigen::PlainObjectBase< Derivedcos_theta > &  cos_theta 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Intrinsic version.

Parameters
[in]L#L by 6 list of edge lengths
[in]A#A by 4 list of face areas

◆ dijkstra() [1/4]

template<typename IndexType , typename DerivedD , typename DerivedP >
int igl::dijkstra ( const IndexType &  source,
const std::set< IndexType > &  targets,
const std::vector< std::vector< IndexType > > &  VV,
const std::vector< double > &  weights,
Eigen::PlainObjectBase< DerivedD > &  min_distance,
Eigen::PlainObjectBase< DerivedP > &  previous 
)

Dijkstra's algorithm for vertex-weighted shortest paths, with multiple targets.

Adapted from http://rosettacode.org/wiki/Dijkstra%27s_algorithm .

Parameters
[in]sourceindex of source vertex
[in]targetstarget vector set
[in]VV#V list of lists of incident vertices (adjacency list), e.g. as returned by igl::adjacency_list
[in]weights#V list of scalar vertex weights
[out]min_distance#V by 1 list of the minimum distances from source to all vertices
[out]previous#V by 1 list of the previous visited vertices (for each vertex) - used for backtracking

◆ dijkstra() [2/4]

template<typename IndexType , typename DerivedV , typename DerivedD , typename DerivedP >
int igl::dijkstra ( const Eigen::MatrixBase< DerivedV > &  V,
const std::vector< std::vector< IndexType > > &  VV,
const IndexType &  source,
const std::set< IndexType > &  targets,
Eigen::PlainObjectBase< DerivedD > &  min_distance,
Eigen::PlainObjectBase< DerivedP > &  previous 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ dijkstra() [3/4]

template<typename IndexType , typename DerivedD , typename DerivedP >
int igl::dijkstra ( const IndexType &  source,
const std::set< IndexType > &  targets,
const std::vector< std::vector< IndexType > > &  VV,
Eigen::PlainObjectBase< DerivedD > &  min_distance,
Eigen::PlainObjectBase< DerivedP > &  previous 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ dijkstra() [4/4]

template<typename IndexType , typename DerivedP >
void igl::dijkstra ( const IndexType &  vertex,
const Eigen::MatrixBase< DerivedP > &  previous,
std::vector< IndexType > &  path 
)

Backtracking after Dijkstra's algorithm, to find shortest path.

Parameters
[in]vertexvertex to which we want the shortest path (from same source as above)
[in]previous#V by 1 list of the previous visited vertices (for each vertex) - result of Dijkstra's algorithm
[out]path#P by 1 list of vertex indices in the shortest path from vertex to source

◆ direct_delta_mush()

template<typename DerivedV , typename DerivedOmega , typename DerivedU >
void igl::direct_delta_mush ( const Eigen::MatrixBase< DerivedV > &  V,
const std::vector< Eigen::Affine3d, Eigen::aligned_allocator< Eigen::Affine3d > > &  T,
const Eigen::MatrixBase< DerivedOmega > &  Omega,
Eigen::PlainObjectBase< DerivedU > &  U 
)

Computes Direct Delta Mush Skinning (Variant 0) from "Direct Delta Mush Skinning and Variants".

Parameters
[in]V#V by 3 list of rest pose vertex positions
[in]T#T list of bone pose transformations
[in]Omega#V by #T*10 list of precomputated matrix values
[out]U#V by 3 list of output vertex positions

◆ direct_delta_mush_precomputation()

template<typename DerivedV , typename DerivedF , typename DerivedW , typename DerivedOmega >
void igl::direct_delta_mush_precomputation ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedW > &  W,
const int  p,
const typename DerivedV::Scalar  lambda,
const typename DerivedV::Scalar  kappa,
const typename DerivedV::Scalar  alpha,
Eigen::PlainObjectBase< DerivedOmega > &  Omega 
)

Precomputation for Direct Delta Mush Skinning.

Parameters
[in]V#V by 3 list of rest pose vertex positions
[in]F#F by 3 list of triangle indices into rows of V
[in]W#V by #Edges list of weights
[in]pnumber of smoothing iterations
[in]lambdarotation smoothing step size
[in]kappatranslation smoothness step size
[in]alphatranslation smoothness blending weight
[out]Omega#V by #T*10 list of precomputated matrix values

include/igl/direct_delta_mush.h

◆ directed_edge_orientations()

template<typename DerivedC , typename DerivedE >
void igl::directed_edge_orientations ( const Eigen::MatrixBase< DerivedC > &  C,
const Eigen::MatrixBase< DerivedE > &  E,
std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &  Q 
)

Determine rotations that take each edge from the x-axis to its given rest orientation.

Parameters
[in]C#C by 3 list of edge vertex positions
[in]E#E by 2 list of directed edges
[out]Q#E list of quaternions

◆ directed_edge_parents()

template<typename DerivedE , typename DerivedP >
void igl::directed_edge_parents ( const Eigen::MatrixBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Recover "parents" (preceding edges) in a tree given just directed edges.

Parameters
[in]E#E by 2 list of directed edges
[out]P#E list of parent indices into E (-1) means root

◆ dirname()

std::string igl::dirname ( const std::string &  path)

Function like PHP's dirname: /etc/passwd --> /etc,.

Parameters
[in]pathstring containing input path
Returns
string containing dirname (see php's dirname)
See also
basename, pathinfo
Note
This function will have undefined behavior if file names in the path contain \ and / characters. This function interprets \ and / as file path separators.

◆ dot()

double igl::dot ( const double *  a,
const double *  b 
)

Computes out = dot(a,b)

Parameters
[in]aleft 3d vector
[in]bright 3d vector
Returns
scalar dot product

◆ dot_row()

template<typename DerivedV >
DerivedV igl::dot_row ( const Eigen::PlainObjectBase< DerivedV > &  A,
const Eigen::PlainObjectBase< DerivedV > &  B 
)

Compute the dot product between each row of A and B.

Template Parameters
DerivedVderived from vertex positions matrix type: i.e. MatrixXd
Parameters
[in]Aeigen matrix r by c
[in]Beigen matrix r by c
[out]da column vector with r entries that contains the dot product of each corresponding row of A and B
Note
Unfortunately, Eigen does not support A.rowwise().dot(B.rowwise()) so this function is a wrapper around the less obvious and less convenient (A.array() * B.array()).rowwise().sum().

◆ doublearea() [1/4]

template<typename DerivedV , typename DerivedF , typename DeriveddblA >
void igl::doublearea ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DeriveddblA > &  dblA 
)

Computes twice the area for each input triangle or quad.

Template Parameters
DerivedVderived type of eigen matrix for V (e.g. derived from MatrixXd)
DerivedFderived type of eigen matrix for F (e.g. derived from MatrixXi)
DeriveddblAderived type of eigen matrix for dblA (e.g. derived from MatrixXd)
Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by simplex_size list of mesh faces (must be triangles or quads)
[out]dblA#F list of triangle[quad] double areas (SIGNED only for 2D input)

◆ doublearea() [2/4]

template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedD >
void igl::doublearea ( const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedD > &  D 
)

Compute the twice the signed area of a each triangle.

Parameters
[in]A#F by dim list of triangle corner positions
[in]B#F by dim list of triangle corner positions
[in]C#F by dim list of triangle corner positions
[out]D#F list of triangle double areas

◆ doublearea_single()

template<typename DerivedA , typename DerivedB , typename DerivedC >
DerivedA::Scalar igl::doublearea_single ( const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< DerivedC > &  C 
)

Compute the twice the signed area of a single triangle.

Parameters
[in]Atriangle corner position
[in]Btriangle corner position
[in]Ctriangle corner position
Returns
2*signed area of triangle

include/igl/doublearea.h

◆ doublearea() [3/4]

template<typename Derivedl , typename DeriveddblA >
void igl::doublearea ( const Eigen::MatrixBase< Derivedl > &  l,
const typename Derivedl::Scalar  nan_replacement,
Eigen::PlainObjectBase< DeriveddblA > &  dblA 
)

Compute twice the area of each intrinsic triangle in a mesh.

Parameters
[in]l#F by dim list of edge lengths using for triangles, columns correspond to edges 23,31,12
[in]nan_replacementwhat value should be used for triangles whose given edge lengths do not obey the triangle inequality. These may be very wrong (e.g., [100 1 1]) or may be nearly degenerate triangles whose floating point side length computation leads to breach of the triangle inequality. One may wish to set this parameter to 0 if side lengths l are known to come from a valid embedding (e.g., some mesh (V,F)). In that case, the only circumstance the triangle inequality is broken is when the triangle is nearly degenerate and floating point error dominates: hence replacing with zero is reasonable.
[out]dblA#F list of triangle double areas

◆ doublearea() [4/4]

template<typename Derivedl , typename DeriveddblA >
void igl::doublearea ( const Eigen::MatrixBase< Derivedl > &  l,
Eigen::PlainObjectBase< DeriveddblA > &  dblA 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

default behavior is to assert on NaNs and leave them in place

◆ doublearea_quad()

template<typename DerivedV , typename DerivedF , typename DeriveddblA >
void igl::doublearea_quad ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DeriveddblA > &  dblA 
)

Computes twice the area for each input quadrilateral.

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by simplex_size list of mesh faces (must be quadrilaterals)
[out]dblA#F list of quadrilateral double areas

include/igl/doublearea.h

◆ dqs()

template<typename DerivedV , typename DerivedW , typename Q , typename QAlloc , typename T , typename DerivedU >
void igl::dqs ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedW > &  W,
const std::vector< Q, QAlloc > &  vQ,
const std::vector< T > &  vT,
Eigen::PlainObjectBase< DerivedU > &  U 
)

Dual quaternion skinning.

Parameters
[in]V#V by 3 list of rest positions
[in]W#W by #C list of weights
[in]vQ#C list of rotation quaternions
[in]vT#C list of translation vectors
[out]U#V by 3 list of new positions

◆ dual_contouring() [1/3]

template<typename DerivedV , typename DerivedQ >
void igl::dual_contouring ( const std::function< typename DerivedV::Scalar(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &  f,
const std::function< Eigen::Matrix< typename DerivedV::Scalar, 1, 3 >(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &  f_grad,
const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &  min_corner,
const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &  max_corner,
const int  nx,
const int  ny,
const int  nz,
const bool  constrained,
const bool  triangles,
const bool  root_finding,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedQ > &  Q 
)

Dual contouring to extract a pure quad mesh from differentiable implicit function using a dense grid.

Parameters
[in]ffunction returning >0 outside, <0 inside and =0 on the surface
[in]f_gradfunction returning ∇f/‖∇f‖
[in]min_cornerposition of primal grid vertex at minimum corner
[in]max_cornerposition of primal grid vertex at maximum corner
[in]nxnumber of vertices on x side of primal grid
[in]nynumber of vertices on y side of primal grid
[in]nznumber of vertices on z side of primal grid
[in]constrainedwhether to force dual vertices to lie strictly inside corresponding primal cell (prevents self-intersections at cost of surface quality; marginally slower)
[in]triangleswhether to output four triangles instead of one quad per crossing edge (quad mesh usually looks fine)
[in]root_findingwhether to use root finding to identify crossing point on each edge (improves quality a lot at cost of performance). If false, use linear interpolation.
[out]V#V by 3 list of outputs vertex positions
[out]Q#Q by 4 (or 3 if triangles=true) face indices into rows of V

◆ dual_contouring() [2/3]

template<typename DerivedGf , typename DerivedGV , typename DerivedV , typename DerivedQ >
void igl::dual_contouring ( const std::function< typename DerivedV::Scalar(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &  f,
const std::function< Eigen::Matrix< typename DerivedV::Scalar, 1, 3 >(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &  f_grad,
const Eigen::MatrixBase< DerivedGf > &  Gf,
const Eigen::MatrixBase< DerivedGV > &  GV,
const int  nx,
const int  ny,
const int  nz,
const bool  constrained,
const bool  triangles,
const bool  root_finding,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedQ > &  Q 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]Gfnx*ny*nz list of function values so that Gf(k) = f(GV.row(k)) (only needs to be accurate near f=0 and correct sign elsewhere)
[in]GVnx*ny*nz list of grid positions so that the x,y,z grid position is at GV.row(x+nx*(y+z*ny))

◆ dual_contouring() [3/3]

template<typename DerivedGf , typename DerivedGV , typename DerivedGI , typename DerivedV , typename DerivedQ >
void igl::dual_contouring ( const std::function< typename DerivedV::Scalar(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &  f,
const std::function< Eigen::Matrix< typename DerivedV::Scalar, 1, 3 >(const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &)> &  f_grad,
const Eigen::Matrix< typename DerivedV::Scalar, 1, 3 > &  step,
const Eigen::MatrixBase< DerivedGf > &  Gf,
const Eigen::MatrixBase< DerivedGV > &  GV,
const Eigen::MatrixBase< DerivedGI > &  GI,
const bool  constrained,
const bool  triangles,
const bool  root_finding,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedQ > &  Q 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Sparse voxel grid

Parameters
[in]Gf#GV list of corresponding f values. If using root finding then only the sign needs to be correct.
[in]GV#GV by 3 list of sparse grid positions referenced by GI
[in]GI#GI by 2 list of edge indices into rows of GV

◆ ears()

template<typename DerivedF , typename Derivedear , typename Derivedear_opp >
void igl::ears ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< Derivedear > &  ear,
Eigen::PlainObjectBase< Derivedear_opp > &  ear_opp 
)

Find all ears (faces with two boundary edges) in a given mesh.

Parameters
[in]F#F by 3 list of triangle mesh indices
[out]earsears list of indices into F of ears
[out]ear_oppears list of indices indicating which edge is non-boundary (connecting to flops)

◆ edge_collapse_is_valid() [1/2]

bool igl::edge_collapse_is_valid ( const int  e,
const Eigen::MatrixXi &  F,
const Eigen::MatrixXi &  E,
const Eigen::VectorXi &  EMAP,
const Eigen::MatrixXi &  EF,
const Eigen::MatrixXi &  EI 
)

Tests whether collapsing exactly two faces and exactly 3 edges from E (e and one side of each face gets collapsed to the other) will result in a mesh with the same topology.

Assumes (V,F) is a closed manifold mesh (except for previouslly collapsed faces which should be set to: [IGL_COLLAPSE_EDGE_NULL IGL_COLLAPSE_EDGE_NULL IGL_COLLAPSE_EDGE_NULL].

Parameters
[in]eindex into E of edge to try to collapse. E(e,:) = [s d] or [d s] so that s<d, then d is collapsed to s.
[in]F#F by 3 list of face indices into V.
[in]E#E by 2 list of edge indices into V.
[in]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i)
[in]EI#E by 2 list of edge flap corners (see above).
Returns
true if edge collapse is valid

◆ edge_collapse_is_valid() [2/2]

bool igl::edge_collapse_is_valid ( std::vector< int > &  Nsv,
std::vector< int > &  Ndv 
)

Tests whether collapsing exactly two faces and exactly 3 edges from E (e and one side of each face gets collapsed to the other) will result in a mesh with the same topology.

Parameters
[in]Nsv#Nsv list of "next" vertices circulating around starting vertex of edge
[in]Ndv#Ndv list of "next" vertices circulating around destination vertex of edge
[out]Nsv(side-effect: sorted by value)
[out]Ndv(side-effect: sorted by value)
Returns
true iff edge collapse is valid
See also
circulation

◆ edge_crossings()

template<typename DeriveduE , typename DerivedS , typename DerivedT >
void igl::edge_crossings ( const Eigen::MatrixBase< DeriveduE > &  uE,
const Eigen::MatrixBase< DerivedS > &  S,
const typename DerivedS::Scalar  val,
std::unordered_map< int, int > &  uE2I,
Eigen::PlainObjectBase< DerivedT > &  T 
)

Compute the each point that a scalar field crosses a specified value along an edge of a mesh.

Parameters
[in]uE#E by 2 list of edge indices
[in]S#V by 1 list of scalar field values
[in]valvalue to check for crossings
[out]uE2I#T map from edge index to index in T
[out]T#T by 1 list of parametric coordinates of crossings
See also
isolines, isolines_intrinsic

◆ edge_exists_near()

template<typename DeriveduE , typename DerivedEMAP , typename uE2EType , typename Index >
bool igl::edge_exists_near ( const Eigen::MatrixBase< DeriveduE > &  uE,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
const std::vector< std::vector< uE2EType > > &  uE2E,
const Index &  a,
const Index &  b,
const Index &  uei 
)

Does edge (a,b) exist in the edges of all faces incident on existing unique edge uei.

Parameters
[in]uE#uE by 2 list of unique undirected edges
[in]EMAP#F*3 list of indices into uE, mapping each directed edge to unique undirected edge
[in]uE2E#uE list of lists of indices into E of coexisting edges
[in]E#F*3 by 2 list of half-edges
[in]a1st end-point of query edge
[in]b2nd end-point of query edge
[in]ueiindex into uE/uE2E of unique edge
Returns
true if edge exists near uei.
See also
unique_edge_map

◆ edge_flaps() [1/2]

void igl::edge_flaps ( const Eigen::MatrixXi &  F,
const Eigen::MatrixXi &  uE,
const Eigen::VectorXi &  EMAP,
Eigen::MatrixXi &  EF,
Eigen::MatrixXi &  EI 
)

Determine "edge flaps": two faces on either side of a unique edge (assumes edge-manifold mesh)

Parameters
[in]F#F by 3 list of face indices
[in]uE#uE by 2 list of edge indices into V.
[in]EMAP#F*3 list of indices into uE, mapping each directed edge to unique unique edge in uE
[out]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i)
[out]EI#E by 2 list of edge flap corners (see above).
See also
unique_edge_map
Note
This seems to be a duplicate of edge_topology.h
igl::edge_topology(V,F,etEV,etFE,etEF);
igl::edge_flaps(F,efE,efEMAP,efEF,efEI);
[~,I] = sort(efE,2)
all( efE(sub2ind(size(efE),repmat(1:size(efE,1),2,1)',I)) == etEV )
all( efEF(sub2ind(size(efE),repmat(1:size(efE,1),2,1)',I)) == etEF )
all(efEMAP(sub2ind(size(F),repmat(1:size(F,1),3,1)',repmat([1 2 3],size(F,1),1))) == etFE(:,[2 3 1]))
void edge_topology(const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedE > &EV, Eigen::PlainObjectBase< DerivedE > &FE, Eigen::PlainObjectBase< DerivedE > &EF)
Initialize Edges and their topological relations (assumes an edge-manifold mesh).
void edge_flaps(const Eigen::MatrixXi &F, const Eigen::MatrixXi &uE, const Eigen::VectorXi &EMAP, Eigen::MatrixXi &EF, Eigen::MatrixXi &EI)
Determine "edge flaps": two faces on either side of a unique edge (assumes edge-manifold mesh)
void all(const Eigen::SparseMatrix< AType > &A, const int dim, Eigen::PlainObjectBase< DerivedB > &B)
Check whether all values are logically true along a dimension.
void sort(const Eigen::DenseBase< DerivedX > &X, const int dim, const bool ascending, Eigen::PlainObjectBase< DerivedY > &Y, Eigen::PlainObjectBase< DerivedIX > &IX)
Sort the elements of a matrix X along a given dimension like matlabs sort function.
void repmat(const Eigen::MatrixBase< DerivedA > &A, const int r, const int c, Eigen::PlainObjectBase< DerivedB > &B)
Replicate and tile a matrix.

◆ edge_flaps() [2/2]

void igl::edge_flaps ( const Eigen::MatrixXi &  F,
Eigen::MatrixXi &  uE,
Eigen::VectorXi &  EMAP,
Eigen::MatrixXi &  EF,
Eigen::MatrixXi &  EI 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ edge_lengths()

template<typename DerivedV , typename DerivedF , typename DerivedL >
void igl::edge_lengths ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedL > &  L 
)

Constructs a list of lengths of edges opposite each index in a face (triangle/tet) list.

Template Parameters
DerivedVderived from vertex positions matrix type: i.e. MatrixXd
DerivedFderived from face indices matrix type: i.e. MatrixXi
DerivedLderived from edge lengths matrix type: i.e. MatrixXd
Parameters
[in]Veigen matrix #V by 3
[in]F#F by (2|3|4) list of mesh simplex indices into rows of V
[out]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]

◆ edge_midpoints()

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedoE , typename Derivedmps >
void igl::edge_midpoints ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedoE > &  oE,
Eigen::PlainObjectBase< Derivedmps > &  mps 
)

Computes the midpoints of edges in a triangle mesh.

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of triangle indices
[in]E#F by 3 a mapping from each halfedge to each edge
[in]oE#F by 3 the orientation (e.g., -1 or 1) of each halfedge compared to the orientation of the actual edge, as computed with orient_halfedges. will be computed if not provided.
[out]mps|HE| list of edge midpoints
See also
orient_halfedges

◆ edge_topology()

template<typename DerivedV , typename DerivedF , typename DerivedE >
void igl::edge_topology ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  EV,
Eigen::PlainObjectBase< DerivedE > &  FE,
Eigen::PlainObjectBase< DerivedE > &  EF 
)

Initialize Edges and their topological relations (assumes an edge-manifold mesh).

Parameters
[in]V#V by dim list of mesh vertex positions (unused)
[in]F#F by 3 list of triangle indices into V
[out]EV#Ex2 matrix storing the edge description as pair of indices to vertices
[out]FE#Fx3 matrix storing the Triangle-Edge relation
[out]EF#Ex2 matrix storing the Edge-Triangle relation
Note
This seems to be a inferior duplicate of edge_flaps.h:
  • unused input parameter V
  • roughly 2x slower than edge_flaps
  • outputs less information: edge_flaps reveals corner opposite edge
  • FE uses non-standard and ambiguous order: FE(f,c) is merely an edge incident on corner c of face f. In contrast, edge_flaps's EMAP(f,c) reveals the edge opposite corner c of face f

◆ edge_vectors() [1/2]

template<bool computePerpendicular = true, typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedoE , typename DerivedvecParallel , typename DerivedvecPerpendicular >
void igl::edge_vectors ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedoE > &  oE,
Eigen::PlainObjectBase< DerivedvecParallel > &  vecParallel,
Eigen::PlainObjectBase< DerivedvecPerpendicular > &  vecPerpendicular 
)

Computes the normalized edge vectors for edges in a triangle mesh.

Template Parameters
whetherto compute edge perpendiculars
Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of triangle indices
[in]E#F by 3 a mapping from each halfedge to each edge
[in]oE#F by 3 the orientation (e.g., -1 or 1) of each halfedge compared to the orientation of the actual edge, as computed with orient_halfedges. will be computed if not provided.
[out]vecParallel|HE| list of edge vectors
[out]vecPerpendicular|HE| list of vectors perpendicular to vec

◆ edge_vectors() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedoE , typename Derivedvec >
void igl::edge_vectors ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedoE > &  oE,
Eigen::PlainObjectBase< Derivedvec > &  vec 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ edges() [1/3]

template<typename DerivedF , typename DerivedE >
void igl::edges ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E 
)

Constructs a list of unique edges represented in a given mesh (V,F)

Parameters
[in]F#F by (3|4) list of mesh simplex indices
[out]E#E by 2 list of edges in no particular order
See also
adjacency_matrix

◆ edges() [2/3]

template<typename DerivedI , typename DerivedC , typename DerivedE >
void igl::edges ( const Eigen::MatrixBase< DerivedI > &  I,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedE > &  E 
)

Constructs a list of unique edges represented in a given polygon mesh.

Parameters
[in]I#I vectorized list of polygon corner indices into rows of some matrix V
[in]C#polygons+1 list of cumulative polygon sizes so that C(i+1)-C(i) = size of the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the indices of the ith polygon
[out]E#E by 2 list of edges in no particular order

◆ edges() [3/3]

template<typename T , typename DerivedE >
void igl::edges ( const Eigen::SparseMatrix< T > &  A,
Eigen::PlainObjectBase< DerivedE > &  E 
)

Constructs a list of unique edges represented in a given adjacency matrix.

Parameters
[in]A#V by #V symmetric adjacency matrix
[out]E#E by 2 list of edges in no particular order

◆ edges_to_path()

template<typename DerivedE , typename DerivedI , typename DerivedJ , typename DerivedK >
void igl::edges_to_path ( const Eigen::MatrixBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedJ > &  J,
Eigen::PlainObjectBase< DerivedK > &  K 
)

Given a set of undirected, unique edges such that all form a single connected compoent with exactly 0 or 2 nodes with valence =1, determine the/a path visiting all nodes.

Parameters
[in]E#E by 2 list of undirected edges
[out]I#E+1 list of nodes in order tracing the chain (loop), if the output is a loop then I(1) == I(end)
[out]J#I-1 list of indices into E of edges tracing I
[out]K#I-1 list of indices into columns of E {0,1} so that K(i) means that E(i,K(i)) comes before the other (i.e., E(i,3-K(i)) ). This means that I(i) == E(J(i),K(i)) for i<#I, or I == E(sub2ind(size(E),J([1:end end]),[K;3-K(end)]))))

◆ eigs()

template<typename Atype , typename Btype , typename DerivedU , typename DerivedS >
bool igl::eigs ( const Eigen::SparseMatrix< Atype > &  A,
const Eigen::SparseMatrix< Btype > &  B,
const size_t  k,
const EigsType  type,
Eigen::PlainObjectBase< DerivedU > &  sU,
Eigen::PlainObjectBase< DerivedS > &  sS 
)

Compute the first/last k eigen pairs of the generalized eigen value problem:

A u = s B u

Solutions are approximate and sorted.

Note
Ideally one should use ARPACK and the Eigen unsupported ARPACK module. This implementation does simple, naive power iterations.
See also
spectra::eigs
Parameters
[in]A#A by #A symmetric matrix
[in]B#A by #A symmetric positive-definite matrix
[in]knumber of eigen pairs to compute
[in]typewhether to extract from the high or low end
[out]sU#A by k list of sorted eigen vectors (descending)
[out]sSk list of sorted eigen values (descending)
Warning
only the 'sm' small magnitude eigen values are well supported

◆ EPS()

template<typename S_type >
S_type igl::EPS ( )

Function returning EPS for corresponding type.

◆ EPS_SQ()

template<typename S_type >
S_type igl::EPS_SQ ( )

Function returning EPS_SQ for corresponding type.

◆ EPS< float >()

template<>
float igl::EPS< float > ( )

◆ EPS< double >()

template<>
double igl::EPS< double > ( )

◆ EPS_SQ< float >()

template<>
float igl::EPS_SQ< float > ( )

◆ EPS_SQ< double >()

template<>
double igl::EPS_SQ< double > ( )

◆ euler_characteristic()

template<typename DerivedF >
int igl::euler_characteristic ( const Eigen::MatrixBase< DerivedF > &  F)

Computes the Euler characteristic of a given mesh (V,F)

χ = |V| - |E| + |F|

For example,

  • a single triangle has 3 - 3 + 1 = 1
  • a tetrahedron has 4 - 6 + 4 = 2
Parameters
[in]F#F by dim list of mesh faces (must be triangles)
Returns
An int containing the Euler characteristic
Note
There is some confusion over the standard definition of Euler characteristic. libigl's definition agrees with wikipedia and [David Eppstein's proofs](https://www.ics.uci.edu/~eppstein/junkyard/euler/all.html).

◆ exact_geodesic()

template<typename DerivedV , typename DerivedF , typename DerivedVS , typename DerivedFS , typename DerivedVT , typename DerivedFT , typename DerivedD >
void igl::exact_geodesic ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedVS > &  VS,
const Eigen::MatrixBase< DerivedFS > &  FS,
const Eigen::MatrixBase< DerivedVT > &  VT,
const Eigen::MatrixBase< DerivedFT > &  FT,
Eigen::PlainObjectBase< DerivedD > &  D 
)

Exact geodesic algorithm for triangular mesh with the implementation from https://code.google.com/archive/p/geodesic/, and the algorithm first described by Mitchell, Mount and Papadimitriou in 1987.

Parameters
[in]V#V by 3 list of 3D vertex positions
[in]F#F by 3 list of mesh faces
[in]VS#VS by 1 vector specifying indices of source vertices
[in]FS#FS by 1 vector specifying indices of source faces
[in]VT#VT by 1 vector specifying indices of target vertices
[in]FT#FT by 1 vector specifying indices of target faces
[out]D#VT+#FT by 1 vector of geodesic distances of each target w.r.t. the nearest one in the source set
Note
specifying a face as target/source means its center.

◆ example_fun()

template<typename Printable >
bool igl::example_fun ( const Printable &  input)

This is an example of a function, it takes a templated parameter and shovels it into cout.

Template Parameters
Ttype that supports
Parameters
[in]inputsome input of a Printable type
Returns
true for the sake of returning something

◆ exploded_view()

template<typename DerivedV , typename DerivedT , typename DerivedEV , typename DerivedEF , typename DerivedI , typename DerivedJ >
void igl::exploded_view ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedT > &  T,
const typename DerivedV::Scalar  s,
const typename DerivedV::Scalar  t,
Eigen::PlainObjectBase< DerivedEV > &  EV,
Eigen::PlainObjectBase< DerivedEF > &  EF,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedJ > &  J 
)

Given a tet-mesh, create a trivial surface mesh (4 triangles per tet) with each tet scaled individually and translated outward from the mesh's centroid, creating an exploded-view visualization.

Parameters
[in]V#V by 3 list of tet mesh vertex positions
[in]T#T by 4 list of tet mesh indices into rows of V
[in]samount to scale each tet indvidually, typically (0,1]
[in]tamount to scale away from mesh's centroid, typically >=1
[out]EV#T*4 by 3 list of output mesh vertex positions
[out]EF#T*4 by 3 list of output triangle indices into rows of EV
[out]I#EV list of indices into V revealing birth parent
[out]J#EF list of indices into F revealing birth parent

◆ extension()

std::string igl::extension ( const std::string &  path)

Extract file extension from path.

Parameters
[in]pathpath with an extension (path/to/foo.obj)
Returns
extension without dot (obj)
See also
pathinfo, basename, dirname

◆ exterior_edges() [1/2]

void igl::exterior_edges ( const Eigen::MatrixXi &  F,
Eigen::MatrixXi &  E 
)

Determines boundary "edges" and also edges with an odd number of occurrences where seeing edge (i,j) counts as +1 and seeing the opposite edge (j,i) counts as -1.

Parameters
[in]F#F by simplex_size list of "faces"
[out]E#E by simplex_size-1 list of exterior edges

◆ exterior_edges() [2/2]

Eigen::MatrixXi igl::exterior_edges ( const Eigen::MatrixXi &  F)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ extract_manifold_patches() [1/3]

template<typename DerivedF , typename DerivedEMAP , typename DeriveduEC , typename DeriveduEE , typename DerivedP >
size_t igl::extract_manifold_patches ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
const Eigen::MatrixBase< DeriveduEC > &  uEC,
const Eigen::MatrixBase< DeriveduEE > &  uEE,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Extract a set of maximal patches from a given mesh.

A maximal patch is a subset of the input faces that are connected via manifold edges; a patch is as large as possible.

Parameters
[in]F#F by 3 list representing triangles.
[in]EMAP#F*3 list of indices of unique undirected edges.
[in]uEC#uE+1 list of cumsums of directed edges sharing each unique edge
[in]uEE#F*3 list of indices into E (see igl::unique_edge_map)
[out]P#F list of patch incides.
Returns
number of manifold patches.

◆ extract_manifold_patches() [2/3]

template<typename DerivedF , typename DerivedEMAP , typename uE2EType , typename DerivedP >
size_t igl::extract_manifold_patches ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
const std::vector< std::vector< uE2EType > > &  uE2E,
Eigen::PlainObjectBase< DerivedP > &  P 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]uE2E#uE list of lists of indices into E of coexisting edges.

◆ extract_manifold_patches() [3/3]

template<typename DerivedF , typename DerivedP >
size_t igl::extract_manifold_patches ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedP > &  P 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ extract_non_manifold_edge_curves()

template<typename DerivedF , typename DerivedEMAP , typename uE2EType >
void igl::extract_non_manifold_edge_curves ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
const std::vector< std::vector< uE2EType > > &  uE2E,
std::vector< std::vector< size_t > > &  curves 
)

Extract non-manifold curves from a given mesh.

A non-manifold curves are a set of connected non-manifold edges that does not touch other non-manifold edges except at the end points. They are also maximal in the sense that they cannot be expanded by including more edges.

Assumes the input mesh have all self-intersection resolved. See igl::cgal::remesh_self_intersection for more details.

Parameters
[in]F#F by 3 list representing triangles.
[in]EMAP#F*3 list of indices of unique undirected edges.
[in]uE2E#uE list of lists of indices into E of coexisting edges.
[out]curvesAn array of arrays of unique edge indices.

◆ face_areas() [1/3]

template<typename DerivedV , typename DerivedT , typename DerivedA >
void igl::face_areas ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedA > &  A 
)

Constructs a list of face areas of faces opposite each index in a tet list.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]T#T by 3 list of tet mesh indices into V
[out]A#T by 4 list of face areas corresponding to faces opposite vertices 0,1,2,3

◆ face_areas() [2/3]

template<typename DerivedL , typename DerivedA >
void igl::face_areas ( const Eigen::MatrixBase< DerivedL > &  L,
Eigen::PlainObjectBase< DerivedA > &  A 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Compute tet-mesh face areas from edge lengths.

Parameters
[in]L#T by 6 list of tet-mesh edge lengths corresponding to edges [3 0],[3 1],[3 2],[1 2],[2 0],[0 1]

◆ face_areas() [3/3]

template<typename DerivedL , typename DerivedA >
void igl::face_areas ( const Eigen::MatrixBase< DerivedL > &  L,
const typename DerivedL::Scalar  doublearea_nan_replacement,
Eigen::PlainObjectBase< DerivedA > &  A 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]doublearea_nan_replacementSee doublearea.h

◆ face_occurrences() [1/2]

template<typename IntegerF , typename IntegerC >
void igl::face_occurrences ( const std::vector< std::vector< IntegerF > > &  F,
std::vector< IntegerC > &  C 
)

Count the occurances of each face (row) in a list of face indices (irrespecitive of order)

Parameters
[in]F#F by simplex-size
[out]C#F list of counts
Precondition
triangles/tets only (where ignoring order still gives simplex)

◆ face_occurrences() [2/2]

template<typename DerivedF , typename DerivedC >
void igl::face_occurrences ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ faces_first() [1/2]

template<typename MatV , typename MatF , typename VecI >
void igl::faces_first ( const MatV &  V,
const MatF &  F,
MatV &  RV,
MatF &  RF,
VecI &  IM 
)

Reorder vertices so that vertices in face list come before vertices that don't appear in the face list.

This is especially useful if the face list contains only surface faces and you want surface vertices listed before internal vertices

Template Parameters
MatVmatrix for vertex positions, e.g. MatrixXd
MatFmatrix for face indices, e.g. MatrixXi
VecIvector for index map, e.g. VectorXi
Parameters
[in]V# vertices by 3 vertex positions
[in]F# faces by 3 list of face indices
[out]RV# vertices by 3 vertex positions, order such that if the jth vertex is some face in F, and the kth vertex is not then j comes before k
[out]RF# faces by 3 list of face indices, reindexed to use RV
[out]IM#V by 1 list of indices such that: RF = IM(F) and RT = IM(T) and RV(IM,:) = V

Example:

// Tet mesh in (V,T,F)
faces_first(V,F,IM);
T = T.unaryExpr(bind1st(mem_fun( static_cast<VectorXi::Scalar&
(VectorXi::*)(VectorXi::Index)>(&VectorXi::operator())),
&IM)).eval();
void faces_first(const MatV &V, const MatF &F, MatV &RV, MatF &RF, VecI &IM)
Reorder vertices so that vertices in face list come before vertices that don't appear in the face lis...

◆ faces_first() [2/2]

template<typename MatV , typename MatF , typename VecI >
void igl::faces_first ( MatV &  V,
MatF &  F,
VecI &  IM 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ facet_adjacency_matrix()

template<typename DerivedF , typename Atype >
void igl::facet_adjacency_matrix ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< Atype > &  A 
)

Construct a #F×#F adjacency matrix with A(i,j)>0 indicating that faces i and j share an edge.

Parameters
[in]F#F by 3 list of facets
[out]A#F by #F adjacency matrix

◆ facet_components() [1/2]

template<typename DerivedF , typename DerivedC >
int igl::facet_components ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Compute connected components of facets based on edge-edge adjacency.

For connected components on vertices see igl::vertex_components

Parameters
[in]F#F by 3 list of triangle indices
[out]C#F list of connected component ids
Returns
number of connected components

◆ facet_components() [2/2]

template<typename TTIndex , typename DerivedC , typename Derivedcounts >
void igl::facet_components ( const std::vector< std::vector< std::vector< TTIndex > > > &  TT,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< Derivedcounts > &  counts 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]TT#TT by 3 list of list of adjacency triangles (see triangle_triangle_adjacency.h)
[out]counts#C list of number of facets in each components

◆ false_barycentric_subdivision()

template<typename Scalar , typename Index >
void igl::false_barycentric_subdivision ( const Eigen::PlainObjectBase< Scalar > &  V,
const Eigen::PlainObjectBase< Index > &  F,
Eigen::PlainObjectBase< Scalar > &  VD,
Eigen::PlainObjectBase< Index > &  FD 
)

Refine the mesh by adding the barycenter of each face.

Parameters
[in]V#V by 3 coordinates of the vertices
[in]F#F by 3 list of mesh faces (must be triangles)
[out]VD#V + #F by 3 coordinate of the vertices of the dual mesh The added vertices are added at the end of VD (should not be same references as (V,F)
[out]FD#F*3 by 3 faces of the dual mesh

◆ fast_find_intersections() [1/2]

template<typename DerivedV1 , typename DerivedF1 , typename DerivedV2 , typename DerivedF2 , typename DerivedI , typename DerivedE >
void igl::fast_find_intersections ( const Eigen::MatrixBase< DerivedV1 > &  V1,
const Eigen::MatrixBase< DerivedF1 > &  F1,
const Eigen::MatrixBase< DerivedV2 > &  V2,
const Eigen::MatrixBase< DerivedF2 > &  F2,
Eigen::PlainObjectBase< DerivedI > &  intersect_pairs,
Eigen::PlainObjectBase< DerivedE > &  edges 
)

Identify triangles where two meshes interesect using AABBTree and tri_tri_intersection_test_3d.

Parameters
[in]V1#V by 3 list representing vertices on the first mesh
[in]F1#F by 3 list representing triangles on the first mesh
[in]V2#V by 3 list representing vertices on the second mesh
[in]F2#F by 3 list representing triangles on the second mesh
[out]intersect_pairscorrespondance list of intersecting triangles column 0 - mesh 1, column 1 - mesh2
[out]edgeslist of pairs of intersection edges
See also
copyleft::cgal::intersect_other

◆ fast_find_intersections() [2/2]

template<typename DerivedV1 , typename DerivedF1 , typename DerivedV2 , typename DerivedF2 , typename DerivedI , typename DerivedE >
void igl::fast_find_intersections ( const AABB< DerivedV1, 3 > &  tree,
const Eigen::MatrixBase< DerivedV1 > &  V1,
const Eigen::MatrixBase< DerivedF1 > &  F1,
const Eigen::MatrixBase< DerivedV2 > &  V2,
const Eigen::MatrixBase< DerivedF2 > &  F2,
Eigen::PlainObjectBase< DerivedI > &  intersect_pairs,
Eigen::PlainObjectBase< DerivedE > &  edges 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]tree- AABB tree bult from the first mesh

◆ fast_find_self_intersections() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedI , typename DerivedE >
bool igl::fast_find_self_intersections ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedI > &  intersect,
Eigen::PlainObjectBase< DerivedE > &  edges 
)

Identify triangles where mesh intersects itself using AABBTree and tri_tri_intersection_test_3d.

Parameters
[in]V#V by 3 list representing vertices
[in]F#F by 3 list representing triangles.
[out]intersect#F by 1 indicator that triangle intersects anothe triangle
[out]edgeslist of pairs of intersection edges
Returns
whether any self-interections were found
See also
copyleft::cgal::remesh_self_intersections

◆ fast_find_self_intersections() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedI >
bool igl::fast_find_self_intersections ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedI > &  intersect 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ fast_winding_number() [1/8]

template<typename DerivedP , typename DerivedA , typename DerivedN , typename Index , typename DerivedCH , typename DerivedCM , typename DerivedR , typename DerivedEC >
void igl::fast_winding_number ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedA > &  A,
const std::vector< std::vector< Index > > &  point_indices,
const Eigen::MatrixBase< DerivedCH > &  CH,
const int  expansion_order,
Eigen::PlainObjectBase< DerivedCM > &  CM,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedEC > &  EC 
)

Generate the precomputation for the fast winding number for point data [Barill et.

al 2018].

Given a set of 3D points P, with normals N, areas A, along with octree data, and an expansion order, we define a taylor series expansion at each octree cell.

The octree data is designed to come from igl::octree, and the areas (if not obtained at scan time), may be calculated using igl::copyleft::cgal::point_areas.

Parameters
[in]P#P by 3 list of point locations
[in]N#P by 3 list of point normals
[in]A#P by 1 list of point areas
[in]point_indicesa vector of vectors, where the ith entry is a vector of the indices into P that are the ith octree cell's points
[in]CH#OctreeCells by 8, where the ith row is the indices of the ith octree cell's children
[in]expansion_orderthe order of the taylor expansion. We support 0,1,2.
[out]CM#OctreeCells by 3 list of each cell's center of mass
[out]R#OctreeCells by 1 list of each cell's maximum distance of any point to the center of mass
[out]EC#OctreeCells by #TaylorCoefficients list of expansion coefficients. (Note that #TaylorCoefficients = ∑_{i=1}^{expansion_order} 3^i)
See also
copyleft::cgal::point_areas, knn

◆ fast_winding_number() [2/8]

template<typename DerivedP , typename DerivedA , typename DerivedN , typename Index , typename DerivedCH , typename DerivedCM , typename DerivedR , typename DerivedEC , typename DerivedQ , typename BetaType , typename DerivedWN >
void igl::fast_winding_number ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedA > &  A,
const std::vector< std::vector< Index > > &  point_indices,
const Eigen::MatrixBase< DerivedCH > &  CH,
const Eigen::MatrixBase< DerivedCM > &  CM,
const Eigen::MatrixBase< DerivedR > &  R,
const Eigen::MatrixBase< DerivedEC > &  EC,
const Eigen::MatrixBase< DerivedQ > &  Q,
const BetaType  beta,
Eigen::PlainObjectBase< DerivedWN > &  WN 
)

Evaluate the fast winding number for point data, having already done the the precomputation.

Parameters
[in]P#P by 3 list of point locations
[in]N#P by 3 list of point normals
[in]A#P by 1 list of point areas
[in]point_indicesa vector of vectors, where the ith entry is a vector of the indices into P that are the ith octree cell's points
[in]CH#OctreeCells by 8, where the ith row is the indices of the ith octree cell's children
[in]CM#OctreeCells by 3 list of each cell's center of mass
[in]R#OctreeCells by 1 list of each cell's maximum distance of any point to the center of mass
[in]EC#OctreeCells by #TaylorCoefficients list of expansion coefficients. (Note that #TaylorCoefficients = ∑_{i=1}^{expansion_order} 3^i)
[in]Q#Q by 3 list of query points for the winding number
[in]betaThis is a Barnes-Hut style accuracy term that separates near feild from far field. The higher the beta, the more accurate and slower the evaluation. We reccommend using a beta value of 2. Note that for a beta value ≤ 0, we use the direct evaluation, rather than the fast approximation
[out]WN#Q by 1 list of windinng number values at each query point

◆ fast_winding_number() [3/8]

template<typename DerivedP , typename DerivedA , typename DerivedN , typename DerivedQ , typename BetaType , typename DerivedWN >
void igl::fast_winding_number ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedQ > &  Q,
const int  expansion_order,
const BetaType  beta,
Eigen::PlainObjectBase< DerivedWN > &  WN 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Evaluate the fast winding number for point data without caching the precomputation.

◆ fast_winding_number() [4/8]

template<typename DerivedP , typename DerivedA , typename DerivedN , typename DerivedQ , typename DerivedWN >
void igl::fast_winding_number ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedQ > &  Q,
Eigen::PlainObjectBase< DerivedWN > &  WN 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ fast_winding_number() [5/8]

template<typename DerivedV , typename DerivedF , typename DerivedQ , typename DerivedW >
void igl::fast_winding_number ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedQ > &  Q,
Eigen::PlainObjectBase< DerivedW > &  W 
)

Compute approximate winding number of a triangle soup mesh according to "Fast Winding Numbers for Soups and Clouds" [Barill et al.

2018].

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of triangle mesh indices into rows of V
[in]Q#Q by 3 list of query positions
[out]W#Q list of winding number values

◆ fast_winding_number() [6/8]

template<typename DerivedV , typename DerivedF >
void igl::fast_winding_number ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const int  order,
FastWindingNumberBVH &  fwn_bvh 
)

Precomputation for computing approximate winding numbers of a triangle soup.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of triangle mesh indices into rows of V
[in]orderTaylor series expansion order to use (e.g., 2)
[out]fwn_bvhPrecomputed bounding volume hierarchy

◆ fast_winding_number() [7/8]

template<typename DerivedQ , typename DerivedW >
void igl::fast_winding_number ( const FastWindingNumberBVH &  fwn_bvh,
const float  accuracy_scale,
const Eigen::MatrixBase< DerivedQ > &  Q,
Eigen::PlainObjectBase< DerivedW > &  W 
)

After precomputation, compute winding number at a each of many points in a list.

Parameters
[in]fwn_bvhPrecomputed bounding volume hierarchy
[in]accuracy_scaleparameter controlling accuracy (e.g., 2)
[in]Q#Q by 3 list of query positions
[out]W#Q list of winding number values

◆ fast_winding_number() [8/8]

template<typename Derivedp >
Derivedp::Scalar igl::fast_winding_number ( const FastWindingNumberBVH &  fwn_bvh,
const float  accuracy_scale,
const Eigen::MatrixBase< Derivedp > &  p 
)

After precomputation, compute winding number at a single point.

Parameters
[in]fwn_bvhPrecomputed bounding volume hierarchy
[in]accuracy_scaleparameter controlling accuracy (e.g., 2)
[in]psingle position
Returns
w winding number of this point

◆ file_contents_as_string() [1/2]

bool igl::file_contents_as_string ( const std::string  file_name,
std::string &  content 
)

Read a files contents as plain text into a given string.

Parameters
[in]file_namepath to file to be read
[out]contentoutput string containing contents of the given file
Returns
true on succes, false on error

◆ file_contents_as_string() [2/2]

std::string igl::file_contents_as_string ( const std::string  file_name)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ file_dialog_open()

std::string igl::file_dialog_open ( )

Open a file dialog to select a file.

Returns
string with a path to an existing file or empty if no file is selected (on Linux machines, it assumes that Zenity is installed)

◆ file_dialog_save()

std::string igl::file_dialog_save ( )

Open a file dialog to select a file.

Returns
string with a path to a new or existing file or empty if no file is selected (on Linux machines, it assumes that Zenity is installed)

◆ file_exists()

bool igl::file_exists ( const std::string  filename)

Check if a file or directory exists like PHP's file_exists function:

http://php.net/manual/en/function.file-exists.php

Parameters
[in]filenamepath to file
Returns
true if file exists and is readable and false if file doesn't exist or is not readable

◆ find() [1/6]

template<typename T , typename DerivedI , typename DerivedJ , typename DerivedV >
void igl::find ( const Eigen::SparseMatrix< T > &  X,
Eigen::DenseBase< DerivedI > &  I,
Eigen::DenseBase< DerivedJ > &  J,
Eigen::DenseBase< DerivedV > &  V 
)

Find the non-zero entries and there respective indices in a sparse matrix.

Like matlab's [I,J,V] = find(X)

Template Parameters
Tshould be a eigen sparse matrix primitive type like int or double
Parameters
[in]Xm by n matrix whose entries are to be found
[out]Innz vector of row indices of non zeros entries in X
[out]Jnnz vector of column indices of non zeros entries in X
[out]Vnnz vector of type T non-zeros entries in X

◆ find() [2/6]

template<typename T >
std::vector< Eigen::Triplet< T > > igl::find ( const Eigen::SparseMatrix< T > &  X)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find() [3/6]

template<typename DerivedX , typename DerivedI , typename DerivedJ , typename DerivedV >
void igl::find ( const Eigen::DenseBase< DerivedX > &  X,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedJ > &  J,
Eigen::PlainObjectBase< DerivedV > &  V 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find() [4/6]

template<typename DerivedX , typename DerivedI >
void igl::find ( const Eigen::DenseBase< DerivedX > &  X,
Eigen::PlainObjectBase< DerivedI > &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]Innz vector of indices into vectorization of X

◆ find() [5/6]

template<typename T >
void igl::find ( const Eigen::SparseVector< T > &  X,
Eigen::Matrix< int, Eigen::Dynamic, 1 > &  I,
Eigen::Matrix< T, Eigen::Dynamic, 1 > &  V 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find() [6/6]

template<int RowsAtCompileTime, int MaxRowsAtCompileTime>
std::vector< int > igl::find ( const Eigen::Array< bool, RowsAtCompileTime, 1, 0, MaxRowsAtCompileTime, 1 > &  M)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This overload facilitates the use of bool masks for Eigen slicing

Template Parameters
RowsAtCompileTimenumber of rows in M at compile time
Returns
indices of true entries in M

Example
// Is the same as
B = A(igl::find(M),igl::find(N));
void slice_mask(const Eigen::SparseMatrix< XType > &X, const Eigen::Array< bool, Eigen::Dynamic, 1 > &R, const Eigen::Array< bool, Eigen::Dynamic, 1 > &C, Eigen::SparseMatrix< YType > &Y)
Act like the matlab X(row_mask,col_mask) operator, where row_mask, col_mask are non-negative integer ...
void find(const Eigen::SparseMatrix< T > &X, Eigen::DenseBase< DerivedI > &I, Eigen::DenseBase< DerivedJ > &J, Eigen::DenseBase< DerivedV > &V)
Find the non-zero entries and there respective indices in a sparse matrix.
See also
slice_mask

◆ find_cross_field_singularities() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedM , typename DerivedO >
void igl::find_cross_field_singularities ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedM > &  mismatch,
Eigen::PlainObjectBase< DerivedO > &  isSingularity,
Eigen::PlainObjectBase< DerivedO > &  singularityIndex 
)

Computes singularities of a cross field, assumed combed.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 3 eigen Matrix of face (quad) indices
[in]mismatch#F by 3 eigen Matrix containing the integer mismatch of the cross field across all face edges
[out]isSingularity#V by 1 boolean eigen Vector indicating the presence of a singularity on a vertex
[out]singularityIndex#V by 1 integer eigen Vector containing the singularity indices

◆ find_cross_field_singularities() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedO >
void igl::find_cross_field_singularities ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedV > &  PD1,
const Eigen::MatrixBase< DerivedV > &  PD2,
Eigen::PlainObjectBase< DerivedO > &  isSingularity,
Eigen::PlainObjectBase< DerivedO > &  singularityIndex,
bool  isCombed = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Wrapper that calculates the mismatch if it is not provided.

Parameters
[in]PD1#F by 3 eigen Matrix of the first per face cross field vector
[in]PD2#F by 3 eigen Matrix of the second per face cross field vector
[in]isCombedboolean indicating whether the cross field is combed
Note
the field in PD1 and PD2 MUST BE combed (see igl::comb_cross_field).

◆ find_zero()

template<typename AType , typename DerivedI >
void igl::find_zero ( const Eigen::SparseMatrix< AType > &  A,
const int  dim,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Find the first zero (whether implicit or explicitly stored) in the rows/columns of a matrix.

Parameters
[in]Am by n sparse matrix
[in]dimdimension along which to check for any (1 or 2)
[out]In-long vector (if dim == 1) {m means no zeros found} or m-long vector (if dim == 2) {n means no zeros found}

◆ fit_cubic_bezier()

void igl::fit_cubic_bezier ( const Eigen::MatrixXd &  d,
const double  error,
std::vector< Eigen::MatrixXd > &  cubics 
)

Fit a cubic bezier spline (G1 continuous) to an ordered list of input points in any dimension, according to "An algorithm for automatically fitting digitized curves" [Schneider 1990].

Parameters
[in]d#d by dim list of points along a curve to be fit with a cubic bezier spline (should probably be roughly uniformly spaced). If d(0)==d(end), then will treat as a closed curve.
[in]errormaximum squared distance allowed
[out]cubics#cubics list of 4 by dim lists of cubic control points

◆ fit_cubic_bezier_substring()

void igl::fit_cubic_bezier_substring ( const Eigen::MatrixXd &  d,
const int  first,
const int  last,
const Eigen::RowVectorXd &  tHat1,
const Eigen::RowVectorXd &  tHat2,
const double  error,
const bool  force_split,
std::vector< Eigen::MatrixXd > &  cubics 
)

Recursive helper function for fit_cubic_bezier.

include/igl/fit_cubic_bezier.h

Parameters
[in]firstindex of first point in d of substring
[in]lastindex of last point in d of substring
[in]tHat1tangent to use at beginning of spline
[in]tHat2tangent to use at end of spline
[in]errorsee above
[in]force_splitwhether to force a split (i.e., force a recursive call)
[in]cubicsrunning list of cubics so far
[out]cubicsrunning list of cubics so far (new cubics appended)

◆ fit_plane()

void igl::fit_plane ( const Eigen::MatrixXd &  V,
Eigen::RowVector3d &  N,
Eigen::RowVector3d &  C 
)

Fit a plane to a point cloud.

Parameters
[in]V#Vx3 matrix. The 3D point cloud, one row for each vertex.
[out]N1x3 Vector. The normal of the fitted plane.
[out]C1x3 Vector. A point that lies in the fitted plane.

From http://missingbytes.blogspot.com/2012/06/fitting-plane-to-point-cloud.html

◆ fit_rotations()

template<typename DerivedS , typename DerivedD >
void igl::fit_rotations ( const Eigen::PlainObjectBase< DerivedS > &  S,
const bool  single_precision,
Eigen::PlainObjectBase< DerivedD > &  R 
)

Given an input mesh and new positions find rotations for every covariance matrix in a stack of covariance matrices.

Parameters
[in]Snr*dim by dim stack of covariance matrices
[in]single_precisionwhether to use single precision (faster)
[out]Rdim by dim * nr list of rotations
Note
This seems to be implemented in Eigen/Geometry: Eigen::umeyama

◆ fit_rotations_planar()

template<typename DerivedS , typename DerivedD >
void igl::fit_rotations_planar ( const Eigen::PlainObjectBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedD > &  R 
)

Given an input mesh and new positions find 2D rotations for every vertex that best maps its one ring to the new one ring.

include/igl/fit_rotations.h

Parameters
[in]Snr*dim by dim stack of covariance matrices, third column and every third row will be ignored
[out]Rdim by dim * nr list of rotations, third row and third column of each rotation will just be identity

◆ flip_avoiding_line_search()

double igl::flip_avoiding_line_search ( const Eigen::MatrixXi &  F,
Eigen::MatrixXd &  cur_v,
const Eigen::MatrixXd &  dst_v,
std::function< double(Eigen::MatrixXd &)> &  energy,
double  cur_energy = -1 
)

A bisection line search for a mesh based energy that avoids triangle flips as suggested in "Bijective Parameterization with Free Boundaries" (Smith J.

and Schaefer S., 2015).

The user specifies an initial vertices position (that has no flips) and target one (that my have flipped triangles). This method first computes the largest step in direction of the destination vertices that does not incur flips, and then minimizes a given energy using this maximal step and a bisection linesearch (see igl::line_search).

Supports both triangle and tet meshes.

Parameters
[in]F#F by 3/4 list of mesh faces or tets
[in]cur_v#V by dim list of variables
[in]dst_v#V by dim list of target vertices. This mesh may have flipped triangles
[in]energyA function to compute the mesh-based energy (return an energy that is bigger than 0)
[in]cur_energy(OPTIONAL)The energy at the given point. Helps save redundant computations. This is optional. If not specified, the function will compute it.
[out]cur_v#V by dim list of variables at the new location
Returns
the energy at the new point

◆ flip_edge()

template<typename DerivedF , typename DerivedE , typename DeriveduE , typename DerivedEMAP , typename uE2EType >
void igl::flip_edge ( Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DeriveduE > &  uE,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP,
std::vector< std::vector< uE2EType > > &  uE2E,
const size_t  uei 
)

Flip an edge in a triangle mesh.

The edge specified by uei must have exactly two adjacent faces. Violation will result in exception. Another warning: edge flipping could convert manifold mesh into non-manifold.

Parameters
[in,out]F#F by 3 list of triangles.
[in,out]E#F*3 by 2 list of all of directed edges
[in,out]uE#uE by 2 list of unique undirected edges
[in,out]EMAP#F*3 list of indices into uE, mapping each directed edge to unique undirected edge
[in,out]uE2E#uE list of lists of indices into E of coexisting edges
[in]ueindex into uE the edge to be flipped.

◆ flipped_triangles() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedX >
void igl::flipped_triangles ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedX > &  X 
)

Finds the ids of the flipped triangles of the mesh V,F in the UV mapping uv.

Parameters
[in]V#V by 2 list of mesh vertex positions
[in]F#F by 3 list of mesh faces (must be triangles)
[out]X#flipped list of containing the indices into F of the flipped triangles

◆ flipped_triangles() [2/2]

template<typename Scalar , typename Index >
Eigen::VectorXi igl::flipped_triangles ( const Eigen::MatrixBase< Scalar > &  V,
const Eigen::MatrixBase< Index > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ flood_fill()

template<typename Derivedres , typename DerivedS >
void igl::flood_fill ( const Eigen::MatrixBase< Derivedres > &  res,
Eigen::PlainObjectBase< DerivedS > &  S 
)

Given a 3D array with sparse non-nan (number?) data fill in the NaNs via flood fill.

This should ensure that, e.g., if data near 0 always has a band (surface) of numbered and signed data, then components of nans will be correctly signed.

Parameters
[in]res3-long list of dimensions of grid
[in,out]Sres(0)*res(1)*res(2) list of scalar values (with (many) nans), flood fill data in place

◆ floor()

template<typename DerivedX , typename DerivedY >
void igl::floor ( const Eigen::PlainObjectBase< DerivedX > &  X,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

Floor a given matrix to nearest integers.

Parameters
[in]Xm by n matrix of scalars
[out]Ym by n matrix of floored integers

◆ for_each() [1/2]

template<typename AType , typename Func >
void igl::for_each ( const Eigen::SparseMatrix< AType > &  A,
const Func &  func 
)
inline

FOR_EACH Call a given function for each non-zero (i.e., explicit value might actually be ==0) in a Sparse Matrix A in order (of storage).

This is useless unless func has side-effects.

Parameters
[in]Am by n matrix
[in]funcfunction handle with prototype "compatible with" void (Index i, Index j, Scalar & v). Return values will be ignored.
See also
std::for_each

◆ for_each() [2/2]

template<typename DerivedA , typename Func >
void igl::for_each ( const Eigen::DenseBase< DerivedA > &  A,
const Func &  func 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ forward_kinematics() [1/4]

void igl::forward_kinematics ( const Eigen::MatrixXd &  C,
const Eigen::MatrixXi &  BE,
const Eigen::VectorXi &  P,
const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &  dQ,
const std::vector< Eigen::Vector3d > &  dT,
std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &  vQ,
std::vector< Eigen::Vector3d > &  vT 
)

Given a skeleton and a set of relative bone rotations compute absolute rigid transformations for each bone.

Parameters
[in]C#C by dim list of joint positions
[in]BE#BE by 2 list of bone edge indices
[in]P#BE list of parent indices into BE
[in]dQ#BE list of relative rotations
[in]dT#BE list of relative translations
[out]vQ#BE list of absolute rotations
[out]vT#BE list of absolute translations

◆ forward_kinematics() [2/4]

void igl::forward_kinematics ( const Eigen::MatrixXd &  C,
const Eigen::MatrixXi &  BE,
const Eigen::VectorXi &  P,
const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &  dQ,
std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &  vQ,
std::vector< Eigen::Vector3d > &  vT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

assuming each dT[i] == {0,0,0}

◆ forward_kinematics() [3/4]

void igl::forward_kinematics ( const Eigen::MatrixXd &  C,
const Eigen::MatrixXi &  BE,
const Eigen::VectorXi &  P,
const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &  dQ,
const std::vector< Eigen::Vector3d > &  dT,
Eigen::MatrixXd &  T 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]T#BE*(dim+1) by dim stack of transposed transformation matrices

◆ forward_kinematics() [4/4]

void igl::forward_kinematics ( const Eigen::MatrixXd &  C,
const Eigen::MatrixXi &  BE,
const Eigen::VectorXi &  P,
const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > &  dQ,
Eigen::MatrixXd &  T 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ frame_field_deformer()

void igl::frame_field_deformer ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const Eigen::MatrixXd &  FF1,
const Eigen::MatrixXd &  FF2,
Eigen::MatrixXd &  V_d,
Eigen::MatrixXd &  FF1_d,
Eigen::MatrixXd &  FF2_d,
const int  iterations = 50,
const double  lambda = 0.1,
const bool  perturb_initial_guess = true 
)

Deform a mesh to transform the given per-face frame field to be as close as possible to a cross field, in the least square sense.

Parameters
[in]V#V by 3 coordinates of the vertices
[in]F#F by 3 list of mesh faces (must be triangles)
[in]FF1#F by 3 first representative vector of the frame field
[in]FF2#F by 3 second representative vector of the frame field
[out]V_d#V? by 3 deformed, first representative vector??
[out]FF1_d#F by 3 deformed, first representative vector??
[out]FF2_d#F by 3 deformed, first representative vector??
[in]iterationsnumber of iterations
[in]lambdalaplacian regularization parameter 0=no regularization 1=full regularization
[in]perturb_initial_guesswhether to perturb the initial guess

◆ frame_to_cross_field()

void igl::frame_to_cross_field ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const Eigen::MatrixXd &  FF1,
const Eigen::MatrixXd &  FF2,
Eigen::MatrixXd &  X 
)

Convert a frame field into its closest cross field.

Parameters
[in]V#V by 3 coordinates of the vertices
[in]F#F by 3 list of mesh faces (must be triangles)
[in]FF1#F by 3 the first representative vector of the frame field (up to permutation and sign)
[in]FF2#F by 3 the second representative vector of the frame field (up to permutation and sign)
[out]X#F by 3 representative vector of the closest cross field

◆ frustum()

template<typename DerivedP >
void igl::frustum ( const typename DerivedP::Scalar  left,
const typename DerivedP::Scalar  right,
const typename DerivedP::Scalar  bottom,
const typename DerivedP::Scalar  top,
const typename DerivedP::Scalar  nearVal,
const typename DerivedP::Scalar  farVal,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Implementation of the deprecated glFrustum function.

Parameters
[in]leftcoordinate of left vertical clipping plane
[in]rightcoordinate of right vertical clipping plane
[in]bottomcoordinate of bottom vertical clipping plane
[in]topcoordinate of top vertical clipping plane
[in]nearValdistance to near plane
[in]farValdistance to far plane
[out]P4x4 perspective matrix

◆ gaussian_curvature()

template<typename DerivedV , typename DerivedF , typename DerivedK >
void igl::gaussian_curvature ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedK > &  K 
)

Compute the 2π minus the sum of interior angles at each vertex.

For interior vertices of a manifold mesh this corresponds to the local integral gaussian curvature ("angle deficit", without averaging by local area). For boundary vertices, this quantity is not so meaninful. FWIW, adding π to the output for boundary vertices would produce local integral geodesic curvature along the boundary curve.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 3 eigen Matrix of face (triangle) indices
[out]K#V by 1 eigen Matrix of discrete gaussian curvature values

◆ generate_default_urbg()

DEFAULT_URBG igl::generate_default_urbg ( )
inline

◆ get_seconds()

double igl::get_seconds ( )

Current time in seconds.

Returns
the current time in seconds since epoch

Example:

const auto & tictoc = []()
{
static double t_start = igl::get_seconds();
double diff = igl::get_seconds()-t_start;
t_start += diff;
return diff;
};
tictoc();
... // part 1
cout<<"part 1: "<<tictoc()<<endl;
... // part 2
cout<<"part 2: "<<tictoc()<<endl;
... // etc
double get_seconds()
Current time in seconds.

◆ grad()

template<typename DerivedV , typename DerivedF >
void igl::grad ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< typename DerivedV::Scalar > &  G,
bool  uniform = false 
)

Gradient operator on a triangle mesh.

Gradient of a scalar function defined on piecewise linear elements (mesh) is constant on each triangle [tetrahedron] 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

Parameters
[in]V#vertices by 3 list of mesh vertex positions
[in]F#faces by 3 list of mesh face indices [or a #faces by 4 list of tetrahedral indices]
[out]G#faces*dim by #V Gradient operator
[in]uniformboolean (default false) - Use a uniform mesh instead of the vertices V

◆ grad_intrinsic()

template<typename Derivedl , typename DerivedF , typename Gtype >
void igl::grad_intrinsic ( const Eigen::MatrixBase< Derivedl > &  l,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< Gtype > &  G 
)

Construct an intrinsic gradient operator.

Parameters
[in]l#F by 3 list of edge lengths
[in]F#F by 3 list of triangle indices into some vertex list V
[out]G#F*2 by #V gradient matrix: G=[Gx;Gy] where x runs along the 23 edge and y runs in the counter-clockwise 90° rotation.

◆ grid()

template<typename Derivedres , typename DerivedGV >
void igl::grid ( const Eigen::MatrixBase< Derivedres > &  res,
Eigen::PlainObjectBase< DerivedGV > &  GV 
)

Construct vertices of a regular grid, suitable for input to igl::marching_cubes

Parameters
[in]res#res list of number of vertices along each dimension filling a unit #res-cube
[out]GVres.array().prod() by #res list of mesh vertex positions.
See also
triangulated_grid, quad_grid

◆ grid_search()

template<typename Scalar , typename DerivedX , typename DerivedLB , typename DerivedUB , typename DerivedI >
Scalar igl::grid_search ( const std::function< Scalar(DerivedX &) >  f,
const Eigen::MatrixBase< DerivedLB > &  LB,
const Eigen::MatrixBase< DerivedUB > &  UB,
const Eigen::MatrixBase< DerivedI > &  I,
DerivedX &  X 
)

Global optimization via grid search.

Solve the problem:

minimize f(x) subject to lb ≤ x ≤ ub

by exhaustive grid search.

Parameters
[in]ffunction to minimize
[in]LB#X vector of finite lower bounds
[in]UB#X vector of finite upper bounds
[in]I#X vector of number of steps for each variable
[out]X#X optimal parameter vector
Returns
f(X)

◆ group_sum_matrix() [1/2]

template<typename T >
void igl::group_sum_matrix ( const Eigen::Matrix< int, Eigen::Dynamic, 1 > &  G,
const int  k,
Eigen::SparseMatrix< T > &  A 
)

Builds a matrix A such that A*V computes the sum of vertices in each group specified by G.

Template Parameters
Tshould be a eigen sparse matrix primitive type like int or double
Parameters
[in]G#V list of group indices (0 to k-1) for each vertex, such that vertex i is assigned to group G(i)
[in]k#groups, good choice is max(G)+1
[out]A#groups by #V sparse matrix such that A*V = group_sums

◆ group_sum_matrix() [2/2]

template<typename T >
void igl::group_sum_matrix ( const Eigen::Matrix< int, Eigen::Dynamic, 1 > &  G,
Eigen::SparseMatrix< T > &  A 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ guess_extension() [1/2]

void igl::guess_extension ( FILE *  fp,
std::string &  guess 
)

Given a file pointer at the beginning of a "mesh" file, try to guess the extension of the file format it comes from.

The file pointer is rewound on return.

Parameters
[in,out]fpfile pointer, rewound after
[out]guessextension as string. One of "mesh",{"obj"},"off","ply","stl", or "wrl"

◆ guess_extension() [2/2]

std::string igl::guess_extension ( FILE *  fp)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ harmonic() [1/5]

template<typename DerivedV , typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedW >
bool igl::harmonic ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< Derivedb > &  b,
const Eigen::MatrixBase< Derivedbc > &  bc,
const int  k,
Eigen::PlainObjectBase< DerivedW > &  W 
)

Compute k-harmonic weight functions "coordinates".

Parameters
[in]V#V by dim vertex positions
[in]F#F by simplex-size list of element indices
[in]b#b boundary indices into V
[in]bc#b by #W list of boundary values
[in]kpower of harmonic operation (1: harmonic, 2: biharmonic, etc)
[out]W#V by #W list of weights

◆ harmonic() [2/5]

template<typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedW >
bool igl::harmonic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< Derivedb > &  b,
const Eigen::MatrixBase< Derivedbc > &  bc,
const int  k,
Eigen::PlainObjectBase< DerivedW > &  W 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Compute harmonic map using uniform laplacian operator

◆ harmonic() [3/5]

template<typename DerivedL , typename DerivedM , typename Derivedb , typename Derivedbc , typename DerivedW >
bool igl::harmonic ( const Eigen::SparseCompressedBase< DerivedL > &  L,
const Eigen::SparseCompressedBase< DerivedM > &  M,
const Eigen::MatrixBase< Derivedb > &  b,
const Eigen::MatrixBase< Derivedbc > &  bc,
const int  k,
Eigen::PlainObjectBase< DerivedW > &  W 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Compute a harmonic map using a given Laplacian and mass matrix.

Parameters
[in]L#V by #V discrete (integrated) Laplacian
[in]M#V by #V mass matrix

◆ harmonic() [4/5]

template<typename DerivedL , typename DerivedM , typename DerivedQ >
void igl::harmonic ( const Eigen::SparseCompressedBase< DerivedL > &  L,
const Eigen::SparseCompressedBase< DerivedM > &  M,
const int  k,
DerivedQ &  Q 
)

Build the discrete k-harmonic operator (computing integrated quantities).

That is, if the k-harmonic PDE is Q x = 0, then this minimizes x' Q x

Parameters
[in]L#V by #V discrete (integrated) Laplacian
[in]M#V by #V mass matrix
[in]kpower of harmonic operation (1: harmonic, 2: biharmonic, etc)
[out]Q#V by #V discrete (integrated) k-Laplacian

◆ harmonic() [5/5]

template<typename DerivedV , typename DerivedF , typename DerivedQ >
void igl::harmonic ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const int  k,
DerivedQ &  Q 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]V#V by dim vertex positions
[in]F#F by simplex-size list of element indices

◆ harwell_boeing()

template<typename Scalar , typename Index >
void igl::harwell_boeing ( const Eigen::SparseMatrix< Scalar > &  A,
int &  num_rows,
std::vector< Scalar > &  V,
std::vector< Index > &  R,
std::vector< Index > &  C 
)

Convert the matrix to Compressed sparse column (CSC or CCS) format, also known as Harwell Boeing format.

As described: http://netlib.org/linalg/html_templates/node92.html or http://en.wikipedia.org/wiki/Sparse_matrix #Compressed_sparse_column_.28CSC_or_CCS.29

Template Parameters
Scalartype of sparse matrix like double
Parameters
[in]Asparse m by n matrix
[out]num_rowsnumber of rows
[out]Vnon-zero values, row indices running fastest, size(V) = nnz
[out]Rrow indices corresponding to vals, size(R) = nnz
[out]Cindex in vals of first entry in each column, size(C) = num_cols+1
Note
All indices and pointers are 0-based

◆ hausdorff() [1/2]

template<typename DerivedVA , typename DerivedFA , typename DerivedVB , typename DerivedFB , typename Scalar >
void igl::hausdorff ( const Eigen::MatrixBase< DerivedVA > &  VA,
const Eigen::MatrixBase< DerivedFA > &  FA,
const Eigen::MatrixBase< DerivedVB > &  VB,
const Eigen::MatrixBase< DerivedFB > &  FB,
Scalar &  d 
)

Compute the Hausdorff distance between mesh (VA,FA) and mesh (VB,FB).

This is the

d(A,B) = max ( max min d(a,b) , max min d(b,a) ) a∈A b∈B b∈B a∈A

Parameters
[in]VA#VA by 3 list of vertex positions
[in]FA#FA by 3 list of face indices into VA
[in]VB#VB by 3 list of vertex positions
[in]FB#FB by 3 list of face indices into VB
[out]dhausdorff distance

◆ hausdorff() [2/2]

template<typename DerivedV , typename Scalar >
void igl::hausdorff ( const Eigen::MatrixBase< DerivedV > &  V,
const std::function< Scalar(const Scalar &, const Scalar &, const Scalar &)> &  dist_to_B,
Scalar &  l,
Scalar &  u 
)

Compute lower and upper bounds (l,u) on the Hausdorff distance between a triangle (V) and a pointset (e.g., mesh, triangle soup) given by a distance function handle (dist_to_B).

Parameters
[in]V#V by 3 list of corner positions so that V.row(i) is the position of the ith corner
[in]dist_to_Bfunction taking the x,y,z coordinate of a query position and outputting the closest-point distance to some point-set B
[out]llower bound on Hausdorff distance
[out]uupper bound on Hausdorff distance

◆ heat_geodesics_precompute() [1/2]

template<typename DerivedV , typename DerivedF , typename Scalar >
bool igl::heat_geodesics_precompute ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
HeatGeodesicsData< Scalar > &  data 
)

Precompute factorized solvers for computing a fast approximation of geodesic distances on a mesh (V,F).

[Crane et al. 2013]

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3 list of mesh face indices into V
[out]dataprecomputation data (see heat_geodesics_solve)

include/igl/heat_geodesics.h

◆ heat_geodesics_precompute() [2/2]

template<typename DerivedV , typename DerivedF , typename Scalar >
bool igl::heat_geodesics_precompute ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Scalar  t,
HeatGeodesicsData< Scalar > &  data 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]t"heat" parameter (smaller --> more accurate, less stable)

include/igl/heat_geodesics.h

◆ heat_geodesics_solve()

template<typename Scalar , typename Derivedgamma , typename DerivedD >
void igl::heat_geodesics_solve ( const HeatGeodesicsData< Scalar > &  data,
const Eigen::MatrixBase< Derivedgamma > &  gamma,
Eigen::PlainObjectBase< DerivedD > &  D 
)

Compute fast approximate geodesic distances using precomputed data from a set of selected source vertices (gamma).

Parameters
[in]dataprecomputation data (see heat_geodesics_precompute)
[in]gamma#gamma list of indices into V of source vertices
[out]D#V list of distances to gamma

include/igl/heat_geodesics.h

◆ hessian()

template<typename DerivedV , typename DerivedF , typename Scalar >
void igl::hessian ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< Scalar > &  H 
)

Constructs the finite element Hessian matrix as described in https://arxiv.org/abs/1707.04348, Natural Boundary Conditions for Smoothing in Geometry Processing (Oded Stein, Eitan Grinspun, Max Wardetzky, Alec Jacobson) The interior vertices are NOT set to zero yet.

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3 list of mesh faces (must be triangles)
[out]Hdim²⋅::V by #V Hessian matrix, each column i corresponding to V(i,:)
See also
curved_hessian_energy, hessian_energy

◆ hessian_energy()

template<typename DerivedV , typename DerivedF , typename Scalar >
void igl::hessian_energy ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< Scalar > &  Q 
)

Constructs the Hessian energy matrix using mixed FEM as described in https://arxiv.org/abs/1707.04348 Natural Boundary Conditions for Smoothing in Geometry Processing (Oded Stein, Eitan Grinspun, Max Wardetzky, Alec Jacobson)

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3 list of mesh faces (must be triangles)
[out]Q#V by #V Hessian energy matrix, each row/column i corresponding to V(i,:)
See also
hessian, curved_hessian_energy

◆ histc() [1/3]

template<typename DerivedX , typename DerivedE , typename DerivedN , typename DerivedB >
void igl::histc ( const Eigen::MatrixBase< DerivedX > &  X,
const Eigen::MatrixBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedB > &  B 
)

Count occurrences of values in X between consecutive entries in E.

Like matlab's histc. O(n+m*log(n))

Parameters
[in]Xm-long Vector of values
[in]En-long Monotonically increasing vector of edges
[out]Nn-long vector where N(k) reveals how many values in X fall between E(k) <= X < E(k+1)
[out]Bm-long vector of bin ids so that B(j) = k if E(k) <= X(j) < E(k+1). B(j) = -1 if X(j) is outside of E.

◆ histc() [2/3]

template<typename DerivedX , typename DerivedE , typename DerivedB >
void igl::histc ( const Eigen::MatrixBase< DerivedX > &  X,
const Eigen::MatrixBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedB > &  B 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Truly O(m*log(n))

◆ histc() [3/3]

template<typename DerivedE >
void igl::histc ( const typename DerivedE::Scalar &  x,
const Eigen::MatrixBase< DerivedE > &  E,
typename DerivedE::Index &  b 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Scalar search wrapper

◆ hsv_to_rgb() [1/3]

template<typename T >
void igl::hsv_to_rgb ( const T *  hsv,
T *  rgb 
)

Convert RGB to HSV.

Parameters
[in]hsvwith
  • h hue value (degrees: [0,360]. Values outside this range will be mapped periodically to [0,360].)
  • s saturation value ([0,1])
  • v value value ([0,1])
[out]rgbwith:
  • r red value ([0,1])
  • g green value ([0,1])
  • b blue value ([0,1])

◆ hsv_to_rgb() [2/3]

template<typename T >
void igl::hsv_to_rgb ( const T &  h,
const T &  s,
const T &  v,
T &  r,
T &  g,
T &  b 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ hsv_to_rgb() [3/3]

template<typename DerivedH , typename DerivedR >
void igl::hsv_to_rgb ( const Eigen::PlainObjectBase< DerivedH > &  H,
Eigen::PlainObjectBase< DerivedR > &  R 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]H#H by 3 list of hsv values
[out]R#H by 3 list of rgb values

◆ icosahedron()

template<typename DerivedV , typename DerivedF >
void igl::icosahedron ( Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

◆ in_element() [1/2]

template<typename DerivedV , typename DerivedQ , int DIM>
void igl::in_element ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixXi &  Ele,
const Eigen::MatrixBase< DerivedQ > &  Q,
const AABB< DerivedV, DIM > &  aabb,
Eigen::VectorXi &  I 
)

Determine whether each point in a list of points is in the elements of a mesh.

Template Parameters
DIMdimension of vertices in V (# of columns)
Parameters
[in]V#V by dim list of mesh vertex positions.
[in]Ele#Ele by dim+1 list of mesh indices into #V.
[in]Q#Q by dim list of query point positions
[in]aabbaxis-aligned bounding box tree object (see AABB.h)
[out]I#Q list of indices into Ele of first containing element (-1 means no containing element)

◆ in_element() [2/2]

template<typename DerivedV , typename DerivedQ , int DIM, typename Scalar >
void igl::in_element ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixXi &  Ele,
const Eigen::MatrixBase< DerivedQ > &  Q,
const AABB< DerivedV, DIM > &  aabb,
Eigen::SparseMatrix< Scalar > &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]I#Q by #Ele sparse matrix revealing whether each element contains each point: I(q,e) means point q is in element e

◆ increment_ulp()

template<typename Derived >
void igl::increment_ulp ( Eigen::MatrixBase< Derived > &  inout,
int  it 
)

Increment Unit in Last Place of a matrix.

Parameters
[in,out]inoutinput matrix
[in]itnumber of increments

◆ infinite_cost_stopping_condition() [1/2]

void igl::infinite_cost_stopping_condition ( const decimate_cost_and_placement_callback cost_and_placement,
decimate_stopping_condition_callback stopping_condition 
)

Stopping condition function compatible with igl::decimate.

The output function handle will return true if cost of next edge is infinite.

Parameters
[in]cost_and_placementhandle being used by igl::collapse_edge
[out]stopping_condition

◆ infinite_cost_stopping_condition() [2/2]

decimate_stopping_condition_callback igl::infinite_cost_stopping_condition ( const decimate_cost_and_placement_callback cost_and_placement)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ inradius()

template<typename DerivedV , typename DerivedF , typename DerivedR >
void igl::inradius ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedR > &  R 
)

Compute the inradius of each triangle in a mesh (V,F)

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3 list of triangle indices into V
[out]R#F list of inradii

◆ internal_angles()

template<typename DerivedV , typename DerivedF , typename DerivedK >
void igl::internal_angles ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedK > &  K 
)

Compute internal angles for a triangle mesh.

Parameters
[in]V#V by dim eigen Matrix of mesh vertex nD positions
[in]F#F by poly-size eigen Matrix of face (triangle) indices
[out]K#F by poly-size eigen Matrix of internal angles for triangles, columns correspond to edges [1,2],[2,0],[0,1]
Note
if poly-size ≠ 3 then dim must equal 3.

◆ internal_angles_intrinsic()

template<typename DerivedL , typename DerivedK >
void igl::internal_angles_intrinsic ( const Eigen::MatrixBase< DerivedL > &  L_sq,
Eigen::PlainObjectBase< DerivedK > &  K 
)

Compute internal angles for a triangle mesh.

Parameters
[in]L_sq#F by 3 list of squared edge lengths
[out]K#F by poly-size eigen Matrix of internal angles for triangles, columns correspond to edges [1,2],[2,0],[0,1]

◆ intersect() [1/2]

template<class M >
void igl::intersect ( const M &  A,
const M &  B,
M &  C 
)

Determine the intersect between two sets of coefficients using ==.

Template Parameters
Mmatrix type that implements indexing by global index M(i)
Parameters
[in]Amatrix of coefficients
[in]Bmatrix of coefficients
[out]Cmatrix of elements appearing in both A and B, C is always resized to have a single column

◆ intersect() [2/2]

template<class M >
M igl::intersect ( const M &  A,
const M &  B 
)

overload

◆ intrinsic_delaunay_cotmatrix() [1/2]

template<typename DerivedV , typename DerivedF , typename Scalar , typename Derivedl_intrinsic , typename DerivedF_intrinsic >
void igl::intrinsic_delaunay_cotmatrix ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< Scalar > &  L,
Eigen::PlainObjectBase< Derivedl_intrinsic > &  l_intrinsic,
Eigen::PlainObjectBase< DerivedF_intrinsic > &  F_intrinsic 
)

Computes the discrete cotangent Laplacian of a mesh after converting it into its intrinsic Delaunay triangulation (see, e.g., [Fisher et al.

2007].

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3 list of mesh elements (triangles or tetrahedra)
[out]L#V by #V cotangent matrix, each row i corresponding to V(i,:)
[out]l_intrinsic#F by 3 list of intrinsic edge-lengths used to compute L
[out]F_intrinsic#F by 3 list of intrinsic face indices used to compute L
See also
intrinsic_delaunay_triangulation, cotmatrix, cotmatrix_intrinsic

◆ intrinsic_delaunay_cotmatrix() [2/2]

template<typename DerivedV , typename DerivedF , typename Scalar >
void igl::intrinsic_delaunay_cotmatrix ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< Scalar > &  L 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ intrinsic_delaunay_triangulation() [1/2]

template<typename Derivedl_in , typename DerivedF_in , typename Derivedl , typename DerivedF >
void igl::intrinsic_delaunay_triangulation ( const Eigen::MatrixBase< Derivedl_in > &  l_in,
const Eigen::MatrixBase< DerivedF_in > &  F_in,
Eigen::PlainObjectBase< Derivedl > &  l,
Eigen::PlainObjectBase< DerivedF > &  F 
)

INTRINSIC_DELAUNAY_TRIANGULATION Flip edges intrinsically until all are "intrinsic Delaunay".

See "An algorithm for the construction of intrinsic delaunay triangulations with applications to digital geometry processing" [Fisher et al. 2007].

Parameters
[in]l_in#F_in by 3 list of edge lengths (see edge_lengths)
[in]F_in#F_in by 3 list of face indices into some unspecified vertex list V
[out]l#F by 3 list of edge lengths
[out]F#F by 3 list of new face indices. Note: Combinatorially F may contain non-manifold edges, duplicate faces and self-loops (e.g., an edge [1,1] or a face [1,1,1]). However, the intrinsic geometry is still well-defined and correct. See [Fisher et al. 2007] Figure 3 and 2nd to last paragraph of 1st page. Since F may be "non-eddge-manifold" in the usual combinatorial sense, it may be useful to call the more verbose overload below if disentangling edges will be necessary later on. Calling unique_edge_map on this F will give a different result than those outputs.
See also
is_intrinsic_delaunay

◆ intrinsic_delaunay_triangulation() [2/2]

template<typename Derivedl_in , typename DerivedF_in , typename Derivedl , typename DerivedF , typename DerivedE , typename DeriveduE , typename DerivedEMAP , typename uE2EType >
void igl::intrinsic_delaunay_triangulation ( const Eigen::MatrixBase< Derivedl_in > &  l_in,
const Eigen::MatrixBase< DerivedF_in > &  F_in,
Eigen::PlainObjectBase< Derivedl > &  l,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DeriveduE > &  uE,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP,
std::vector< std::vector< uE2EType > > &  uE2E 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]E#F*3 by 2 list of all directed edges, such that E.row(f+#F*c) is the
[out]edgeopposite F(f,c)
[out]uE#uE by 2 list of unique undirected edges
[out]EMAP#F*3 list of indices into uE, mapping each directed edge to unique
[out]undirectededge
[out]uE2E#uE list of lists of indices into E of coexisting edges
See also
unique_edge_map

◆ invert_diag()

template<typename DerivedX , typename MatY >
void igl::invert_diag ( const Eigen::SparseCompressedBase< DerivedX > &  X,
MatY &  Y 
)

Invert the diagonal entries of a matrix (if the matrix is a diagonal matrix then this amounts to inverting the matrix)

Template Parameters
Tshould be a eigen sparse matrix primitive type like int or double
Parameters
[in]Xan m by n sparse matrix
[out]Yan m by n sparse matrix

◆ is_border_vertex()

template<typename DerivedF >
std::vector< bool > igl::is_border_vertex ( const Eigen::MatrixBase< DerivedF > &  F)

Determine vertices on open boundary of a (manifold) mesh with triangle faces F.

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by 3 list of triangle indices
Returns
#V vector of bools revealing whether vertices are on boundary
Note
assumes mesh is edge manifold

◆ is_boundary_edge() [1/2]

template<typename DerivedF , typename DerivedE , typename DerivedB >
void igl::is_boundary_edge ( const Eigen::PlainObjectBase< DerivedE > &  E,
const Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedB > &  B 
)

Determine for each edge E if it is a "boundary edge" in F.

Boundary edges are undirected edges which occur only once.

Parameters
[in]E#E by 2 list of edges
[in]F#F by 3 list of triangles
[out]B#E list bools. true iff unoriented edge occurs exactly once in F (non-manifold and non-existant edges will be false)

◆ is_boundary_edge() [2/2]

template<typename DerivedF , typename DerivedE , typename DerivedB , typename DerivedEMAP >
void igl::is_boundary_edge ( const Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]E#E by 2 list of edges
[out]EMAP#F*3 list of indices mapping allE to E

◆ is_delaunay() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedD >
void igl::is_delaunay ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedD > &  D 
)

IDetermine if each edge in the mesh (V,F) is Delaunay.

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by 3 list of triangles indices
[out]D#F by 3 list of bools revealing whether edges corresponding 23 31 12 are locally Delaunay. Boundary edges are by definition Delaunay. Non-Manifold edges are by definition not Delaunay.

◆ is_delaunay() [2/2]

template<typename DerivedV , typename DerivedF , typename uE2EType , typename InCircle , typename ueiType >
bool igl::is_delaunay ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const std::vector< std::vector< uE2EType > > &  uE2E,
const InCircle  incircle,
const ueiType  uei 
)

Determine whether a single edge is Delaunay using a provided (extrinsic) incirle test.

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by 3 list of triangles indices
[in]uE2E#uE list of lists of indices into E of coexisting edges (see unique_edge_map)
[in]incircleA functor such that incircle(pa, pb, pc, pd) returns 1 if pd is on the positive size of circumcirle of (pa,pb,pc) -1 if pd is on the positive size of circumcirle of (pa,pb,pc) 0 if pd is cocircular with pa, pb, pc. (see delaunay_triangulation)
[in]ueiindex into uE2E of edge to check
Returns
true iff edge is Delaunay

◆ is_dir()

bool igl::is_dir ( const char *  filename)

Tells whether the given filename is a directory.

Act like php's is_dir function http://php.net/manual/en/function.is-dir.php

Parameters
[in]filenamePath to the file. If filename is a relative filename, it will be checked relative to the current working directory.
Returns
TRUE if the filename exists and is a directory, FALSE otherwise.

◆ is_edge_manifold() [1/3]

template<typename DerivedF >
bool igl::is_edge_manifold ( const Eigen::MatrixBase< DerivedF > &  F)

Check if the mesh is edge-manifold (every edge is incident one one face (boundary) or two oppositely oriented faces).

Parameters
[in]F#F by 3 list of triangle indices
Returns
true iff all edges are manifold
See also
is_vertex_manifold

◆ is_edge_manifold() [2/3]

template<typename DerivedF , typename DerivedBF , typename DerivedE , typename DerivedEMAP , typename DerivedBE >
bool igl::is_edge_manifold ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedBF > &  BF,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP,
Eigen::PlainObjectBase< DerivedBE > &  BE 
)

Checks if mesh is edge-manifold and outputs per-edge info.

Parameters
[in]F#F by 3 list of triangle indices
[out]BF#F by 3 list of flags revealing if edge opposite corresponding vertex
[out]isnon-manifold.
[out]E#E by 2 list of unique edges
[out]EMAP3*#F list of indices of opposite edges in "E"
[out]BE#E list of flages whether edge is non-manifold

◆ is_edge_manifold() [3/3]

template<typename DerivedF , typename DerivedEMAP , typename DerivedBF , typename DerivedBE >
bool igl::is_edge_manifold ( const Eigen::MatrixBase< DerivedF > &  F,
const typename DerivedF::Index  ne,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
Eigen::PlainObjectBase< DerivedBF > &  BF,
Eigen::PlainObjectBase< DerivedBE > &  BE 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ is_file()

bool igl::is_file ( const char *  filename)

Tells whether the given filename is a regular file.

Act like php's is_file function http://php.net/manual/en/function.is-file.php

Parameters
[in]filenamePath to the file. If filename is a relative filename, it will be checked relative to the current working directory.
Returns
TRUE if the filename exists and is a regular file, FALSE otherwise.

◆ is_intrinsic_delaunay() [1/3]

template<typename Derivedl , typename DerivedF , typename DerivedD >
void igl::is_intrinsic_delaunay ( const Eigen::MatrixBase< Derivedl > &  l,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedD > &  D 
)

Determine if each edge in the mesh (V,F) is Delaunay.

Parameters
[in]l#l by dim list of edge lengths
[in]F#F by 3 list of triangles indices
[out]D#F by 3 list of bools revealing whether edges corresponding 23 31 12 are locally Delaunay. Boundary edges are by definition Delaunay. Non-Manifold edges are by definition not Delaunay.

◆ is_intrinsic_delaunay() [2/3]

template<typename Derivedl , typename DerivedF , typename uE2EType , typename DerivedD >
void igl::is_intrinsic_delaunay ( const Eigen::MatrixBase< Derivedl > &  l,
const Eigen::MatrixBase< DerivedF > &  F,
const std::vector< std::vector< uE2EType > > &  uE2E,
Eigen::PlainObjectBase< DerivedD > &  D 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]uE2E#uE list of lists mapping unique edges to (half-)edges

◆ is_intrinsic_delaunay() [3/3]

template<typename Derivedl , typename uE2EType , typename Index >
bool igl::is_intrinsic_delaunay ( const Eigen::MatrixBase< Derivedl > &  l,
const std::vector< std::vector< uE2EType > > &  uE2E,
const Index  num_faces,
const Index  uei 
)

Determine whether a single edge is Delaunay using a provided (extrinsic) incirle test.

Parameters
[in]l#l by dim list of edge lengths
[in]uE2E#uE list of lists of indices into E of coexisting edges (see unique_edge_map)
[in]num_facesnumber of faces (==#F)
[in]ueiindex into uE2E of edge to check
Returns
true iff edge is Delaunay

◆ is_irregular_vertex()

template<typename DerivedF >
std::vector< bool > igl::is_irregular_vertex ( const Eigen::MatrixBase< DerivedF > &  F)

Determine if a vertex is irregular, i.e.

it has more than 6 (triangles) or 4 (quads) incident edges. Vertices on the boundary are ignored.

Parameters
[in]F#F by 3[4] list of triangle[quads] indices
Returns
#V vector of bools revealing whether vertices are singular

◆ is_planar()

bool igl::is_planar ( const Eigen::MatrixXd &  V)

Determine if a set of points lies on the XY plane.

Parameters
[in]V#V by dim list of vertex positions
Returns
true if a mesh has constant value of 0 in z coordinate

◆ is_readable()

bool igl::is_readable ( const char *  filename)

Check if a file is reabable like PHP's is_readable function: http://www.php.net/manual/en/function.is-readable.php.

Parameters
[in]filenamepath to file
Returns
true if file exists and is readable and false if file doesn't exist or is not readable
Note
Windows version will not check user or group ids

◆ is_sparse() [1/2]

template<typename T >
bool igl::is_sparse ( const Eigen::SparseMatrix< T > &  A)

Determine if a matrix A is sparse.

Template Parameters
T,DerivedAdefines scalar type
Parameters
[in]Amatrix in question
Returns
true if A is represented with a sparse matrix

◆ is_sparse() [2/2]

template<typename DerivedA >
bool igl::is_sparse ( const Eigen::PlainObjectBase< DerivedA > &  A)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ is_stl() [1/2]

bool igl::is_stl ( FILE *  stl_file,
bool &  is_ascii 
)

Given a file pointer, determine if it contains an .stl file and then rewind it.

Parameters
[in]stl_filepointer to file
[in]is_asciiflag whether stl is ascii
Returns
whether stl_file is an .stl file

◆ is_stl() [2/2]

bool igl::is_stl ( FILE *  stl_file)

◆ is_symmetric() [1/3]

template<typename AT >
bool igl::is_symmetric ( const Eigen::SparseMatrix< AT > &  A)

Returns true if the given matrix is symmetric.

Parameters
[in]Am by m matrix
Returns
true if the matrix is square and symmetric

◆ is_symmetric() [2/3]

template<typename AT , typename epsilonT >
bool igl::is_symmetric ( const Eigen::SparseMatrix< AT > &  A,
const epsilonT  epsilon 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]epsilonthreshold on L1 difference between A and A'

◆ is_symmetric() [3/3]

template<typename DerivedA >
bool igl::is_symmetric ( const Eigen::PlainObjectBase< DerivedA > &  A)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ is_vertex_manifold() [1/2]

template<typename DerivedF , typename DerivedB >
bool igl::is_vertex_manifold ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedB > &  B 
)

Check if a mesh is vertex-manifold.

This only checks whether the faces incident on each vertex form exactly one connected component. Vertices incident on non-manifold edges are not consider non-manifold by this function (see is_edge_manifold.h). Unreferenced verties are considered non-manifold (zero components).

Parameters
[in]F#F by 3 list of triangle indices
[out]B#V list indicate whether each vertex is locally manifold.
Returns
whether mesh is vertex manifold.
See also
is_edge_manifold

◆ is_vertex_manifold() [2/2]

template<typename DerivedF >
bool igl::is_vertex_manifold ( const Eigen::MatrixBase< DerivedF > &  F)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ is_writable()

bool igl::is_writable ( const char *  filename)

Check if a file exists and is writable like PHP's is_writable function: http://www.php.net/manual/en/function.is-writable.php.

Parameters
[in]filenamepath to file
Returns
true if file exists and is writable and false if file doesn't exist or is not writable
Note
Windows version will not test group and user id

◆ isdiag()

template<typename Derived >
bool igl::isdiag ( const Eigen::SparseCompressedBase< Derived > &  A)

Determine if a given matrix is diagonal: all non-zeros lie on the main diagonal.

Parameters
[in]Am by n sparse matrix
Returns
true iff and only if the matrix is diagonal.

◆ ismember()

template<typename DerivedA , typename DerivedB , typename DerivedIA , typename DerivedLOCB >
void igl::ismember ( const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedIA > &  IA,
Eigen::PlainObjectBase< DerivedLOCB > &  LOCB 
)

Determine if elements of A exist in elements of B.

Parameters
[in]Ama by na matrix
[in]Bmb by nb matrix
[out]IAma by na matrix of flags whether corresponding element of A exists in B
[out]LOCBma by na matrix of indices in B locating matching element (-1 if not found), indices assume column major ordering

◆ ismember_rows()

template<typename DerivedA , typename DerivedB , typename DerivedIA , typename DerivedLOCB >
void igl::ismember_rows ( const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedIA > &  IA,
Eigen::PlainObjectBase< DerivedLOCB > &  LOCB 
)

Determine if row of A exist in rows of B.

Parameters
[in]Ama by na matrix
[in]Bmb by nb matrix
[out]IAma by 1 lest of flags whether corresponding element of A exists in B
[out]LOCBma by 1 list matrix of indices in B locating matching element (-1 if not found), indices assume column major ordering

◆ isolines()

template<typename DerivedV , typename DerivedF , typename DerivedS , typename Derivedvals , typename DerivediV , typename DerivediE , typename DerivedI >
void igl::isolines ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedS > &  S,
const Eigen::MatrixBase< Derivedvals > &  vals,
Eigen::PlainObjectBase< DerivediV > &  iV,
Eigen::PlainObjectBase< DerivediE > &  iE,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Compute isolines of a scalar field on a triangle mesh.

Isolines may cross perfectly at vertices. The output should not contain degenerate segments (so long as the input does not contain degenerate faces). The output segments are oriented so that isolines curl counter-clockwise around local maxima (i.e., for 2D scalar fields). Unless an isoline hits a boundary, it should be a closed loop. Isolines may run perfectly along boundaries. Isolines should appear just "above" constants regions.

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3 list of mesh triangle indices into V
[in]S#S by 1 list of per-vertex scalar values
[in]vals#vals by 1 list of values to compute isolines for
[out]iV#iV by dim list of isoline vertex positions
[out]iE#iE by 2 list of edge indices into iV
[out]I#iE by 1 list of indices into vals indicating which value each segment belongs to
See also
isolines_intrinsic, edge_crossings

◆ isolines_intrinsic() [1/2]

template<typename DerivedF , typename DerivedS , typename Derivedvals , typename DerivediB , typename DerivediFI , typename DerivediE , typename DerivedI >
void igl::isolines_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedS > &  S,
const Eigen::MatrixBase< Derivedvals > &  vals,
Eigen::PlainObjectBase< DerivediB > &  iB,
Eigen::PlainObjectBase< DerivediFI > &  iFI,
Eigen::PlainObjectBase< DerivediE > &  iE,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Compute isolines of a scalar field on a triangle mesh intrinsically.

See isolines.h for details.

Parameters
[in]F#F by 3 list of mesh triangle indices into some V
[in]S#S by 1 list of per-vertex scalar values
[in]vals#vals by 1 list of values to compute isolines for
[out]iB#iB by 3 list of barycentric coordinates so that iV.row(i) = iB(i,0)*V.row(F(iFI(i,0)) + iB(i,1)*V.row(F(iFI(i,1)) + iB(i,2)*V.row(F(iFI(i,2))
[out]iF#iB list of triangle indices for each row of iB (all points will either lie on an edge or vertex: an arbitrary incident face will be given).
[out]iE#iE by 2 list of edge indices into iB
[out]I#iE by 1 list of indices into vals indicating which value each segment belongs to
See also
isolines, edge_crossings

◆ isolines_intrinsic() [2/2]

template<typename DerivedF , typename DerivedS , typename DeriveduE , typename DerivedEMAP , typename DeriveduEC , typename DeriveduEE , typename DerivediB , typename DerivediFI , typename DerivediE >
void igl::isolines_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedS > &  S,
const Eigen::MatrixBase< DeriveduE > &  uE,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
const Eigen::MatrixBase< DeriveduEC > &  uEC,
const Eigen::MatrixBase< DeriveduEE > &  uEE,
const typename DerivedS::Scalar  val,
Eigen::PlainObjectBase< DerivediB > &  iB,
Eigen::PlainObjectBase< DerivediFI > &  iFI,
Eigen::PlainObjectBase< DerivediE > &  iE 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]valscalar value to compute isoline at
[in]uE#uE by 2 list of unique undirected edges
[in]EMAP#F*3 list of indices into uE, mapping each directed edge to unique undirected edge so that uE(EMAP(f+#F*c)) is the unique edge corresponding to E.row(f+#F*c)
[in]uEC#uE+1 list of cumulative counts of directed edges sharing each unique edge so the uEC(i+1)-uEC(i) is the number of directed edges sharing the ith unique edge.
[in]uEE#E list of indices into E, so that the consecutive segment of indices uEE.segment(uEC(i),uEC(i+1)-uEC(i)) lists all directed edges sharing the ith unique edge.
See also
unique_edge_map

◆ isolines_map() [1/2]

template<typename DerivedCM , typename Derivediso_color , typename DerivedICM >
void igl::isolines_map ( const Eigen::MatrixBase< DerivedCM > &  CM,
const Eigen::MatrixBase< Derivediso_color > &  iso_color,
const int  interval_thickness,
const int  iso_thickness,
Eigen::PlainObjectBase< DerivedICM > &  ICM 
)

Inject a given colormap with evenly spaced isolines.

Parameters
[in]CM#CM by 3 list of colors
[in]ico_color1 by 3 isoline color
[in]interval_thicknessnumber of times to repeat intervals (original colors)
[in]iso_thicknessnumber of times to repeat isoline color (in between intervals)
[out]ICM#CM*interval_thickness + (#CM-1)*iso_thickness by 3 list of outputs colors

◆ isolines_map() [2/2]

template<typename DerivedCM , typename DerivedICM >
void igl::isolines_map ( const Eigen::MatrixBase< DerivedCM > &  CM,
Eigen::PlainObjectBase< DerivedICM > &  ICM 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ iterative_closest_point() [1/2]

template<typename DerivedVX , typename DerivedFX , typename DerivedVY , typename DerivedFY , typename DerivedR , typename Derivedt >
void igl::iterative_closest_point ( const Eigen::MatrixBase< DerivedVX > &  VX,
const Eigen::MatrixBase< DerivedFX > &  FX,
const Eigen::MatrixBase< DerivedVY > &  VY,
const Eigen::MatrixBase< DerivedFY > &  FY,
const int  num_samples,
const int  max_iters,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< Derivedt > &  t 
)

Solve for the rigid transformation that places mesh X onto mesh Y using the iterative closest point method.

In particular, optimize:

min ∫_X inf ‖x*R+t - y‖² dx R∈SO(3) y∈Y t∈R³

Typically optimization strategies include using Gauss Newton ("point-to-plane" linearization) and stochastic descent (sparse random sampling each iteration).

Parameters
[in]VX#VX by 3 list of mesh X vertices
[in]FX#FX by 3 list of mesh X triangle indices into rows of VX
[in]VY#VY by 3 list of mesh Y vertices
[in]FY#FY by 3 list of mesh Y triangle indices into rows of VY
[in]num_samplesnumber of random samples to use (larger --> more accurate, but also more suceptible to sticking to local minimum)
[out]R3x3 rotation matrix so that (VX*R+t,FX) ~~ (VY,FY)
[out]t1x3 translation row vector

◆ iterative_closest_point() [2/2]

template<typename DerivedVX , typename DerivedFX , typename DerivedVY , typename DerivedFY , typename DerivedNY , typename DerivedR , typename Derivedt >
void igl::iterative_closest_point ( const Eigen::MatrixBase< DerivedVX > &  VX,
const Eigen::MatrixBase< DerivedFX > &  FX,
const Eigen::MatrixBase< DerivedVY > &  VY,
const Eigen::MatrixBase< DerivedFY > &  FY,
const igl::AABB< DerivedVY, 3 > &  Ytree,
const Eigen::MatrixBase< DerivedNY > &  NY,
const int  num_samples,
const int  max_iters,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< Derivedt > &  t 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]Ytreeprecomputed AABB tree for accelerating closest point queries
[in]NY#FY by 3 list of precomputed unit face normals

◆ jet() [1/4]

template<typename T >
void igl::jet ( const T  f,
T *  rgb 
)

Jet colormap like MATLAB's jet.

Note
that we actually use the Turbo colormap instead, since jet is a bad colormap: https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html

Wrapper for directly computing [r,g,b] values for a given factor f between 0 and 1

Parameters
[in]ffactor determining color value as if 0 was min and 1 was max
[out]rgbresulting rgb color
  • r red value
  • g green value
  • b blue value

◆ jet() [2/4]

template<typename T >
void igl::jet ( const T  f,
T &  r,
T &  g,
T &  b 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ jet() [3/4]

template<typename DerivedZ , typename DerivedC >
void igl::jet ( const Eigen::MatrixBase< DerivedZ > &  Z,
const bool  normalize,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]Z#Z list of factors
[in]normalizewhether to normalize Z to be tightly between [0,1]
[out]C#C by 3 list of rgb colors

◆ jet() [4/4]

template<typename DerivedZ , typename DerivedC >
void igl::jet ( const Eigen::MatrixBase< DerivedZ > &  Z,
const double  min_Z,
const double  max_Z,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]min_zvalue at blue
[in]max_zvalue at red

◆ kelvinlets()

template<typename DerivedV , typename Derivedx0 , typename Derivedf , typename DerivedF , typename DerivedU >
void igl::kelvinlets ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< Derivedx0 > &  x0,
const Eigen::MatrixBase< Derivedf > &  f,
const Eigen::MatrixBase< DerivedF > &  F,
const KelvinletParams< typename DerivedV::Scalar > &  params,
Eigen::PlainObjectBase< DerivedU > &  U 
)

Implements Pixar's Regularized Kelvinlets (Pixar Technical Memo #17-03): Sculpting Brushes based on Fundamental Solutions of Elasticity, a technique for real-time physically based volume sculpting of virtual elastic materials.

Parameters
[in]V#V by dim list of input points in space
[in]x0dim-vector of brush tip
[in]fdim-vector of brush force (translation)
[in]Fdim by dim matrix of brush force matrix (linear)
[in]paramsparameters for the kelvinlet brush like brush radius, scale etc
[out]X#V by dim list of output points in space

◆ kkt_inverse()

template<typename T >
void igl::kkt_inverse ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  A,
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  Aeq,
const bool  use_lu_decomposition,
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  S 
)

Constructs the inverse of the KKT matrix of a convex, linear equality constrained quadratic minimization problem.

Systems of the form:

 / A   Aeqᵀ \  / x \ = / b   \
 \ Aeq    0 /  \ λ /   \ beq /
\_____.______/\__.__/ \___.___/
      M          z        c

Arise, for example, when solve convex, linear equality constrained quadratic minimization problems:

min ½ xᵀ A x - xᵀb  subject to Aeq x = beq

This function constructs a matrix S such that x = S c solves the system above. That is:

S = [In 0] M⁻¹

so that 

x = S c
Template Parameters
Tshould be a eigen matrix primitive type like float or double
Parameters
[in]An by n matrix of quadratic coefficients
[in]Bn by 1 column of linear coefficients
[in]Aeqm by n list of linear equality constraint coefficients
[in]Beqm by 1 list of linear equality constraint constant values
[in]use_lu_decompositionuse lu rather than SVD
[out]Sn by (n + m) "solve" matrix, such that S*[B', Beq'] is a solution
Returns
true on success, false on error

◆ knn() [1/2]

template<typename DerivedP , typename IndexType , typename DerivedCH , typename DerivedCN , typename DerivedW , typename DerivedI >
void igl::knn ( const Eigen::MatrixBase< DerivedP > &  P,
size_t  k,
const std::vector< std::vector< IndexType > > &  point_indices,
const Eigen::MatrixBase< DerivedCH > &  CH,
const Eigen::MatrixBase< DerivedCN > &  CN,
const Eigen::MatrixBase< DerivedW > &  W,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Given a 3D set of points P, an whole number k, and an octree find the indicies of the k nearest neighbors for each point in P.

Note that each point is its own neighbor.

The octree data structures used in this function are intended to be the same ones output from igl::octree

Parameters
[in]P#P by 3 list of point locations
[in]knumber of neighbors to find
[in]point_indicesa vector of vectors, where the ith entry is a vector of the indices into P that are the ith octree cell's points
[in]CH#OctreeCells by 8, where the ith row is the indices of the ith octree cell's children
[in]CN#OctreeCells by 3, where the ith row is a 3d row vector representing the position of the ith cell's center
[in]W#OctreeCells, a vector where the ith entry is the width of the ith octree cell
[out]I#P by k list of k-nearest-neighbor indices into P

◆ knn() [2/2]

template<typename DerivedP , typename DerivedV , typename IndexType , typename DerivedCH , typename DerivedCN , typename DerivedW , typename DerivedI >
void igl::knn ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedV > &  V,
size_t  k,
const std::vector< std::vector< IndexType > > &  point_indices,
const Eigen::MatrixBase< DerivedCH > &  CH,
const Eigen::MatrixBase< DerivedCN > &  CN,
const Eigen::MatrixBase< DerivedW > &  W,
Eigen::PlainObjectBase< DerivedI > &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

only neighbors found in V

Parameters
[in]V#V by 3 list of point locations for which may be neighbors
[out]I#P by k list of k-nearest-neighbor indices into V

◆ launch_medit()

template<typename DerivedV , typename DerivedT , typename DerivedF >
int igl::launch_medit ( const Eigen::PlainObjectBase< DerivedV > &  V,
const Eigen::PlainObjectBase< DerivedT > &  T,
const Eigen::PlainObjectBase< DerivedF > &  F,
const bool  wait 
)

Writes the tetmesh in (V,T,F) to a temporary file, opens it with medit (forking with a system call) and returns.

Template Parameters
DerivedVreal-value: i.e. from MatrixXd
DerivedTinteger-value: i.e. from MatrixXi
DerivedFinteger-value: i.e. from MatrixXi
Parameters
[in]Vdouble matrix of vertex positions #V by 3
[in]T#T list of tet indices into vertex positions
[in]F#F list of face indices into vertex positions
[in]waitwhether to wait for medit process to finish before returning
Returns
returned value of system call (probably not useful if wait=false because of the fork)

◆ lbs_matrix()

void igl::lbs_matrix ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXd &  W,
Eigen::MatrixXd &  M 
)

Linear blend skinning can be expressed by V' = M * T where V' is a #V by dim matrix of deformed vertex positions (one vertex per row), M is a #V by (dim+1)*#T (composed of weights and rest positions) and T is a #T*(dim+1) by dim matrix of #T stacked transposed transformation matrices.

See equations (1) and (2) in "Fast Automatic Skinning Transformations" [Jacobson et al 2012]

Parameters
[in]V#V by dim list of rest positions
[in]W#V+ by #T list of weights
[out]M#V by #T*(dim+1)

In MATLAB:

 kron(ones(1,size(W,2)),[V ones(size(V,1),1)]).*kron(W,ones(1,size(V,2)+1)) 

◆ lbs_matrix_column() [1/4]

void igl::lbs_matrix_column ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXd &  W,
Eigen::SparseMatrix< double > &  M 
)

Construct a matrix that when multiplied against a column of affine transformation entries computes new coordinates of the vertices.

Note
I'm not sure it makes since that the result is stored as a sparse matrix. The number of non-zeros per row is dependent on the number of mesh vertices and handles.
Parameters
[in]V#V by dim list of vertex rest positions
[in]W#V by #handles list of correspondence weights
[out]M#V * dim by #handles * dim * (dim+1) matrix such that new_V(:) = LBS(V,W,A) = reshape(M * A,size(V)), where A is a column vectors formed by the entries in each handle's dim by dim+1 transformation matrix. Specifcally, A = reshape(permute(Astack,[3 1 2]),n*dim*(dim+1),1) or A = [Lxx;Lyx;Lxy;Lyy;tx;ty], and likewise for other dim if Astack(:,:,i) is the dim by (dim+1) transformation at handle i

include/igl/lbs_matrix.h

◆ lbs_matrix_column() [2/4]

void igl::lbs_matrix_column ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXd &  W,
Eigen::MatrixXd &  M 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ lbs_matrix_column() [3/4]

void igl::lbs_matrix_column ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXd &  W,
const Eigen::MatrixXi &  WI,
Eigen::SparseMatrix< double > &  M 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

W as a full matrix of weights (each vertex has #handles weights), a constant number of weights are given for each vertex.

Parameters
[in]W#V by k list of k correspondence weights per vertex
[in]WI#V by k list of k correspondence weight indices per vertex. Such that W(j,WI(i)) gives the ith most significant correspondence weight on vertex j

◆ lbs_matrix_column() [4/4]

void igl::lbs_matrix_column ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXd &  W,
const Eigen::MatrixXi &  WI,
Eigen::MatrixXd &  M 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ lexicographic_triangulation()

template<typename DerivedP , typename Orient2D , typename DerivedF >
void igl::lexicographic_triangulation ( const Eigen::MatrixBase< DerivedP > &  P,
Orient2D  orient2D,
Eigen::PlainObjectBase< DerivedF > &  F 
)

Given a set of points in 2D, return a lexicographic triangulation of these points.

Parameters
[in]P#P by 2 list of vertex positions
[in]orient2DA functor such that orient2D(pa, pb, pc) returns 1 if pa,pb,pc forms a conterclockwise triangle. -1 if pa,pb,pc forms a clockwise triangle. 0 if pa,pb,pc are collinear. where the argument pa,pb,pc are of type Scalar[2].
[out]F#F by 3 of faces in lexicographic triangulation.

◆ limit_faces()

template<typename MatF , typename VecL >
void igl::limit_faces ( const MatF &  F,
const VecL &  L,
const bool  exclusive,
MatF &  LF 
)

Limit given faces F to those which contain (only) indices found in L.

Template Parameters
MatFmatrix type of faces, matrixXi
VecLmatrix type of vertex indices, VectorXi
Parameters
[in]F#F by 3 list of face indices
[in]L#L by 1 list of allowed indices
[in]exclusiveflag specifying whether a face is included only if all its indices are in L, default is false
[out]LF#LF by 3 list of remaining faces after limiting

◆ line_field_mismatch()

template<typename DerivedV , typename DerivedF , typename DerivedO >
void igl::line_field_mismatch ( const Eigen::PlainObjectBase< DerivedV > &  V,
const Eigen::PlainObjectBase< DerivedF > &  F,
const Eigen::PlainObjectBase< DerivedV > &  PD1,
const bool  isCombed,
Eigen::PlainObjectBase< DerivedO > &  mismatch 
)

Calculates the mismatch (integer), at each face edge, of a cross field defined on the mesh faces.

The integer mismatch is a multiple of pi/2 that transforms the cross on one side of the edge to the cross on the other side. It represents the deviation from a Lie connection across the edge.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 3 eigen Matrix of face (quad) indices
[in]PD1#F by 3 eigen Matrix of the first per face cross field vector
[in]PD2#F by 3 eigen Matrix of the second per face cross field vector
[in]isCombedboolean, specifying whether the field is combed (i.e. matching has been precomputed. If not, the field is combed first.
[out]mismatch#F by 3 eigen Matrix containing the integer mismatch of the cross field across all face edges

◆ line_search()

double igl::line_search ( Eigen::MatrixXd &  x,
const Eigen::MatrixXd &  d,
double  i_step_size,
std::function< double(Eigen::MatrixXd &)>  energy,
double  cur_energy = -1 
)

Implement a bisection linesearch to minimize a mesh-based energy on vertices given at 'x' at a search direction 'd', with initial step size.

Stops when a point with lower energy is found, or after maximal iterations have been reached.

Parameters
[in]x#X by dim list of variables
[in]d#X by dim list of a given search direction
[in]i_step_sizeinitial step size
[in]energyA function to compute the mesh-based energy (return an energy that is bigger than 0)
[out]x#X by dim list of variables at the new location
[in]cur_energy(OPTIONAL)The energy at the given point. Helps save redundant computations. This is optional. If not specified, the function will compute it.
Returns
the energy at the new point 'x'

◆ line_segment_in_rectangle()

bool igl::line_segment_in_rectangle ( const Eigen::Vector2d &  s,
const Eigen::Vector2d &  d,
const Eigen::Vector2d &  A,
const Eigen::Vector2d &  B 
)

Determine whether a line segment overlaps with a rectangle.

Parameters
[in]ssource point of line segment
[in]ddest point of line segment
[in]Afirst corner of rectangle
[in]Bopposite corner of rectangle
Returns
true if line segment is at all inside rectangle

◆ linprog() [1/2]

bool igl::linprog ( const Eigen::VectorXd &  c,
const Eigen::MatrixXd &  A,
const Eigen::VectorXd &  b,
const int  k,
Eigen::VectorXd &  x 
)

Solve a linear program given in "standard form".

 min  c'x
 s.t. A(    1:k,:) x <= b(1:k)
      A(k+1:end,:) x = b(k+1:end)
   ** x >= 0 **

In contrast to other APIs the entries in b may be negative.

Parameters
[in]c#x list of linear coefficients
[in]A#A by #x matrix of linear constraint coefficients
[in]b#A list of linear constraint right-hand sides
[in]knumber of inequality constraints as first rows of A,b
[out]x#x solution vector
Returns
false on failure or detected infeasibility, returns true on termination
Note
It appears that this implementation does not detect all infeasibile problems (e.g., https://github.com/libigl/libigl/issues/2051). Therefor, it's worth double-checking that the output actually satisfies the constraints even if the return value is true.

◆ linprog() [2/2]

bool igl::linprog ( const Eigen::VectorXd &  f,
const Eigen::MatrixXd &  A,
const Eigen::VectorXd &  b,
const Eigen::MatrixXd &  B,
const Eigen::VectorXd &  c,
Eigen::VectorXd &  x 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Wrapper in friendlier general form (no implicit bounds on x)

min  f'x
s.t. A x <= b
     B x = c
Parameters
[in]f#x list of linear coefficients
[in]A#A by #x matrix of linear inequality constraint coefficients
[in]b#A list of linear constraint right-hand sides
[in]B#B by #x matrix of linear equality constraint coefficients
[in]c#B list of linear constraint right-hand sides
[out]x#x solution vector
Returns
false on failure or detected infeasibility, returns true on termination

◆ LinSpaced()

template<typename Derived >
Derived igl::LinSpaced ( typename Derived::Index  size,
const typename Derived::Scalar &  low,
const typename Derived::Scalar &  high 
)
inline

Replacement for Eigen::DenseBase::LinSpaced.

Parameters
[in]sizenumber of elements
[in]lowfirst element
[in]highlast element
Returns
vector of size elements linearly spaced between low and

include/igl/LinSpaced.h

◆ list_to_matrix() [1/4]

template<typename T , typename Derived >
bool igl::list_to_matrix ( const std::vector< std::vector< T > > &  V,
Eigen::PlainObjectBase< Derived > &  M 
)

Convert a list (std::vector) of row vectors of the same length to a matrix.

Template Parameters
Ttype that can be safely cast to type in Mat via '='
MatMatrix type, must implement: .resize(m,n) .row(i) = Row
Parameters
[in]Va m-long list of vectors of size n
[out]Man m by n matrix
Returns
true on success, false on errors

◆ list_to_matrix() [2/4]

template<typename T , size_t N, typename Derived >
bool igl::list_to_matrix ( const std::vector< std::array< T, N > > &  V,
Eigen::PlainObjectBase< Derived > &  M 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ list_to_matrix() [3/4]

template<typename T , typename Derived >
bool igl::list_to_matrix ( const std::vector< T > &  V,
Eigen::PlainObjectBase< Derived > &  M 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Vector version.

◆ list_to_matrix() [4/4]

template<typename T , typename Derived >
bool igl::list_to_matrix ( const std::vector< std::vector< T > > &  V,
const int  n,
const T &  padding,
Eigen::PlainObjectBase< Derived > &  M 
)

Convert a list of row vectors of n or less to a matrix and pad on the right with padding.

Parameters
[in]Va m-long list of vectors of size <=n
[in]nnumber of columns
[in]paddingvalue to fill in from right for short rows
[out]Man m by n matrix

◆ local_basis()

template<typename DerivedV , typename DerivedF >
void igl::local_basis ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedV > &  B1,
Eigen::PlainObjectBase< DerivedV > &  B2,
Eigen::PlainObjectBase< DerivedV > &  B3 
)

Compute a local orthogonal reference system for each triangle in the given mesh.

Template Parameters
DerivedVderived from vertex positions matrix type: i.e. MatrixXd
DerivedFderived from face indices matrix type: i.e. MatrixXi
Parameters
[in]Veigen matrix #V by 3
[in]F#F by 3 list of mesh faces (must be triangles)
[out]B1eigen matrix #F by 3, each vector is tangent to the triangle
[out]B2eigen matrix #F by 3, each vector is tangent to the triangle and perpendicular to B1
[out]B3eigen matrix #F by 3, normal of the triangle

◆ look_at()

template<typename Derivedeye , typename Derivedcenter , typename Derivedup , typename DerivedR >
void igl::look_at ( const Eigen::PlainObjectBase< Derivedeye > &  eye,
const Eigen::PlainObjectBase< Derivedcenter > &  center,
const Eigen::PlainObjectBase< Derivedup > &  up,
Eigen::PlainObjectBase< DerivedR > &  R 
)

Implementation of the deprecated gluLookAt function.

Parameters
[in]eye3-vector of eye position
[in]center3-vector of center reference point
[in]up3-vector of up vector
[out]R4x4 rotation matrix

◆ loop() [1/2]

template<typename DerivedF , typename SType , typename DerivedNF >
void igl::loop ( const int  n_verts,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< SType > &  S,
Eigen::PlainObjectBase< DerivedNF > &  NF 
)

Given the triangle mesh [V, F], where n_verts = V.rows(), computes newV and a sparse matrix S s.t.

[newV, newF] is the subdivided mesh where newV = S*V.

Parameters
[in]n_vertsan integer (number of mesh vertices)
[in]Fan m by 3 matrix of integers of triangle faces
[out]Sa sparse matrix (will become the subdivision matrix)
[out]newFa matrix containing the new faces

◆ loop() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedNV , typename DerivedNF >
void igl::loop ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedNV > &  NV,
Eigen::PlainObjectBase< DerivedNF > &  NF,
const int  number_of_subdivs = 1 
)

Given the triangle mesh [V, F], computes number_of_subdivs steps of loop subdivision and outputs the new mesh [newV, newF].

Parameters
[in]Van n by 3 matrix of vertices
[in]Fan m by 3 matrix of integers of triangle faces
[out]NVa matrix containing the new vertices
[out]NFa matrix containing the new faces
[in]number_of_subdivsan integer that specifies how many subdivision steps to do

◆ lscm() [1/3]

template<typename DerivedV , typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedV_uv , typename QScalar >
bool igl::lscm ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< Derivedb > &  b,
const Eigen::MatrixBase< Derivedbc > &  bc,
Eigen::PlainObjectBase< DerivedV_uv > &  V_uv,
Eigen::SparseMatrix< QScalar > &  Q 
)

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], see below). Input should be a manifold mesh (also no unreferenced vertices) and "boundary" (fixed vertices) b should contain at least two vertices per connected component.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh faces (must be triangles)
[in]b#b boundary indices into V
[in]bc#b by 2 list of boundary values
[out]UV#V by 2 list of 2D mesh vertex positions in UV space
[out]Q#Vx2 by #Vx2 symmetric positive semi-definite matrix for computing LSCM energy
Returns
true only on solver success.

◆ lscm() [2/3]

template<typename DerivedV , typename DerivedF , typename Derivedb , typename Derivedbc , typename DerivedV_uv >
bool igl::lscm ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< Derivedb > &  b,
const Eigen::MatrixBase< Derivedbc > &  bc,
Eigen::PlainObjectBase< DerivedV_uv > &  V_uv 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ lscm() [3/3]

template<typename DerivedV , typename DerivedF , typename DerivedV_uv >
bool igl::lscm ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedV_uv > &  V_uv 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Free boundary version. "Spectral Conformal Parameterization" using eigen decomposition; Assumes mesh is a single connected component topologically equivalent to a chunk of the plane.

◆ lscm_hessian()

template<typename DerivedV , typename DerivedF , typename QScalar >
void igl::lscm_hessian ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< QScalar > &  Q 
)

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.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh faces (must be triangles)
[in]b#b boundary indices into V
[in]bc#b by 2 list of boundary values
[out]UV#V by 2 list of 2D mesh vertex positions in UV space
[out]Q#Vx2 by #Vx2 symmetric positive semi-definite matrix for computing LSCM energy
Returns
true only on solver success.

◆ map_vertices_to_circle()

void igl::map_vertices_to_circle ( const Eigen::MatrixXd &  V,
const Eigen::VectorXi &  bnd,
Eigen::MatrixXd &  UV 
)

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.

Parameters
[in]V#V by dim list of mesh vertex positions
[in]b#W list of vertex ids
[out]UV#W by 2 list of 2D position on the unit circle for the vertices in b

◆ mapping_energy_with_jacobians()

double igl::mapping_energy_with_jacobians ( const Eigen::MatrixXd &  Ji,
const Eigen::VectorXd &  areas,
igl::MappingEnergyType  slim_energy,
double  exp_factor 
)

Compute the rotation-invariant energy of a mapping (represented in Jacobians and areas)

Parameters
[in]Ji#F by 4 (9 if 3D) entries of jacobians
[in]areas#F by 1 face areas
[in]slim_energyenergy type as in igl::MappingEnergyType
[in]exp_factorsee igl::MappingEnergyType
Returns
energy value
See also
MappingEnergyType

◆ march_cube()

template<typename DerivedGV , typename Scalar , typename Index , typename DerivedV , typename DerivedF >
void igl::march_cube ( const DerivedGV &  GV,
const Eigen::Matrix< Scalar, 8, 1 > &  cS,
const Eigen::Matrix< Index, 8, 1 > &  cI,
const Scalar &  isovalue,
Eigen::PlainObjectBase< DerivedV > &  V,
Index &  n,
Eigen::PlainObjectBase< DerivedF > &  F,
Index &  m,
std::unordered_map< int64_t, int > &  E2V 
)

Process a single cube of a marching cubes grid.

Parameters
[in]GV#GV by 3 list of grid vertex positions
[in]cSlist of 8 scalar field values at grid corners
[in]cIlist of 8 indices of corners into rows of GV
[in]isovaluelevel-set value being extracted (often 0)
[in,out]V#V by 3 current list of output mesh vertex positions
[in,out]ncurrent number of mesh vertices (i.e., occupied rows in V)
[in,out]F#F by 3 current list of output mesh triangle indices into rows of V
[in,out]mcurrent number of mesh triangles (i.e., occupied rows in F)
[in,out]E2Vcurrent edge (GV_i,GV_j) to vertex (V_k) map

Side-effects: V,n,F,m,E2V are updated to contain new vertices and faces of any constructed mesh elements

◆ marching_cubes() [1/2]

template<typename DerivedS , typename DerivedGV , typename DerivedV , typename DerivedF >
void igl::marching_cubes ( const Eigen::MatrixBase< DerivedS > &  S,
const Eigen::MatrixBase< DerivedGV > &  GV,
const unsigned  nx,
const unsigned  ny,
const unsigned  nz,
const typename DerivedS::Scalar  isovalue,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

Performs marching cubes reconstruction on a grid defined by values, and points, and generates a mesh defined by vertices and faces.

Parameters
[in]Snx*ny*nz list of values at each grid corner i.e. S(x + y*xres + z*xres*yres) for corner (x,y,z)
[in]GVnx*ny*nz by 3 array of corresponding grid corner vertex locations
[in]nxresolutions of the grid in x dimension
[in]nyresolutions of the grid in y dimension
[in]nzresolutions of the grid in z dimension
[in]isovaluethe isovalue of the surface to reconstruct
[out]V#V by 3 list of mesh vertex positions
[out]F#F by 3 list of mesh triangle indices into rows of V

◆ marching_cubes() [2/2]

template<typename DerivedS , typename DerivedGV , typename DerivedGI , typename DerivedV , typename DerivedF >
void igl::marching_cubes ( const Eigen::MatrixBase< DerivedS > &  S,
const Eigen::MatrixBase< DerivedGV > &  GV,
const Eigen::MatrixBase< DerivedGI > &  GI,
const typename DerivedS::Scalar  isovalue,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Sparse voxel version

Parameters
[in]S#S list of scalar field values
[in]GV#S by 3 list of referenced grid vertex positions
[in]GI#GI by 8 list of grid corner indices into rows of GV

◆ marching_tets() [1/5]

template<typename DerivedTV , typename DerivedTT , typename DerivedS , typename DerivedSV , typename DerivedSF , typename DerivedJ , typename BCType >
void igl::marching_tets ( const Eigen::MatrixBase< DerivedTV > &  TV,
const Eigen::MatrixBase< DerivedTT > &  TT,
const Eigen::MatrixBase< DerivedS > &  S,
const typename DerivedS::Scalar  isovalue,
Eigen::PlainObjectBase< DerivedSV > &  SV,
Eigen::PlainObjectBase< DerivedSF > &  SF,
Eigen::PlainObjectBase< DerivedJ > &  J,
Eigen::SparseMatrix< BCType > &  BC 
)

Performs the marching tetrahedra algorithm on a tet mesh defined by TV and TT with scalar values defined at each vertex in TV.

The output is a triangle mesh approximating the isosurface coresponding to the value isovalue.

Parameters
[in]TV#tet_vertices x 3 array – The vertices of the tetrahedral mesh
[in]TT#tets x 4 array – The indexes of each tet in the tetrahedral mesh
[in]S#tet_vertices x 1 array – The values defined on each tet vertex
[in]isovaluescalar – The isovalue of the level set we want to compute
[out]SV#SV x 3 array – The vertices of the output level surface mesh
[out]SF#SF x 3 array – The face indexes of the output level surface mesh
[out]J#SF list of indices into TT revealing which tet each face comes from
[out]BC#SV x #TV list of barycentric coordinates so that SV = BC*TV

◆ marching_tets() [2/5]

template<typename DerivedTV , typename DerivedTT , typename DerivedS , typename DerivedSV , typename DerivedSF , typename DerivedJ , typename BCType >
void igl::marching_tets ( const Eigen::MatrixBase< DerivedTV > &  TV,
const Eigen::MatrixBase< DerivedTT > &  TT,
const Eigen::MatrixBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedSV > &  SV,
Eigen::PlainObjectBase< DerivedSF > &  SF,
Eigen::PlainObjectBase< DerivedJ > &  J,
Eigen::SparseMatrix< BCType > &  BC 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

assumes isovalue = 0

◆ marching_tets() [3/5]

template<typename DerivedTV , typename DerivedTT , typename DerivedS , typename DerivedSV , typename DerivedSF , typename DerivedJ >
void igl::marching_tets ( const Eigen::MatrixBase< DerivedTV > &  TV,
const Eigen::MatrixBase< DerivedTT > &  TT,
const Eigen::MatrixBase< DerivedS > &  S,
const typename DerivedS::Scalar  isovalue,
Eigen::PlainObjectBase< DerivedSV > &  SV,
Eigen::PlainObjectBase< DerivedSF > &  SF,
Eigen::PlainObjectBase< DerivedJ > &  J 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ marching_tets() [4/5]

template<typename DerivedTV , typename DerivedTT , typename DerivedS , typename DerivedSV , typename DerivedSF , typename BCType >
void igl::marching_tets ( const Eigen::MatrixBase< DerivedTV > &  TV,
const Eigen::MatrixBase< DerivedTT > &  TT,
const Eigen::MatrixBase< DerivedS > &  S,
const typename DerivedS::Scalar  isovalue,
Eigen::PlainObjectBase< DerivedSV > &  SV,
Eigen::PlainObjectBase< DerivedSF > &  SF,
Eigen::SparseMatrix< BCType > &  BC 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ marching_tets() [5/5]

template<typename DerivedTV , typename DerivedTT , typename DerivedS , typename DerivedSV , typename DerivedSF >
void igl::marching_tets ( const Eigen::MatrixBase< DerivedTV > &  TV,
const Eigen::MatrixBase< DerivedTT > &  TT,
const Eigen::MatrixBase< DerivedS > &  S,
const typename DerivedS::Scalar  isovalue,
Eigen::PlainObjectBase< DerivedSV > &  SV,
Eigen::PlainObjectBase< DerivedSF > &  SF 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ massmatrix()

template<typename DerivedV , typename DerivedF , typename Scalar >
void igl::massmatrix ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const MassMatrixType  type,
Eigen::SparseMatrix< Scalar > &  M 
)

Constructs the mass (area) matrix for a given mesh (V,F).

Template Parameters
DerivedVderived type of eigen matrix for V (e.g. derived from MatrixXd)
DerivedFderived type of eigen matrix for F (e.g. derived from MatrixXi)
Scalarscalar type for eigen sparse matrix (e.g. double)
Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by simplex_size list of mesh elements (triangles or tetrahedra)
[in]typeone of the following ints: MASSMATRIX_TYPE_BARYCENTRIC barycentric {default for tetrahedra} MASSMATRIX_TYPE_VORONOI voronoi-hybrid {default for triangles, not implemented for tetrahedra} MASSMATRIX_TYPE_FULL full
[out]M#V by #V mass matrix
See also
cotmatrix

◆ massmatrix_intrinsic() [1/2]

template<typename Derivedl , typename DerivedF , typename Scalar >
void igl::massmatrix_intrinsic ( const Eigen::MatrixBase< Derivedl > &  l,
const Eigen::MatrixBase< DerivedF > &  F,
const MassMatrixType  type,
Eigen::SparseMatrix< Scalar > &  M 
)

Constructs the mass (area) matrix for a given mesh (V,F).

Parameters
[in]l#l by simplex_size list of mesh edge lengths
[in]F#F by simplex_size list of mesh elements (triangles or tetrahedra)
[in]typeone of the following ints: MASSMATRIX_TYPE_BARYCENTRIC barycentric MASSMATRIX_TYPE_VORONOI voronoi-hybrid {default} MASSMATRIX_TYPE_FULL full
[out]M#V by #V mass matrix
See also
massmatrix

◆ massmatrix_intrinsic() [2/2]

template<typename Derivedl , typename DerivedF , typename Scalar >
void igl::massmatrix_intrinsic ( const Eigen::MatrixBase< Derivedl > &  l,
const Eigen::MatrixBase< DerivedF > &  F,
const MassMatrixType  type,
const int  n,
Eigen::SparseMatrix< Scalar > &  M 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]nnumber of vertices (>= F.maxCoeff()+1)

◆ mat4_to_quat()

template<typename Q_type >
void igl::mat4_to_quat ( const Q_type *  m,
Q_type *  q 
)

Convert a OpenGL (rotation) matrix to a quaternion.

Parameters
[in]m16-element opengl rotation matrix
[out]q4-element quaternion (not normalized)

◆ mat3_to_quat()

template<typename Q_type >
void igl::mat3_to_quat ( const Q_type *  m,
Q_type *  q 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ MAYA_GREEN()

const Eigen::Vector4f igl::MAYA_GREEN ( 128./  255.,
242./  255.,
0./  255.,
1.   
)

◆ MAYA_YELLOW()

const Eigen::Vector4f igl::MAYA_YELLOW ( 255./  255.,
247./  255.,
50./  255.,
1.   
)

◆ MAYA_RED()

const Eigen::Vector4f igl::MAYA_RED ( 234./  255.,
63./  255.,
52./  255.,
1.   
)

◆ MAYA_BLUE()

const Eigen::Vector4f igl::MAYA_BLUE ( 0./  255.,
73./  255.,
252./  255.,
1.   
)

◆ MAYA_PURPLE()

const Eigen::Vector4f igl::MAYA_PURPLE ( 180./  255.,
73./  255.,
200./  255.,
1.   
)

◆ MAYA_VIOLET()

const Eigen::Vector4f igl::MAYA_VIOLET ( 31./  255.,
15./  255.,
66./  255.,
1.   
)

◆ MAYA_GREY()

const Eigen::Vector4f igl::MAYA_GREY ( 0.  5,
0.  5,
0.  5,
1.  0 
)

◆ MAYA_CYAN()

const Eigen::Vector4f igl::MAYA_CYAN ( 131./  255.,
219./  255.,
252./  255.,
1.   
)

◆ MAYA_SEA_GREEN()

const Eigen::Vector4f igl::MAYA_SEA_GREEN ( 70./  255.,
252./  255.,
167./  255.,
1.   
)

◆ matlab_format() [1/5]

template<typename DerivedM >
const Eigen::WithFormat< DerivedM > igl::matlab_format ( const Eigen::DenseBase< DerivedM > &  M,
const std::string  name = "" 
)

This is a routine to print a matrix using format suitable for pasting into the matlab IDE.

Template Parameters
DerivedMe.g. derived from MatrixXd
Parameters
[in]inputsome matrix to be formatted
[in]namename of matrix (optional)
Returns
Formatted matrix

Example:

// M := [1 2 3;4 5 6];
cout<<matlab_format(M)<<endl;
// Prints:
// [
// 1 2 3
// 4 5 6
// ];
cout<<matlab_format(M,"M")<<endl;
// Prints:
// M = [
// 1 2 3
// 4 5 6
// ];
Eigen::IOFormat matlab_format()
Just build and return the format.

◆ matlab_format_index()

template<typename DerivedM >
std::string igl::matlab_format_index ( const Eigen::MatrixBase< DerivedM > &  M,
const std::string  name = "" 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Add +1 to every entry before formatting.

◆ matlab_format() [2/5]

template<typename DerivedS >
const std::string igl::matlab_format ( const Eigen::SparseMatrix< DerivedS > &  S,
const std::string  name = "" 
)

Same but for sparse matrices.

Print IJV format into an auxiliary variable and then print a call to sparse which will construct the sparse matrix

Example:

// S := [0 2 3;4 5 0];
cout<<matlab_format(S,"S")<<endl;
// Prints:
// SIJV = [
// 2 1 4
// 1 2 2
// 2 2 5
// 1 3 3
// ];
// S = sparse(SIJV(:,1),SIJV(:,2),SIJV(:,3));

◆ matlab_format() [3/5]

const std::string igl::matlab_format ( const double  v,
const std::string  name = "" 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Scalars.

◆ matlab_format() [4/5]

const std::string igl::matlab_format ( const float  v,
const std::string  name = "" 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ matlab_format() [5/5]

Eigen::IOFormat igl::matlab_format ( )

Just build and return the format.

Returns
eigen IOFormat object

Example:

// M := [1 2 3;4 5 6];
cout<<M.format(matlab_format())<<endl;
// Prints:
// [
// 1 2 3
// 4 5 6
// ];

◆ matrix_to_list() [1/3]

template<typename DerivedM >
void igl::matrix_to_list ( const Eigen::MatrixBase< DerivedM > &  M,
std::vector< std::vector< typename DerivedM::Scalar > > &  V 
)

Convert a matrix to a list (std::vector) of row vectors of the same size.

Template Parameters
MatMatrix type, must implement: .resize(m,n) .row(i) = Row
Ttype that can be safely cast to type in Mat via '='
Parameters
[in]Man m by n matrix
[out]Va m-long list of vectors of size n
See also
list_to_matrix

◆ matrix_to_list() [2/3]

template<typename DerivedM >
void igl::matrix_to_list ( const Eigen::MatrixBase< DerivedM > &  M,
std::vector< typename DerivedM::Scalar > &  V 
)

Convert a matrix to a list (std::vector) of elements in column-major ordering.

Parameters
[in]Man m by n matrix
[out]Van m*n list of elements

◆ matrix_to_list() [3/3]

template<typename DerivedM >
std::vector< typename DerivedM::Scalar > igl::matrix_to_list ( const Eigen::MatrixBase< DerivedM > &  M)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ max() [1/2]

template<typename AType , typename DerivedB , typename DerivedI >
void igl::max ( const Eigen::SparseMatrix< AType > &  A,
const int  dim,
Eigen::PlainObjectBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Compute the maximum along dimension dim of a matrix X.

Parameters
[in]Xm by n matrix
[in]dimdimension along which to take max
[out]Yn-long vector (if dim == 1) Y m-long vector (if dim == 2)
[out]Ivector the same size as Y containing the indices along dim of minimum entries

◆ max() [2/2]

template<typename DerivedX , typename DerivedY , typename DerivedI >
void igl::max ( const Eigen::DenseBase< DerivedX > &  X,
const int  dim,
Eigen::PlainObjectBase< DerivedY > &  Y,
Eigen::PlainObjectBase< DerivedI > &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ max_faces_stopping_condition() [1/2]

void igl::max_faces_stopping_condition ( int &  m,
const int  orig_m,
const int  max_m,
decimate_stopping_condition_callback stopping_condition 
)

Stopping condition function compatible with igl::decimate.

The outpute function handle will return true if number of faces is less than max_m

Parameters
[in]mreference to working variable initially should be set to current number of faces.
[in]orig_mnumber (size) of original face list not including any faces added to handle phony boundary faces connecting to point at infinity. For closed meshes it's safe to set this to F.rows()
[in]max_mmaximum number of faces
[out]stopping_condition

See decimate.h for more details

◆ max_faces_stopping_condition() [2/2]

decimate_stopping_condition_callback igl::max_faces_stopping_condition ( int &  m,
const int  orign_m,
const int  max_m 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ max_size()

template<typename T >
int igl::max_size ( const std::vector< T > &  V)

Determine max size of lists in a vector.

Template Parameters
Tsome list type object that implements .size()
Parameters
[in]Vvector of list types T
Returns
max .size() found in V, returns -1 if V is empty

◆ median()

template<typename DerivedV , typename mType >
bool igl::median ( const Eigen::MatrixBase< DerivedV > &  V,
mType &  m 
)

Compute the median of an eigen vector.

Parameters
[in]V#V list of unsorted values
[out]mmedian of those values
Returns
true on success, false on failure

◆ min() [1/2]

template<typename AType , typename DerivedB , typename DerivedI >
void igl::min ( const Eigen::SparseMatrix< AType > &  A,
const int  dim,
Eigen::PlainObjectBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Compute the minimum along dimension dim of a matrix X.

Parameters
[in]Xm by n matrix
[in]dimdimension along which to take min
[out]Yn-long vector (if dim == 1) Y m-long vector (if dim == 2)
[out]Ivector the same size as Y containing the indices along dim of minimum entries

◆ min() [2/2]

template<typename DerivedX , typename DerivedY , typename DerivedI >
void igl::min ( const Eigen::DenseBase< DerivedX > &  X,
const int  dim,
Eigen::PlainObjectBase< DerivedY > &  Y,
Eigen::PlainObjectBase< DerivedI > &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ min_quad_with_fixed_precompute()

template<typename T , typename Derivedknown >
bool igl::min_quad_with_fixed_precompute ( const Eigen::SparseMatrix< T > &  A,
const Eigen::MatrixBase< Derivedknown > &  known,
const Eigen::SparseMatrix< T > &  Aeq,
const bool  pd,
min_quad_with_fixed_data< T > &  data 
)

Minimize a convex quadratic energy subject to fixed value and linear equality constraints.

Problems of the form

trace( 0.5*Z'*A*Z + Z'*B + constant )

subject to

Z(known,:) = Y, and Aeq*Z = Beq

Template Parameters
Tshould be a eigen matrix primitive type like int or double
Parameters
[in]An by n matrix of quadratic coefficients
[in]knownlist of indices to known rows in Z
[in]Ylist of fixed values corresponding to known rows in Z
[in]Aeqm by n list of linear equality constraint coefficients
[in]pdflag specifying whether A(unknown,unknown) is positive definite
[in,out]datafactorization struct with all necessary information to solve using min_quad_with_fixed_solve
Returns
true on success, false on error
Precondition
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 slow.

◆ min_quad_with_fixed_solve() [1/2]

template<typename T , typename DerivedB , typename DerivedY , typename DerivedBeq , typename DerivedZ , typename Derivedsol >
bool igl::min_quad_with_fixed_solve ( const min_quad_with_fixed_data< T > &  data,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< DerivedY > &  Y,
const Eigen::MatrixBase< DerivedBeq > &  Beq,
Eigen::PlainObjectBase< DerivedZ > &  Z,
Eigen::PlainObjectBase< Derivedsol > &  sol 
)

Solves a system previously factored using min_quad_with_fixed_precompute.

Template Parameters
Ttype of sparse matrix (e.g. double)
DerivedYtype of Y (e.g. derived from VectorXd or MatrixXd)
DerivedZtype of Z (e.g. derived from VectorXd or MatrixXd)
Parameters
[in]datafactorization struct with all necessary precomputation to solve
[in]Bn by k column of linear coefficients
[in]Yb by k list of constant fixed values
[in]Beqm by k list of linear equality constraint constant values
[out]Zn by k solution
[out]sol#unknowns+#lagrange by k solution to linear system Returns true on success, false on error

◆ min_quad_with_fixed_solve() [2/2]

template<typename T , typename DerivedB , typename DerivedY , typename DerivedBeq , typename DerivedZ >
bool igl::min_quad_with_fixed_solve ( const min_quad_with_fixed_data< T > &  data,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< DerivedY > &  Y,
const Eigen::MatrixBase< DerivedBeq > &  Beq,
Eigen::PlainObjectBase< DerivedZ > &  Z 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ min_quad_with_fixed() [1/4]

template<typename T , typename Derivedknown , typename DerivedB , typename DerivedY , typename DerivedBeq , typename DerivedZ >
bool igl::min_quad_with_fixed ( const Eigen::SparseMatrix< T > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< Derivedknown > &  known,
const Eigen::MatrixBase< DerivedY > &  Y,
const Eigen::SparseMatrix< T > &  Aeq,
const Eigen::MatrixBase< DerivedBeq > &  Beq,
const bool  pd,
Eigen::PlainObjectBase< DerivedZ > &  Z 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Minimize convex quadratic energy subject to fixed value and linear equality constraints. Without prefactorization.

◆ min_quad_with_fixed() [2/4]

template<typename Scalar , int n, int m, bool Hpd = true>
Eigen::Matrix< Scalar, n, 1 > igl::min_quad_with_fixed ( const Eigen::Matrix< Scalar, n, n > &  H,
const Eigen::Matrix< Scalar, n, 1 > &  f,
const Eigen::Array< bool, n, 1 > &  k,
const Eigen::Matrix< Scalar, n, 1 > &  bc,
const Eigen::Matrix< Scalar, m, n > &  A,
const Eigen::Matrix< Scalar, m, 1 > &  b 
)

Dense version optimized for very small, known at compile time sizes.

Still works for Eigen::Dynamic (and then everything needs to be Dynamic).

min_x ½ xᵀ H x + xᵀ f subject to A x = b x(i) = bc(i) iff k(i)==true

Template Parameters
Scalar(e.g., double)
n#H or Eigen::Dynamic if not known at compile time
m#A or Eigen::Dynamic if not known at compile time
Hpdwhether H is positive definite (LLT used) or not (QR used)
Parameters
[in]H#H by #H quadratic coefficients (only lower triangle used)
[in]f#H linear coefficients
[in]k#H list of flags whether to fix value
[in]bc#H value to fix to (if !k(i) then bc(i) is ignored)
[in]A#A by #H list of linear equality constraint coefficients, must be linearly independent (with self and fixed value constraints)
[in]b#A list of linear equality right-hand sides
Returns
#H-long solution x

◆ min_quad_with_fixed() [3/4]

template<typename Scalar , int n, bool Hpd = true>
Eigen::Matrix< Scalar, n, 1 > igl::min_quad_with_fixed ( const Eigen::Matrix< Scalar, n, n > &  H,
const Eigen::Matrix< Scalar, n, 1 > &  f,
const Eigen::Array< bool, n, 1 > &  k,
const Eigen::Matrix< Scalar, n, 1 > &  bc 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ min_quad_with_fixed() [4/4]

template<typename Scalar , int n, int kcount, bool Hpd>
Eigen::Matrix< Scalar, n, 1 > igl::min_quad_with_fixed ( const Eigen::Matrix< Scalar, n, n > &  H,
const Eigen::Matrix< Scalar, n, 1 > &  f,
const Eigen::Array< bool, n, 1 > &  k,
const Eigen::Matrix< Scalar, n, 1 > &  bc 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Special wrapper where the number of constrained values (i.e., true values in k) is exposed as a template parameter. Not intended to be called directly. The overhead of calling the overloads above is already minimal.

◆ min_size()

template<typename T >
int igl::min_size ( const std::vector< T > &  V)

Determine min size of lists in a vector.

Template Parameters
Tsome list type object that implements .size()
Parameters
[in]Vvector of list types T
Returns
min .size() found in V, returns -1 if V is empty

◆ mod() [1/2]

template<typename DerivedA , typename DerivedB >
void igl::mod ( const Eigen::PlainObjectBase< DerivedA > &  A,
const int  base,
Eigen::PlainObjectBase< DerivedB > &  B 
)

Compute elementwise mod: B = A % base.

Parameters
[in]Am by n matrix
[in]basenumber to mod against
[out]Bm by n matrix

◆ mod() [2/2]

template<typename DerivedA >
DerivedA igl::mod ( const Eigen::PlainObjectBase< DerivedA > &  A,
const int  base 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ mode()

template<typename T >
void igl::mode ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  X,
const int  d,
Eigen::Matrix< T, Eigen::Dynamic, 1 > &  M 
)

Takes mode of coefficients in a matrix along a given dimension.

Template Parameters
Tshould be a eigen matrix primitive type like int or double
Parameters
[in]Xm by n original matrix
[in]ddension along which to take mode, m or n
[out]Mvector containing mode along dension d, if d==1 then this will be a n-long vector if d==2 then this will be a m-long vector

◆ moments()

template<typename DerivedV , typename DerivedF , typename Derivedm0 , typename Derivedm1 , typename Derivedm2 >
void igl::moments ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Derivedm0 &  m0,
Eigen::PlainObjectBase< Derivedm1 > &  m1,
Eigen::PlainObjectBase< Derivedm2 > &  m2 
)

Computes the moments of mass for a solid object bound by a triangle mesh.

Parameters
[in]V#V by 3 list of rest domain positions
[in]F#F by 3 list of triangle indices into V
[out]m0zeroth moment of mass, total signed volume of solid.
[out]m1first moment of mass, center of mass (centroid) times total mass
[out]m2second moment of mass, moment of inertia with center of mass as reference point
See also
centroid

◆ mvc()

void igl::mvc ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXd &  C,
Eigen::MatrixXd &  W 
)

Mean value coordinates for a polygon.

Parameters
[in]V#V x dim list of vertex positions (dim = 2 or dim = 3)
[in]C#C x dim list of polygon vertex positions in counter-clockwise order (dim = 2 or dim = 3)
[out]Wweights, #V by #C matrix of weights

◆ nchoosek() [1/2]

double igl::nchoosek ( const int  n,
const int  k 
)

Binomial coefficient.

Like matlab's nchoosek.

Parameters
[in]ntotal number elements
[in]ksize of sub-set to consider
Returns
number of k-size combinations out of the set [1,...,n]

◆ nchoosek() [2/2]

template<typename DerivedV , typename DerivedU >
void igl::nchoosek ( const Eigen::MatrixBase< DerivedV > &  V,
const int  k,
Eigen::PlainObjectBase< DerivedU > &  U 
)

All combinations .

Like matlab's nchoosek.

Parameters
[in]Vn-long vector of elements
[in]ksize of sub-set to consider
[out]Unchoosek by k long matrix where each row is a unique k-size combination

◆ next_filename()

bool igl::next_filename ( const std::string &  prefix,
const int  zeros,
const std::string &  suffix,
std::string &  next 
)

Find the file with the first filename of the form "prefix%0[zeros]dsuffix".

Parameters
[in]prefixpath to containing dir and filename prefix
[in]zerosnumber of leading zeros as if digit printed with printf
[in]suffixsuffix of filename and extension (should include dot)
[out]nextpath to next file
Returns
true if found, false if exceeding range in zeros

◆ normal_derivative()

template<typename DerivedV , typename DerivedEle , typename Scalar >
void igl::normal_derivative ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedEle > &  Ele,
Eigen::SparseMatrix< Scalar > &  DD 
)

Computes the directional derivative normal to all (half-)edges of a triangle mesh (not just boundary edges).

These are integrated along the edge: they're the per-face constant gradient dot the rotated edge vector (unit rotated edge vector for direction then magnitude for integration).

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3|4 list of triangle|tetrahedron indices into V
[out]DD#F*3|4 by #V sparse matrix representing operator to compute directional derivative with respect to each facet of each element.

◆ normalize_quat()

template<typename Q_type >
bool igl::normalize_quat ( const Q_type *  q,
Q_type *  out 
)

Normalize a quaternion A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.

Parameters
[in]qinput quaternion
[out]outresult of normalization, allowed to be same as q
Returns
true on success, false if len(q) < EPS

◆ null()

template<typename DerivedA , typename DerivedN >
void igl::null ( const Eigen::PlainObjectBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedN > &  N 
)

Compute a basis for the null space for the given matrix A: the columns of the output N form a basis for the space orthogonal to that spanned by the rows of A.

Like MATLAB's null

Parameters
[in]Am by n matrix
[out]Nn by r matrix, where r is the row rank of A

◆ octree()

template<typename DerivedP , typename IndexType , typename DerivedCH , typename DerivedCN , typename DerivedW >
void igl::octree ( const Eigen::MatrixBase< DerivedP > &  P,
std::vector< std::vector< IndexType > > &  point_indices,
Eigen::PlainObjectBase< DerivedCH > &  CH,
Eigen::PlainObjectBase< DerivedCN > &  CN,
Eigen::PlainObjectBase< DerivedW > &  W 
)

Given a set of 3D points P, generate data structures for a pointerless octree.

Each cell stores its points, children, center location and width. Our octree is not dense. We use the following rule: if the current cell has any number of points, it will have all 8 children. A leaf cell will have -1's as its list of child indices.

We use a binary numbering of children. Treating the parent cell's center as the origin, we number the octants in the following manner: The first bit is 1 iff the octant's x coordinate is positive The second bit is 1 iff the octant's y coordinate is positive The third bit is 1 iff the octant's z coordinate is positive

For example, the octant with negative x, positive y, positive z is: 110 binary = 6 decimal

Parameters
[in]P#P by 3 list of point locations
[out]point_indicesa vector of vectors, where the ith entry is a vector of the indices into P that are the ith octree cell's points
[out]CH#OctreeCells by 8, where the ith row is the indices of the ith octree cell's children
[out]CN#OctreeCells by 3, where the ith row is a 3d row vector representing the position of the ith cell's center
[out]W#OctreeCells, a vector where the ith entry is the width of the ith octree cell

◆ offset_surface()

template<typename DerivedV , typename DerivedF , typename isolevelType , typename DerivedSV , typename DerivedSF , typename DerivedGV , typename Derivedside , typename DerivedS >
void igl::offset_surface ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const isolevelType  isolevel,
const typename Derivedside::Scalar  s,
const SignedDistanceType signed_distance_type,
Eigen::PlainObjectBase< DerivedSV > &  SV,
Eigen::PlainObjectBase< DerivedSF > &  SF,
Eigen::PlainObjectBase< DerivedGV > &  GV,
Eigen::PlainObjectBase< Derivedside > &  side,
Eigen::PlainObjectBase< DerivedS > &  S 
)

Compute a triangulated offset surface using matching cubes on a grid of signed distance values from the input triangle mesh.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh triangle indices into V
[in]isoleveliso level to extract (signed distance: negative inside)
[in]snumber of grid cells along longest side (controls resolution)
[in]signed_distance_typetype of signing to use (see ../signed_distance.h)
[out]SV#SV by 3 list of output surface mesh vertex positions
[out]SF#SF by 3 list of output mesh triangle indices into SV
[out]GV#GV=side(0)*side(1)*side(2) by 3 list of grid cell centers
[out]sidelist of number of grid cells in x, y, and z directions
[out]S#GV by 3 list of signed distance values near isolevel ("far" from isolevel these values are incorrect)

◆ on_boundary() [1/2]

template<typename IntegerT >
void igl::on_boundary ( const std::vector< std::vector< IntegerT > > &  T,
std::vector< bool > &  I,
std::vector< std::vector< bool > > &  C 
)

Determine boundary facets of mesh elements stored in T.

Template Parameters
IntegerTinteger-value: i.e. int
IntegerFinteger-value: i.e. int
Parameters
[in]Ttriangle|tetrahedron index list, m by 3|4, where m is the number of elements
[out]Im long list of bools whether tet is on boundary
[out]Cm by 3|4 list of bools whether opposite facet is on boundary

◆ on_boundary() [2/2]

template<typename DerivedT , typename DerivedI , typename DerivedC >
void igl::on_boundary ( const Eigen::MatrixBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ orient_halfedges()

template<typename DerivedF , typename DerivedE , typename DerivedOE >
void igl::orient_halfedges ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedOE > &  oE 
)

Orients halfedges for a triangle mesh, assigning them to a unique edge.

Parameters
[in]F#F by 3 input mesh connectivity
[out]E#E by 3 a mapping from each halfedge to each edge
[out]oE#E by 3 the orientation (e.g., -1 or 1) of each halfedge compared to the orientation of the actual edge. Every edge appears positively oriented exactly once.
See also
unique_simplices

◆ orient_outward()

template<typename DerivedV , typename DerivedF , typename DerivedC , typename DerivedFF , typename DerivedI >
void igl::orient_outward ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedFF > &  FF,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Orient each component (identified by C) of a mesh (V,F) so the normals on average point away from the patch's centroid.

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of triangle indices
[in]C#F list of components (output of orientable_patches)
[out]FF#F by 3 list of new triangle indices such that FF(~I,:) = F(~I,:) and FF(I,:) = fliplr(F(I,:)) (OK if &FF = &F)
[out]Imax(C)+1 list of whether face has been flipped
See also
orientable_patches, reorient_facets_raycast

◆ orientable_patches() [1/2]

template<typename DerivedF , typename DerivedC , typename AScalar >
void igl::orientable_patches ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::SparseMatrix< AScalar > &  A 
)

Compute connected components of facets connected by manifold edges.

Parameters
[in]F#F by simplex-size list of facets
[out]C#F list of component ids
[out]A#F by #F adjacency matrix

◆ orientable_patches() [2/2]

template<typename DerivedF , typename DerivedC >
void igl::orientable_patches ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ oriented_facets()

template<typename DerivedF , typename DerivedE >
void igl::oriented_facets ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E 
)

Determines all "directed [facets](https://en.wikipedia.org/wiki/Simplex#Elements)" of a given set of simplicial elements.

For a manifold triangle mesh, this computes all half-edges. For a manifold tetrahedral mesh, this computes all half-faces.

Parameters
[in]F#F by simplex_size list of simplices
[out]E#E by simplex_size-1 list of facets, such that E.row(f+#F*c) is the facet opposite F(f,c)
Note
this is not the same as igl::edges because this includes every directed edge including repeats (meaning interior edges on a surface will show up once for each direction and non-manifold edges may appear more than once for each direction).

◆ orth()

void igl::orth ( const Eigen::MatrixXd &  A,
Eigen::MatrixXd &  Q 
)

Orthogonalization of a matrix.

ORTH(A,Q) produces Q as an orthonormal basis for the range of A. That is, Q'*Q = I, the columns of Q span the same space as the columns of A, and the number of columns of Q is the rank of A.

The algorithm uses singular value decomposition, SVD, instead of orthogonal factorization, QR. This doubles the computation time, but provides more reliable and consistent rank determination. Closely follows MATLAB implementation in orth.m

Parameters
[in]Am by n matrix
[out]Qm by n matrix with orthonormal columns spanning same column space as A
Warning
Implementation listed as "Broken"

◆ ortho()

template<typename DerivedP >
void igl::ortho ( const typename DerivedP::Scalar  left,
const typename DerivedP::Scalar  right,
const typename DerivedP::Scalar  bottom,
const typename DerivedP::Scalar  top,
const typename DerivedP::Scalar  nearVal,
const typename DerivedP::Scalar  farVal,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Implementation of the deprecated glOrtho function.

Parameters
[in]leftcoordinate of left vertical clipping plane
[in]rightcoordinate of right vertical clipping plane
[in]bottomcoordinate of bottom vertical clipping plane
[in]topcoordinate of top vertical clipping plane
[in]nearValdistance to near plane
[in]farValdistance to far plane
[out]P4x4 perspective matrix

◆ outer_vertex()

template<typename DerivedV , typename DerivedF , typename DerivedI , typename IndexType , typename DerivedA >
void igl::outer_vertex ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedI > &  I,
IndexType &  v_index,
Eigen::PlainObjectBase< DerivedA > &  A 
)

Find a vertex that is reachable from infinite without crossing any faces.

Such vertex is called "outer vertex."

Precondition: The input mesh must have all self-intersection resolved and no duplicated vertices. See cgal::remesh_self_intersections.h for how to obtain such input.

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of triangle indices into V
[in]I#I list of facets to consider
[out]v_indexindex of outer vertex
[out]A#A list of facets incident to the outer vertex

include/igl/outer_element.h

◆ outer_edge()

template<typename DerivedV , typename DerivedF , typename DerivedI , typename IndexType , typename DerivedA >
void igl::outer_edge ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedI > &  I,
IndexType &  v1,
IndexType &  v2,
Eigen::PlainObjectBase< DerivedA > &  A 
)

Find an edge that is reachable from infinity without crossing any faces.

Such edge is called "outer edge."

Precondition: The input mesh must have all self-intersection resolved and no duplicated vertices. The correctness of the output depends on the fact that there is no edge overlap. See cgal::remesh_self_intersections.h for how to obtain such input.

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of triangle indices into V
[in]I#I list of facets to consider
[out]v1index of the first end point of outer edge
[out]v2index of the second end point of outer edge
[out]A#A list of facets incident to the outer edge

include/igl/outer_element.h

◆ outer_facet()

template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedI , typename IndexType >
void igl::outer_facet ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedI > &  I,
IndexType &  f,
bool &  flipped 
)

Find a facet that is reachable from infinity without crossing any faces.

Such facet is called "outer facet."

Precondition: The input mesh must have all self-intersection resolved. I.e there is no duplicated vertices, no overlapping edge and no intersecting faces (the only exception is there could be topologically duplicated faces). See cgal::remesh_self_intersections.h for how to obtain such input.

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of triangle indices into V
[in]N#N by 3 list of face normals
[in]I#I list of facets to consider
[out]fIndex of the outer facet.
[out]flippedtrue iff the normal of f points inwards.

include/igl/outer_element.h

◆ parallel_for() [1/2]

template<typename Index , typename FunctionType >
bool igl::parallel_for ( const Index  loop_size,
const FunctionType &  func,
const size_t  min_parallel = 0 
)
inline

Functional implementation of a basic, open-mp style, parallel for loop.

If the inner block of a for-loop can be rewritten/encapsulated in a single (anonymous/lambda) function call func so that the serial code looks like:

for(int i = 0;i<loop_size;i++)
{
func(i);
}

then parallel_for(loop_size,func,min_parallel) will use as many threads as available on the current hardware to parallelize this for loop so long as loop_size<min_parallel, otherwise it will just use a serial for loop.

Often if your code looks like:

for(int i = 0;i<loop_size;i++)
{
}

Then you can make a minimal two-line change to parallelize it:

//for(int i = 0;i<loop_size;i++)
parallel_for(loop_size,[&](int i)
{
}
,1000);
bool parallel_for(const Index loop_size, const FunctionType &func, const size_t min_parallel=0)
Functional implementation of a basic, open-mp style, parallel for loop.
Definition parallel_for.h:123
Parameters
[in]loop_sizenumber of iterations. I.e. for(int i = 0;i<loop_size;i++) ...
[in]funcfunction handle taking iteration index as only argument to compute inner block of for loop I.e. for(int i ...){ func(i); }
[in]min_parallelmin size of loop_size such that parallel (non-serial) thread pooling should be attempted {0}
Returns
true iff thread pool was invoked

◆ parallel_for() [2/2]

template<typename Index , typename PrepFunctionType , typename FunctionType , typename AccumFunctionType >
bool igl::parallel_for ( const Index  loop_size,
const PrepFunctionType &  prep_func,
const FunctionType &  func,
const AccumFunctionType &  accum_func,
const size_t  min_parallel = 0 
)
inline

Functional implementation of an open-mp style, parallel for loop with accumulation.

For example, serial code separated into n chunks (each to be parallelized with a thread) might look like:

Eigen::VectorXd S;
const auto & prep_func = [&S](int n){ S = Eigen:VectorXd::Zero(n); };
const auto & func = [&X,&S](int i, int t){ S(t) += X(i); };
const auto & accum_func = [&S,&sum](int t){ sum += S(t); };
prep_func(n);
for(int i = 0;i<loop_size;i++)
{
func(i,i%n);
}
double sum = 0;
for(int t = 0;t<n;t++)
{
accum_func(t);
}
Parameters
[in]loop_sizenumber of iterations. I.e. for(int i = 0;i<loop_size;i++) ...
[in]prep_funcfunction handle taking n >= number of threads as only argument
[in]funcfunction handle taking iteration index i and thread id t as only arguments to compute inner block of for loop I.e. for(int i ...){ func(i,t); }
[in]accum_funcfunction handle taking thread index as only argument, to be called after all calls of func, e.g., for serial accumulation across all n (potential) threads, see n in description of prep_func.
[in]min_parallelmin size of loop_size such that parallel (non-serial) thread pooling should be attempted {0}
Returns
true iff thread pool was invoked

◆ parallel_transport_angles()

template<typename DerivedV , typename DerivedF , typename DerivedK >
void igl::parallel_transport_angles ( const Eigen::PlainObjectBase< DerivedV > &  V,
const Eigen::PlainObjectBase< DerivedF > &  F,
const Eigen::PlainObjectBase< DerivedV > &  FN,
const Eigen::MatrixXi &  E2F,
const Eigen::MatrixXi &  F2E,
Eigen::PlainObjectBase< DerivedK > &  K 
)

Given the per-face local bases computed via igl::local_basis, this function computes the angle between the two reference frames across each edge.

Any two vectors across the edge whose 2D representation only differs by this angle are considered to be parallel.

Parameters
[in]V#V by 3 list of mesh vertex coordinates
[in]F#F by 3 list of mesh faces (must be triangles)
[in]FN#F by 3 list of face normals
[in]E2F#E by 2 list of the edge-to-face relation (e.g. computed via igl::edge_topology)
[in]F2E#F by 3 list of the face-to-edge relation (e.g. computed
[out]K#E by 1 list of the parallel transport angles (zero for all boundary edges)

◆ partition()

void igl::partition ( const Eigen::MatrixXd &  W,
const int  k,
Eigen::Matrix< int, Eigen::Dynamic, 1 > &  G,
Eigen::Matrix< int, Eigen::Dynamic, 1 > &  S,
Eigen::Matrix< double, Eigen::Dynamic, 1 > &  D 
)

Partition vertices into groups based on each vertex's vector: vertices with similar coordinates (close in space) will be put in the same group.

Parameters
[in]W#W by dim coordinate matrix
[in]kdesired number of groups default is dim
[out]G#W list of group indices (1 to k) for each vertex, such that vertex i is assigned to group G(i)
[out]Sk list of seed vertices
[out]D#W list of squared distances for each vertex to it's corresponding closest seed

◆ parula() [1/4]

template<typename T >
void igl::parula ( const T  f,
T *  rgb 
)

Parula colormap like MATLAB's parula.

Parameters
[in]ffactor determining color value as if 0 was min and 1 was max
[out]rgbresulting rgb color
  • r red value
  • g green value
  • b blue value

◆ parula() [2/4]

template<typename T >
void igl::parula ( const T  f,
T &  r,
T &  g,
T &  b 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ parula() [3/4]

template<typename DerivedZ , typename DerivedC >
void igl::parula ( const Eigen::MatrixBase< DerivedZ > &  Z,
const bool  normalize,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]Z#Z list of factors
[in]normalizewhether to normalize Z to be tightly between [0,1]
[out]C#C by 3 list of rgb colors

◆ parula() [4/4]

template<typename DerivedZ , typename DerivedC >
void igl::parula ( const Eigen::MatrixBase< DerivedZ > &  Z,
const double  min_Z,
const double  max_Z,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]min_zvalue at blue
[in]max_zvalue at red

◆ path_to_edges() [1/2]

template<typename DerivedI , typename DerivedE >
void igl::path_to_edges ( const Eigen::MatrixBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedE > &  E,
bool  make_loop = false 
)

Given a path as an ordered list of N>=2 vertex indices I[0], I[1], ..., I[N-1] construct a list of edges [[I[0],I[1]], [I[1],I[2]], ..., [I[N-2], I[N-1]]] connecting each sequential pair of vertices.

Parameters
[in]I#I list of vertex indices
[in]make_loopbool If true, include an edge connecting I[N-1] to I[0]
[out]E#I-1 by 2 list of edges

◆ path_to_edges() [2/2]

template<typename Index , typename DerivedE >
void igl::path_to_edges ( const std::vector< Index > &  I,
Eigen::PlainObjectBase< DerivedE > &  E,
bool  make_loop = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ path_to_executable()

std::string igl::path_to_executable ( )

Path to current executable.

Returns
path as string
Note
Tested for Mac OS X

◆ pathinfo()

void igl::pathinfo ( const std::string &  path,
std::string &  dirname,
std::string &  basename,
std::string &  extension,
std::string &  filename 
)

Function like PHP's pathinfo to return information about path.

Parameters
[in]pathstring containing input path
[out]dirnamestring containing dirname (see dirname.h)
[out]basenamestring containing basename (see basename.h)
[out]extensionstring containing extension (characters after last '.')
[out]filenamestring containing filename (characters of basename before last '.')

Examples

 input                     | dirname        basename       ext    filename
 "/"                       | "/"            ""             ""     ""
 "//"                      | "/"            ""             ""     ""
 "/foo"                    | "/"            "foo"          ""     "foo"
 "/foo/"                   | "/"            "foo"          ""     "foo"
 "/foo//"                  | "/"            "foo"          ""     "foo"
 "/foo/./"                 | "/foo"         "."            ""     ""
 "/foo/bar"                | "/foo"         "bar"          ""     "bar"
 "/foo/bar."               | "/foo"         "bar."         ""     "bar"
 "/foo/bar.txt"            | "/foo"         "bar.txt"      "txt"  "bar"
 "/foo/bar.txt.zip"        | "/foo"         "bar.txt.zip"  "zip"  "bar.txt"
 "/foo/bar.dir/"           | "/foo"         "bar.dir"      "dir"  "bar"
 "/foo/bar.dir/file"       | "/foo/bar.dir" "file"         ""     "file"
 "/foo/bar.dir/file.txt"   | "/foo/bar.dir" "file.txt"     "txt"  "file"
See also
basename, dirname

◆ per_corner_normals() [1/5]

template<typename DerivedV , typename DerivedF , typename DerivedCN >
void igl::per_corner_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const typename DerivedV::Scalar  corner_threshold_degrees,
Eigen::PlainObjectBase< DerivedCN > &  CN 
)

Compute per corner normals for a triangle mesh by computing the area-weighted average of normals at incident faces whose normals deviate less than the provided threshold.

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of mesh triangle indices into V
[in]corner_threshold_degreesthreshold in degrees on sharp angles
[out]CN#F*3 by 3 list of mesh vertex 3D normals, where the normal for corner F(i,j) is at CN.row(i*3+j)

◆ per_corner_normals() [2/5]

template<typename DerivedV , typename DerivedF , typename DerivedVF , typename DerivedNI , typename DerivedCN >
void igl::per_corner_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const typename DerivedV::Scalar  corner_threshold_degrees,
const Eigen::MatrixBase< DerivedVF > &  VF,
const Eigen::MatrixBase< DerivedNI > &  NI,
Eigen::PlainObjectBase< DerivedCN > &  CN 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]VF3*#F list List of faces indice on each vertex, so that VF(NI(i)+j) = f, means that face f is the jth face (in no particular order) incident on vertex i.
[in]NI#V+1 list cumulative sum of vertex-triangle degrees with a preceeding zero. "How many faces" have been seen before visiting this vertex and its incident faces.
See also
vertex_triangle_adjacency

◆ per_corner_normals() [3/5]

template<typename DerivedV , typename DerivedF , typename DerivedCI , typename DerivedCC , typename DerivedCN >
void igl::per_corner_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedCI > &  CI,
const Eigen::MatrixBase< DerivedCC > &  CC,
Eigen::PlainObjectBase< DerivedCN > &  CN 
)
Parameters
[in]CI#CI list of face neighbors as indices into rows of F
[in]CC3*#F+1 list of cumulative sizes so that CC(i*3+j+1) - CC(i*3+j) is the number of faces considered smoothly incident on corner at F(i,j)
See also
smooth_corner_adjacency

◆ per_corner_normals() [4/5]

template<typename DerivedNV , typename DerivedNF , typename DerivedCN >
void igl::per_corner_normals ( const Eigen::MatrixBase< DerivedNV > &  NV,
const Eigen::MatrixBase< DerivedNF > &  NF,
Eigen::PlainObjectBase< DerivedCN > &  CN 
)

Given indexed normals (e.g., read from a .obj file), explode into per-corner normals (e.g., as expected by igl::opengl::ViewerData)

Parameters
[in]NV#NV by 3 list of index normal vectors
[in]NF#F by nc list of indices into rows of NV
[out]CN#F*nc by 3 list of per-corner normals so that CN.row(i*nc+c) = NV.row(NF(i,c))

◆ per_corner_normals() [5/5]

template<typename DerivedV , typename DerivedI , typename DerivedC , typename DerivedN , typename DerivedVV , typename DerivedFF , typename DerivedJ , typename DerivedNN >
void igl::per_corner_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedI > &  I,
const Eigen::MatrixBase< DerivedC > &  C,
const typename DerivedV::Scalar  corner_threshold_degrees,
Eigen::PlainObjectBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedVV > &  VV,
Eigen::PlainObjectBase< DerivedFF > &  FF,
Eigen::PlainObjectBase< DerivedJ > &  J,
Eigen::PlainObjectBase< DerivedNN > &  NN 
)

Per-corner normals for a polygon mesh.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]I#I vectorized list of polygon corner indices into rows of some matrix V
[in]C#polygons+1 list of cumulative polygon sizes so that C(i+1)-C(i) = size of the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the indices of the ith polygon
[in]corner_thresholdthreshold in degrees on sharp angles
[out]N#I by 3 list of per corner normals
[out]VV#I+#polygons by 3 list of auxiliary triangle mesh vertex positions
[out]FF#I by 3 list of triangle indices into rows of VV
[out]J#I list of indices into original polygons
[out]NN#FF by 3 list of normals for each auxiliary triangle

◆ per_edge_normals() [1/3]

template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedN , typename DerivedE , typename DerivedEMAP >
void igl::per_edge_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const PerEdgeNormalsWeightingType  weight,
const Eigen::MatrixBase< DerivedFN > &  FN,
Eigen::PlainObjectBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP 
)

Compute face normals via vertex position list, face list.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 3 eigen Matrix of face (triangle) indices
[in]weightweighting type
[in]FN#F by 3 matrix of 3D face normals per face
[out]N#2 by 3 matrix of mesh edge 3D normals per row
[out]E#E by 2 matrix of edge indices per row
[out]EMAP#E by 1 matrix of indices from all edges to E

◆ per_edge_normals() [2/3]

template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedE , typename DerivedEMAP >
void igl::per_edge_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const PerEdgeNormalsWeightingType  weight,
Eigen::PlainObjectBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ per_edge_normals() [3/3]

template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedE , typename DerivedEMAP >
void igl::per_edge_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ per_face_normals() [1/3]

template<typename DerivedV , typename DerivedF , typename DerivedZ , typename DerivedN >
void igl::per_face_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedZ > &  Z,
Eigen::PlainObjectBase< DerivedN > &  N 
)

Compute face normals via vertex position list, face list.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 3 eigen Matrix of face (triangle) indices
[in]Z3 vector normal given to faces with degenerate normal.
[out]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);

◆ per_face_normals() [2/3]

template<typename DerivedV , typename DerivedF , typename DerivedN >
void igl::per_face_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedN > &  N 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Wrapper with Z = (0,0,0). Note that this means that row norms will be zero (i.e. not 1) for degenerate normals.

◆ per_face_normals_stable()

template<typename DerivedV , typename DerivedF , typename DerivedN >
void igl::per_face_normals_stable ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedN > &  N 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Special version where order of face indices is guaranteed not to effect output.

◆ per_face_normals() [3/3]

template<typename DerivedV , typename DerivedI , typename DerivedC , typename DerivedN , typename DerivedVV , typename DerivedFF , typename DerivedJ >
void igl::per_face_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedI > &  I,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedVV > &  VV,
Eigen::PlainObjectBase< DerivedFF > &  FF,
Eigen::PlainObjectBase< DerivedJ > &  J 
)

Per face normals for a general polygon mesh.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]I#I vectorized list of polygon corner indices into rows of some matrix V
[in]C#polygons+1 list of cumulative polygon sizes so that C(i+1)-C(i) = size of the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the indices of the ith polygon
[in]corner_thresholdthreshold in degrees on sharp angles
[out]N#polygons by 3 list of per face normals
[out]VV#I+#polygons by 3 list of auxiliary triangle mesh vertex positions
[out]FF#I by 3 list of triangle indices into rows of VV
[out]J#I list of indices into original polygons

◆ per_vertex_attribute_smoothing()

template<typename DerivedV , typename DerivedF >
void igl::per_vertex_attribute_smoothing ( const Eigen::MatrixBase< DerivedV > &  Ain,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedV > &  Aout 
)

Smooth vertex attributes using uniform Laplacian.

Parameters
[in]Ain#V by #A eigen Matrix of mesh vertex attributes (each vertex has #A attributes)
[in]F#F by 3 eigne Matrix of face (triangle) indices
[out]Aout#V by #A eigen Matrix of mesh vertex attributes

◆ per_vertex_normals() [1/4]

template<typename DerivedV , typename DerivedF , typename DerivedN >
void igl::per_vertex_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const igl::PerVertexNormalsWeightingType  weighting,
Eigen::PlainObjectBase< DerivedN > &  N 
)

Compute vertex normals via vertex position list, face list.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 3 eigen Matrix of face (triangle) indices
[in]weightingWeighting type
[out]N#V by 3 eigen Matrix of mesh vertex 3D normals

◆ per_vertex_normals() [2/4]

template<typename DerivedV , typename DerivedF , typename DerivedN >
void igl::per_vertex_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedN > &  N 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ per_vertex_normals() [3/4]

template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedN >
void igl::per_vertex_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const PerVertexNormalsWeightingType  weighting,
const Eigen::MatrixBase< DerivedFN > &  FN,
Eigen::PlainObjectBase< DerivedN > &  N 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]FN#F by 3 matrix of face (triangle) normals

◆ per_vertex_normals() [4/4]

template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedN >
void igl::per_vertex_normals ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedFN > &  FN,
Eigen::PlainObjectBase< DerivedN > &  N 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ per_vertex_point_to_plane_quadrics()

void igl::per_vertex_point_to_plane_quadrics ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const Eigen::MatrixXi &  EMAP,
const Eigen::MatrixXi &  EF,
const Eigen::MatrixXi &  EI,
std::vector< std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double > > &  quadrics 
)

Compute quadrics per vertex of a "closed" triangle mesh (V,F).

Rather than follow the qslim paper, this implements the lesser-known follow up "Simplifying Surfaces with Color and Texture using Quadric Error Metrics". This allows V to be n-dimensional (where the extra coordiantes store texture UVs, color RGBs, etc.

Parameters
[in]V#V by n list of vertex positions. Assumes that vertices with infinite coordinates are "points at infinity" being used to close up boundary edges with faces. This allows special subspace quadrice for boundary edges: There should never be more than one "point at infinity" in a single triangle.
[in]F#F by 3 list of triangle indices into V
[in]E#E by 2 list of edge indices into V.
[in]EMAP#F*3 list of indices into E, mapping each directed edge to unique unique edge in E
[in]EF#E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i)
[in]EI#E by 2 list of edge flap corners (see above).
[out]quadrics#V list of quadrics, where a quadric is a tuple {A,b,c} such that the quadratic energy of moving this vertex to position x is given by x'Ax - 2b + c

◆ piecewise_constant_winding_number() [1/2]

template<typename DerivedF , typename DeriveduE , typename DeriveduEC , typename DeriveduEE >
bool igl::piecewise_constant_winding_number ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DeriveduE > &  uE,
const Eigen::MatrixBase< DeriveduEC > &  uEC,
const Eigen::MatrixBase< DeriveduEE > &  uEE 
)

Determine if a given mesh induces a piecewise constant winding number field: Is this mesh valid input to solid set operations.

Assumes that (V,F) contains no self-intersections (including degeneracies and co-incidences). If there are co-planar and co-incident vertex placements, a mesh could fail this combinatorial test but still induce a piecewise-constant winding number geometrically. For example, consider a hemisphere with boundary and then pinch the boundary "shut" along a line segment. The **_bullet-proof_** check is to first resolve all self-intersections in (V,F) -> (SV,SF) (i.e. what the igl::copyleft::cgal::piecewise_constant_winding_number overload does).

Parameters
[in]F#F by 3 list of triangle indices into some (abstract) list of vertices V
[in]uE#uE by 2 list of unique edges indices into V
[in]uEC#uE+1 list of cumsums of directed edges sharing each unique edge
[in]uEE#E list of indices into E (see igl::unique_edge_map)
Returns
true if the mesh combinatorially induces a piecewise constant winding number field.

◆ piecewise_constant_winding_number() [2/2]

template<typename DerivedF >
bool igl::piecewise_constant_winding_number ( const Eigen::MatrixBase< DerivedF > &  F)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ pinv() [1/2]

template<typename DerivedA , typename DerivedX >
void igl::pinv ( const Eigen::MatrixBase< DerivedA > &  A,
typename DerivedA::Scalar  tol,
Eigen::PlainObjectBase< DerivedX > &  X 
)

Compute the Moore-Penrose pseudoinverse.

Parameters
[in]Am by n matrix
[in]toltolerance (if negative then default is used)
[out]Xn by m matrix so that A*X*A = A and X*A*X = X and A*X = (A*X)' and (X*A) = (X*A)'

◆ pinv() [2/2]

template<typename DerivedA , typename DerivedX >
void igl::pinv ( const Eigen::MatrixBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedX > &  X 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ planarize_quad_mesh()

template<typename DerivedV , typename DerivedF >
void igl::planarize_quad_mesh ( const Eigen::MatrixBase< DerivedV > &  Vin,
const Eigen::MatrixBase< DerivedF > &  F,
const int  maxIter,
const double &  threshold,
Eigen::PlainObjectBase< DerivedV > &  Vout 
)

Planarizes a given quad mesh using the algorithm described in the paper "Shape-Up: Shaping Discrete Geometry with Projections" by S.

Bouaziz, M. Deuss, Y. Schwartzburg, T. Weise, M. Pauly, Computer Graphics Forum, Volume 31, Issue 5, August 2012, p. 1657-1667 (http://dl.acm.org/citation.cfm?id=2346802). The algorithm iterates between projecting each quad to its closest planar counterpart and stitching those quads together via a least squares optimization. It stops whenever all quads' non-planarity is less than a given threshold (suggested value: 0.01), or a maximum number of iterations is reached.

Parameters
[in]Vin#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 4 eigen Matrix of face (quad) indices
[in]maxItermaximum numbers of iterations
[in]thresholdminimum allowed threshold for non-planarity
[out]Vout#V by 3 eigen Matrix of planar mesh vertex 3D positions

◆ point_in_circle()

bool igl::point_in_circle ( const double  qx,
const double  qy,
const double  cx,
const double  cy,
const double  r 
)

Determine if 2d point is in a circle.

Parameters
[in]qxx-coordinate of query point
[in]qyy-coordinate of query point
[in]cxx-coordinate of circle center
[in]cyy-coordinate of circle center
[in]rradius of circle
Returns
true if query point is in circle, false otherwise

◆ point_mesh_squared_distance()

template<typename DerivedP , typename DerivedV , typename DerivedEle , typename DerivedsqrD , typename DerivedI , typename DerivedC >
void igl::point_mesh_squared_distance ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedEle > &  Ele,
Eigen::PlainObjectBase< DerivedsqrD > &  sqrD,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Compute distances from a set of points P to a triangle mesh (V,F)

Parameters
[in]P#P by 3 list of query point positions
[in]V#V by 3 list of vertex positions
[in]Ele#Ele by (3|2|1) list of (triangle|edge|point) indices
[out]sqrD#P list of smallest squared distances
[out]I#P list of primitive indices corresponding to smallest distances
[out]C#P by 3 list of closest points

Example:
Eigen::MatrixXd V;
Eigen::MatrixXi F;
igl::read_triangle_mesh("bunny.obj",V,F);
// 100 points in [-1,1]³ cube
Eigen::MatrixXd P = Eigen::MatrixXd::Random(100,3);
Eigen::VectorXd sqrD;
Eigen::VectorXi I;
Eigen::MatrixXd C;
// Now sqrD(i) = squared distance from P.row(i) to mesh
// I(i) = closest primitive index
// C.row(i) = closest point on mesh to P.row(i)
bool read_triangle_mesh(const std::string str, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedF > &F)
Read mesh from an ascii file with automatic detection of file format among: mesh, msh obj,...
void point_mesh_squared_distance(const Eigen::MatrixBase< DerivedP > &P, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, Eigen::PlainObjectBase< DerivedsqrD > &sqrD, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C)
Compute distances from a set of points P to a triangle mesh (V,F)

◆ point_simplex_squared_distance() [1/2]

template<int DIM, typename Derivedp , typename DerivedV , typename DerivedEle , typename Derivedsqr_d , typename Derivedc >
void igl::point_simplex_squared_distance ( const Eigen::MatrixBase< Derivedp > &  p,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedEle > &  Ele,
const typename DerivedEle::Index  i,
Derivedsqr_d &  sqr_d,
Eigen::PlainObjectBase< Derivedc > &  c 
)

Determine squared distance from a point to linear simplex.

Parameters
[in]pd-long query point
[in]V#V by d list of vertices
[in]Ele#Ele by ss<=d+1 list of simplex indices into V
[in]iindex into Ele of simplex
[out]sqr_dsquared distance of Ele(i) to p
[out]cclosest point on Ele(i)

◆ point_simplex_squared_distance() [2/2]

template<int DIM, typename Derivedp , typename DerivedV , typename DerivedEle , typename Derivedsqr_d , typename Derivedc , typename Derivedb >
void igl::point_simplex_squared_distance ( const Eigen::MatrixBase< Derivedp > &  p,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedEle > &  Ele,
const typename DerivedEle::Index  i,
Derivedsqr_d &  sqr_d,
Eigen::PlainObjectBase< Derivedc > &  c,
Eigen::PlainObjectBase< Derivedb > &  b 
)

Determine squared distance from a point to linear simplex.

Also return barycentric coordinate of closest point.

Parameters
[in]pd-long query point
[in]V#V by d list of vertices
[in]Ele#Ele by ss<=d+1 list of simplex indices into V
[in]iindex into Ele of simplex
[out]sqr_dsquared distance of Ele(i) to p
[out]cclosest point on Ele(i)
[out]bbarycentric coordinates of closest point on Ele(i)

◆ polar_dec() [1/4]

template<typename DerivedA , typename DerivedR , typename DerivedT , typename DerivedU , typename DerivedS , typename DerivedV >
void igl::polar_dec ( const Eigen::PlainObjectBase< DerivedA > &  A,
bool  includeReflections,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedU > &  U,
Eigen::PlainObjectBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedV > &  V 
)

Computes the polar decomposition (R,T) of a matrix A.

Parameters
[in]A3 by 3 matrix to be decomposed
[in]includeReflectionsWhether to force R to be a rotation, or allow it to be a reflection
[out]R3 by 3 orthonormal matrix part of decomposition
[out]T3 by 3 stretch matrix part of decomposition
[out]U3 by 3 left-singular vectors
[out]S3 by 1 singular values
[out]V3 by 3 right-singular vectors

◆ polar_dec() [2/4]

template<typename DerivedA , typename DerivedR , typename DerivedT >
void igl::polar_dec ( const Eigen::PlainObjectBase< DerivedA > &  A,
const bool  includeReflections,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedT > &  T 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ polar_dec() [3/4]

template<typename DerivedA , typename DerivedR , typename DerivedT , typename DerivedU , typename DerivedS , typename DerivedV >
void igl::polar_dec ( const Eigen::PlainObjectBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedU > &  U,
Eigen::PlainObjectBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedV > &  V 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

For backward compatibility, these set includeReflections = false.

◆ polar_dec() [4/4]

template<typename DerivedA , typename DerivedR , typename DerivedT >
void igl::polar_dec ( const Eigen::PlainObjectBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedT > &  T 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ polar_svd() [1/4]

template<typename DerivedA , typename DerivedR , typename DerivedT , typename DerivedU , typename DerivedS , typename DerivedV >
void igl::polar_svd ( const Eigen::MatrixBase< DerivedA > &  A,
bool  includeReflections,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedU > &  U,
Eigen::PlainObjectBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedV > &  V 
)

Computes the polar decomposition (R,T) of a matrix A using SVD singular value decomposition.

Parameters
[in]A3 by 3 matrix to be decomposed
[in]includeReflectionsWhether to force R to be a rotation, or allow it to be a reflection
[out]R3 by 3 rotation matrix part of decomposition (always rotataion)
[out]T3 by 3 stretch matrix part of decomposition
[out]U3 by 3 left-singular vectors
[out]S3 by 1 singular values
[out]V3 by 3 right-singular vectors

◆ polar_svd() [2/4]

template<typename DerivedA , typename DerivedR , typename DerivedT >
void igl::polar_svd ( const Eigen::MatrixBase< DerivedA > &  A,
const bool  includeReflections,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedT > &  T 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ polar_svd() [3/4]

template<typename DerivedA , typename DerivedR , typename DerivedT , typename DerivedU , typename DerivedS , typename DerivedV >
void igl::polar_svd ( const Eigen::MatrixBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedU > &  U,
Eigen::PlainObjectBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedV > &  V 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

For backward compatibility, these set includeReflections = false.

◆ polar_svd() [4/4]

template<typename DerivedA , typename DerivedR , typename DerivedT >
void igl::polar_svd ( const Eigen::MatrixBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedT > &  T 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ polar_svd3x3()

template<typename Mat >
void igl::polar_svd3x3 ( const Mat &  A,
Mat &  R 
)

Computes the closest rotation to input matrix A using specialized 3x3 SVD singular value decomposition (WunderSVD3x3)

Parameters
[in]A3 by 3 matrix to be decomposed
[out]R3 by 3 closest element in SO(3) (closeness in terms of Frobenius metric)

This means that det(R) = 1. Technically it's not polar decomposition which guarantees positive semidefinite stretch factor (at the cost of having det(R) = -1). "• The orthogonal factors U and V will be true rotation matrices..." [McAdams, Selle, Tamstorf, Teran, Sefakis 2011]

◆ polygon_corners() [1/2]

template<typename PType , typename DerivedI , typename DerivedC >
void igl::polygon_corners ( const std::vector< std::vector< PType > > &  P,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Convert a list-of-lists polygon mesh faces representation to list of polygon corners and sizes.

Parameters
[in]P#P list of lists of vertex indices into rows of some matrix V
[out]I#I vectorized list of polygon corner indices into rows of some matrix V
[out]C#P+1 list of cumulative polygon sizes so that C(i+1)-C(i) = size of the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the indices of the ith polygon

◆ polygon_corners() [2/2]

template<typename DerivedQ , typename DerivedI , typename DerivedC >
void igl::polygon_corners ( const Eigen::MatrixBase< DerivedQ > &  Q,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convert a pure k-gon list of polygon mesh indices to list of polygon corners and sizes

Parameters
[in]Q#Q by k list of polygon indices (ith row is a k-gon, unless Q(i,j) = -1 then it's a j-gon)

◆ polygons_to_triangles()

template<typename DerivedI , typename DerivedC , typename DerivedF , typename DerivedJ >
void igl::polygons_to_triangles ( const Eigen::MatrixBase< DerivedI > &  I,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedJ > &  J 
)

Given a polygon mesh, trivially triangulate each polygon with a fan.

This purely combinatorial triangulation will work well for convex/flat polygons and degrade otherwise.

Parameters
[in]I#I vectorized list of polygon corner indices into rows of some matrix V
[in]C#polygons+1 list of cumulative polygon sizes so that C(i+1)-C(i) = size of the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the indices of the ith polygon
[out]F#F by 3 list of triangle indices into rows of V
[out]J#F list of indices into 0:#P-1 of corresponding polygon

◆ principal_curvature() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedPD1 , typename DerivedPD2 , typename DerivedPV1 , typename DerivedPV2 >
void igl::principal_curvature ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedPD1 > &  PD1,
Eigen::PlainObjectBase< DerivedPD2 > &  PD2,
Eigen::PlainObjectBase< DerivedPV1 > &  PV1,
Eigen::PlainObjectBase< DerivedPV2 > &  PV2,
unsigned  radius = 5,
bool  useKring = true 
)

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

Parameters
[in]Veigen matrix #V by 3
[in]F#F by 3 list of mesh faces (must be triangles)
[out]PD1#V by 3 maximal curvature direction for each vertex.
[out]PD2#V by 3 minimal curvature direction for each vertex.
[out]PV1#V by 1 maximal curvature value for each vertex.
[out]PV2#V by 1 minimal curvature value for each vertex.
[in]radiuscontrols the size of the neighbourhood used, 1 = average edge length
[in]useKringuse Kring neighbourhood instead of ball neighbourhood
Returns
vector of indices of bad vertices if any.

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

See also
average_onto_faces, average_onto_vertices

◆ principal_curvature() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedPD1 , typename DerivedPD2 , typename DerivedPV1 , typename DerivedPV2 , typename Index >
void igl::principal_curvature ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedPD1 > &  PD1,
Eigen::PlainObjectBase< DerivedPD2 > &  PD2,
Eigen::PlainObjectBase< DerivedPV1 > &  PV1,
Eigen::PlainObjectBase< DerivedPV2 > &  PV2,
std::vector< Index > &  bad_vertices,
unsigned  radius = 5,
bool  useKring = true 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]bad_verticesvector of indices of bad vertices if any.

◆ print_ijv()

template<typename T >
void igl::print_ijv ( const Eigen::SparseMatrix< T > &  X,
const int  offset = 0 
)

Prints a 3 column matrix representing [I,J,V] = find(X).

That is, each row is the row index, column index and value for each non zero entry. Each row is printed on a new line

Template Parameters
Tshould be a eigen sparse matrix primitive type like int or double
Parameters
[in]Xm by n matrix whose entries are to be sorted
[in]offsetoptional offset for I and J indices {0}
See also
matlab_format

◆ print_vector() [1/2]

template<typename T >
void igl::print_vector ( std::vector< std::vector< T > > &  v)

◆ print_vector() [2/2]

template<typename T >
void igl::print_vector ( std::vector< std::vector< std::vector< T > > > &  v)

◆ procrustes() [1/5]

template<typename DerivedX , typename DerivedY , typename Scalar , typename DerivedR , typename DerivedT >
void igl::procrustes ( const Eigen::MatrixBase< DerivedX > &  X,
const Eigen::MatrixBase< DerivedY > &  Y,
const bool  includeScaling,
const bool  includeReflections,
Scalar &  scale,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedT > &  t 
)

Solve Procrustes problem in d dimensions.

Given two point sets X,Y in R^d find best scale s, orthogonal R and translation t s.t. |s*X*R + t - Y|^2 is minimized.

Template Parameters
DerivedVpoint type
Scalarscalar type
DerivedRtype of R
DerivedTtype of t
Parameters
[in]X#V by DIM first list of points
[in]Y#V by DIM second list of points
[in]includeScalingif scaling should be allowed
[in]includeReflectionsif R is allowed to be a reflection
[out]scalescaling
[out]Rorthogonal matrix
[out]ttranslation

Example

MatrixXd X, Y; (containing 3d points as rows)
double scale;
MatrixXd R;
VectorXd t;
igl::procrustes(X,Y,true,false,scale,R,t);
R *= scale;
MatrixXd Xprime = (X * R).rowwise() + t.transpose();
void procrustes(const Eigen::MatrixBase< DerivedX > &X, const Eigen::MatrixBase< DerivedY > &Y, const bool includeScaling, const bool includeReflections, Scalar &scale, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedT > &t)
Solve Procrustes problem in d dimensions.

◆ procrustes() [2/5]

template<typename DerivedX , typename DerivedY , typename Scalar , int DIM, int TType>
void igl::procrustes ( const Eigen::MatrixBase< DerivedX > &  X,
const Eigen::MatrixBase< DerivedY > &  Y,
const bool  includeScaling,
const bool  includeReflections,
Eigen::Transform< Scalar, DIM, TType > &  T 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Same as above but returns Eigen transformation object.

Parameters
[out]Ttransformation that minimizes error

Example

MatrixXd X, Y; (containing 3d points as rows)
AffineCompact3d T;
igl::procrustes(X,Y,true,false,T);
MatrixXd Xprime = (X * T.linear()).rowwise() + T.translation().transpose();

◆ procrustes() [3/5]

template<typename DerivedX , typename DerivedY , typename DerivedR , typename DerivedT >
void igl::procrustes ( const Eigen::MatrixBase< DerivedX > &  X,
const Eigen::MatrixBase< DerivedY > &  Y,
const bool  includeScaling,
const bool  includeReflections,
Eigen::PlainObjectBase< DerivedR > &  S,
Eigen::PlainObjectBase< DerivedT > &  t 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]SS=scale*R, instead of scale and R separately

◆ procrustes() [4/5]

template<typename DerivedX , typename DerivedY , typename DerivedR , typename DerivedT >
void igl::procrustes ( const Eigen::MatrixBase< DerivedX > &  X,
const Eigen::MatrixBase< DerivedY > &  Y,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedT > &  t 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenient wrapper for rigid case (no scaling, no reflections)

◆ procrustes() [5/5]

template<typename DerivedX , typename DerivedY , typename Scalar , typename DerivedT >
void igl::procrustes ( const Eigen::MatrixBase< DerivedX > &  X,
const Eigen::MatrixBase< DerivedY > &  Y,
Eigen::Rotation2D< Scalar > &  R,
Eigen::PlainObjectBase< DerivedT > &  t 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenient wrapper for 2D case.

◆ project() [1/2]

template<typename Scalar >
Eigen::Matrix< Scalar, 3, 1 > igl::project ( const Eigen::Matrix< Scalar, 3, 1 > &  obj,
const Eigen::Matrix< Scalar, 4, 4 > &  model,
const Eigen::Matrix< Scalar, 4, 4 > &  proj,
const Eigen::Matrix< Scalar, 4, 1 > &  viewport 
)

Eigen reimplementation of gluProject.

Parameters
[in]obj*3D objects' x, y, and z coordinates respectively
[in]modelmodel matrix
[in]projprojection matrix
[in]viewportviewport vector
Returns
screen space x, y, and z coordinates respectively

◆ project() [2/2]

template<typename DerivedV , typename DerivedM , typename DerivedN , typename DerivedO , typename DerivedP >
void igl::project ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedM > &  model,
const Eigen::MatrixBase< DerivedN > &  proj,
const Eigen::MatrixBase< DerivedO > &  viewport,
Eigen::PlainObjectBase< DerivedP > &  P 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]V#V by 3 list of object points
[in]modelmodel matrix
[in]projprojection matrix
[in]viewportviewport vector
[out]P#V by 3 list of screen space points

Example:

...
igl::project(V,vr.core().view,vr.core().proj,vr.core().viewport,P);
Eigen::Matrix4f proj
OpenGL proj transformation matrix on last render pass.
Definition ViewerCore.h:226
Eigen::Matrix4f view
OpenGL view transformation matrix on last render pass.
Definition ViewerCore.h:224
Eigen::Vector4f viewport
Viewport size.
Definition ViewerCore.h:221
Definition Viewer.h:43
ViewerCore & core(unsigned core_id=0)

◆ project_isometrically_to_plane()

template<typename DerivedV , typename DerivedF , typename DerivedU , typename DerivedUF , typename Scalar >
void igl::project_isometrically_to_plane ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedU > &  U,
Eigen::PlainObjectBase< DerivedUF > &  UF,
Eigen::SparseMatrix< Scalar > &  I 
)

Project each triangle to the plane.

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of mesh indices
[out]U#F*3 by 2 list of triangle positions
[out]UF#F by 3 list of mesh indices into U
[out]I#V by #F*3 such that I(i,j) = 1 implies U(j,:) corresponds to V(i,:)

◆ project_to_line() [1/3]

template<typename DerivedP , typename DerivedS , typename DerivedD , typename Derivedt , typename DerivedsqrD >
void igl::project_to_line ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedS > &  S,
const Eigen::MatrixBase< DerivedD > &  D,
Eigen::PlainObjectBase< Derivedt > &  t,
Eigen::PlainObjectBase< DerivedsqrD > &  sqrD 
)

Project points onto vectors, that is find the parameter t for a point p such that proj_p = (y-x).

*t, additionally compute the squared distance from p to the line of the vector, such that |p - proj_p|² = sqr_d

Parameters
[in]P#P by dim list of points to be projected
[in]Ssize dim start position of line vector
[in]Dsize dim destination position of line vector
[out]T#P by 1 list of parameters
[out]sqrD#P by 1 list of squared distances

◆ project_to_line() [2/3]

template<typename Scalar >
void igl::project_to_line ( const Scalar  px,
const Scalar  py,
const Scalar  pz,
const Scalar  sx,
const Scalar  sy,
const Scalar  sz,
const Scalar  dx,
const Scalar  dy,
const Scalar  dz,
Scalar &  projpx,
Scalar &  projpy,
Scalar &  projpz,
Scalar &  t,
Scalar &  sqrd 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Same as above but for a single query point

◆ project_to_line() [3/3]

template<typename Scalar >
void igl::project_to_line ( const Scalar  px,
const Scalar  py,
const Scalar  pz,
const Scalar  sx,
const Scalar  sy,
const Scalar  sz,
const Scalar  dx,
const Scalar  dy,
const Scalar  dz,
Scalar &  t,
Scalar &  sqrd 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ project_to_line_segment()

template<typename DerivedP , typename DerivedS , typename DerivedD , typename Derivedt , typename DerivedsqrD >
void igl::project_to_line_segment ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedS > &  S,
const Eigen::MatrixBase< DerivedD > &  D,
Eigen::PlainObjectBase< Derivedt > &  t,
Eigen::PlainObjectBase< DerivedsqrD > &  sqrD 
)

Project points onto vectors, that is find the parameter t for a point p such that proj_p = (y-x).

*t, additionally compute the squared distance from p to the line of the vector, such that |p - proj_p|² = sqr_d

Parameters
[in]P#P by dim list of points to be projected
[in]Ssize dim start position of line vector
[in]Dsize dim destination position of line vector
[out]T#P by 1 list of parameters
[out]sqrD#P by 1 list of squared distances

◆ projection_constraint()

template<typename DerivedUV , typename DerivedM , typename DerivedVP , typename DerivedA , typename DerivedB >
void igl::projection_constraint ( const Eigen::MatrixBase< DerivedUV > &  UV,
const Eigen::MatrixBase< DerivedM > &  M,
const Eigen::MatrixBase< DerivedVP > &  VP,
Eigen::PlainObjectBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedB > &  B 
)

Construct two constraint equations for projecting a point to the screen.

Of the form:

A z = B

with A 2x3 and B 2x1, where z is the 3d position of point in the scene, given the current projection matrix (e.g. gl_proj * gl_modelview), viewport (corner u/v and width/height) and screen space point x,y. Satisfying this equation means that z projects to screen space point (x,y).

Parameters
[in]UV2-long uv-coordinates of screen space point
[in]M4 by 4 projection matrix
[in]VP4-long viewport: (corner_u, corner_v, width, height)
[out]A2 by 3 system matrix
[out]B2 by 1 right-hand side

◆ pseudonormal_test() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedVN , typename DerivedEN , typename DerivedEMAP , typename Derivedq , typename Derivedc , typename Scalar , typename Derivedn >
void igl::pseudonormal_test ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedFN > &  FN,
const Eigen::MatrixBase< DerivedVN > &  VN,
const Eigen::MatrixBase< DerivedEN > &  EN,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
const Eigen::MatrixBase< Derivedq > &  q,
const int  f,
Eigen::PlainObjectBase< Derivedc > &  c,
Scalar &  s,
Eigen::PlainObjectBase< Derivedn > &  n 
)

Given a mesh (V,F), a query point q, and a point on (V,F) c, determine whether q is inside (V,F) --> s=-1 or outside (V,F) s=1, based on the sign of the dot product between (q-c) and n, where n is the normal at c, carefully chosen according to [Bærentzen & Aanæs 2005].

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of triangle indices
[in]FN#F by 3 list of triangle normals
[in]VN#V by 3 list of vertex normals (ANGLE WEIGHTING)
[in]EN#E by 3 list of edge normals (UNIFORM WEIGHTING)
[in]EMAP#F*3 mapping edges in F to E
[in]qQuery point
[in]findex into F to face to which c belongs
[in]cPoint on (V,F)
[out]ssign
[out]nnormal

◆ pseudonormal_test() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedEN , typename DerivedVN , typename Derivedq , typename Derivedc , typename Scalar , typename Derivedn >
void igl::pseudonormal_test ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  E,
const Eigen::MatrixBase< DerivedEN > &  EN,
const Eigen::MatrixBase< DerivedVN > &  VN,
const Eigen::MatrixBase< Derivedq > &  q,
const int  e,
Eigen::PlainObjectBase< Derivedc > &  c,
Scalar &  s,
Eigen::PlainObjectBase< Derivedn > &  n 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

2D version.

◆ pso() [1/2]

template<typename Scalar , typename DerivedX , typename DerivedLB , typename DerivedUB >
Scalar igl::pso ( const std::function< Scalar(DerivedX &) >  f,
const Eigen::MatrixBase< DerivedLB > &  LB,
const Eigen::MatrixBase< DerivedUB > &  UB,
const int  max_iters,
const int  population,
DerivedX &  X 
)

Global optimization with the particle swarm algorithm.

Solve the problem:

minimize f(x) subject to lb ≤ x ≤ ub

by particle swarm optimization (PSO).

Parameters
[in]ffunction that evaluates the objective for a given "particle" location
[in]LB#X vector of lower bounds
[in]UB#X vector of upper bounds
[in]max_itersmaximum number of iterations
[in]populationnumber of particles in swarm
[out]Xbest particle seen so far
Returns
objective corresponding to best particle seen so far

◆ pso() [2/2]

template<typename Scalar , typename DerivedX , typename DerivedLB , typename DerivedUB , typename DerivedP >
Scalar igl::pso ( const std::function< Scalar(DerivedX &) >  f,
const Eigen::MatrixBase< DerivedLB > &  LB,
const Eigen::MatrixBase< DerivedUB > &  UB,
const Eigen::DenseBase< DerivedP > &  P,
const int  max_iters,
const int  population,
DerivedX &  X 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]Pwhether each DOF is periodic

◆ qslim()

bool igl::qslim ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const size_t  max_m,
Eigen::MatrixXd &  U,
Eigen::MatrixXi &  G,
Eigen::VectorXi &  J,
Eigen::VectorXi &  I 
)

Decimate (simplify) a triangle mesh in nD according to the paper "Simplifying Surfaces with Color and Texture using Quadric Error Metrics" by [Garland and Heckbert, 1987] (technically a followup to qslim).

The mesh can have open boundaries but should be edge-manifold.

Parameters
[in]V#V by dim list of vertex positions. Assumes that vertices with infinite coordinates are "points at infinity" being used to close up boundary edges with faces. This allows special subspace quadrice for boundary edges: There should never be more than one "point at infinity" in a single triangle.
[in]F#F by 3 list of triangle indices into V
[in]max_mdesired number of output faces
[out]U#U by dim list of output vertex posistions (can be same ref as V)
[out]G#G by 3 list of output face indices into U (can be same ref as F)
[out]J#G list of indices into F of birth face
[out]I#U list of indices into V of birth vertices

◆ quad_grid() [1/2]

template<typename DerivedV , typename DerivedQ , typename DerivedE >
void igl::quad_grid ( const int  nx,
const int  ny,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedQ > &  Q,
Eigen::PlainObjectBase< DerivedE > &  E 
)

◆ quad_grid() [2/2]

template<typename DerivedQ , typename DerivedE >
void igl::quad_grid ( const int  nx,
const int  ny,
Eigen::PlainObjectBase< DerivedQ > &  Q,
Eigen::PlainObjectBase< DerivedE > &  E 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ quad_planarity()

template<typename DerivedV , typename DerivedF , typename DerivedP >
void igl::quad_planarity ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Compute planarity of the faces of a quad mesh.

Parameters
[in]V#V by 3 eigen Matrix of mesh vertex 3D positions
[in]F#F by 4 eigen Matrix of face (quad) indices
[out]P#F by 1 eigen Matrix of mesh face (quad) planarities

◆ quadprog() [1/3]

template<typename Scalar , int n, int ni>
Eigen::Matrix< Scalar, n, 1 > igl::quadprog ( const Eigen::Matrix< Scalar, n, n > &  H,
const Eigen::Matrix< Scalar, n, 1 > &  f,
const Eigen::Matrix< Scalar, ni, n > &  Ai,
const Eigen::Matrix< Scalar, ni, 1 > &  lbi,
const Eigen::Matrix< Scalar, ni, 1 > &  ubi,
const Eigen::Matrix< Scalar, n, 1 > &  lb,
const Eigen::Matrix< Scalar, n, 1 > &  ub 
)

Solve a convex quadratic program.

Optimized for small dense problems. Still works for Eigen::Dynamic (and then everything needs to be Dynamic).

min_x ½ xᵀ H x + xᵀf
subject to:
  lbi ≤ Ai x ≤ ubi
  lb ≤ x ≤ u
Template Parameters
Scalar(e.g., double)
n#H or Eigen::Dynamic if not known at compile time
ni#Ai or Eigen::Dynamic if not known at compile time
Parameters
[in]H#H by #H quadratic coefficients (only lower triangle used)
[in]f#H linear coefficients
[in]Ai#Ai by #H list of linear equality constraint coefficients
[in]lbi#Ai list of linear equality lower bounds
[in]ubi#Ai list of linear equality upper bounds
[in]lb#H list of lower bounds
[in]ub#H list of lower bounds
Returns
#H-long solution x

◆ quadprog() [2/3]

template<typename Scalar , int n, int m>
Eigen::Matrix< Scalar, n, 1 > igl::quadprog ( const Eigen::Matrix< Scalar, n, n > &  H,
const Eigen::Matrix< Scalar, n, 1 > &  f,
const Eigen::Matrix< Scalar, m, n > &  A,
const Eigen::Matrix< Scalar, m, 1 > &  b,
const Eigen::Matrix< Scalar, n, 1 > &  lb,
const Eigen::Matrix< Scalar, n, 1 > &  ub 
)

Solve a convex quadratic program.

Optimized for small dense problems. All inequalities must be simple bounds.

 min_x ½ xᵀ H x + xᵀf
 subject to:
   A x = b
   lb ≤ x ≤ u
Template Parameters
Scalar(e.g., double)
n#H or Eigen::Dynamic if not known at compile time
m#A or Eigen::Dynamic if not known at compile time
Parameters
[in]H#H by #H quadratic coefficients (only lower triangle used)
[in]f#H linear coefficients
[in]A#A by #H list of linear equality constraint coefficients
[in]b#A list of linear equality lower bounds
[in]lb#H list of lower bounds
[in]ub#H list of lower bounds
Returns
#H-long solution x

◆ quadprog() [3/3]

template<typename Scalar , int n>
Eigen::Matrix< Scalar, n, 1 > igl::quadprog ( const Eigen::Matrix< Scalar, n, n > &  H,
const Eigen::Matrix< Scalar, n, 1 > &  f,
const Eigen::Matrix< Scalar, n, 1 > &  lb,
const Eigen::Matrix< Scalar, n, 1 > &  ub 
)

Solve a convex quadratic program.

Optimized for small dense problems. All constraints must be simple bounds.

 min_x ½ xᵀ H x + xᵀf
 subject to:
   lb ≤ x ≤ u
Template Parameters
Scalar(e.g., double)
n#H or Eigen::Dynamic if not known at compile time
Parameters
[in]H#H by #H quadratic coefficients (only lower triangle used)
[in]f#H linear coefficients
[in]lb#H list of lower bounds
[in]ub#H list of lower bounds
Returns
#H-long solution x

◆ operator+()

std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double > igl::operator+ ( const std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double > &  a,
const std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double > &  b 
)

A binary addition operator for Quadric tuples compatible with qslim, computing c = a+b.

Parameters
[in]aQSlim quadric
[in]bQSlim quadric
[out]cQSlim quadric

include/igl/quadric_binary_plus_operator.h

◆ quat_conjugate()

template<typename Q_type >
void igl::quat_conjugate ( const Q_type *  q1,
Q_type *  out 
)

Compute conjugate of given quaternion http://en.wikipedia.org/wiki/Quaternion#Conjugation.2C_the_norm.2C_and_reciprocal A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.

Parameters
[in]q1input quaternion
[out]outresult of conjugation, allowed to be same as input

◆ quat_mult()

template<typename Q_type >
void igl::quat_mult ( const Q_type *  q1,
const Q_type *  q2,
Q_type *  out 
)

Computes out = q1 * q2 with quaternion multiplication A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.

Parameters
[in]q1left quaternion
[in]q2right quaternion
[out]outresult of multiplication

◆ quat_to_axis_angle()

template<typename Q_type >
void igl::quat_to_axis_angle ( const Q_type *  q,
Q_type *  axis,
Q_type &  angle 
)

Convert quat representation of a rotation to axis angle A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.

Parameters
[in]qquaternion
[out]axis3d vector
[out]anglescalar in radians

◆ quat_to_axis_angle_deg()

template<typename Q_type >
void igl::quat_to_axis_angle_deg ( const Q_type *  q,
Q_type *  axis,
Q_type &  angle 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.include/igl/quat_to_axis_angle.h.

◆ quat_to_mat()

template<typename Q_type >
void igl::quat_to_mat ( const Q_type *  quat,
Q_type *  mat 
)

Convert a quaternion to a 4x4 matrix A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.

Parameters
[in]quatpointer to four elements of quaternion (x,y,z,w)
[out]matpointer to 16 elements of matrix

◆ quats_to_column() [1/2]

void igl::quats_to_column ( const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > >  vQ,
Eigen::VectorXd &  Q 
)

"Columnize" a list of quaternions (q1x,q1y,q1z,q1w,q2x,q2y,q2z,q2w,...)

Parameters
[in]vQn-long list of quaternions
[out]Qn*4-long list of coefficients

◆ quats_to_column() [2/2]

Eigen::VectorXd igl::quats_to_column ( const std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > >  vQ)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ ramer_douglas_peucker() [1/2]

template<typename DerivedP , typename DerivedS , typename DerivedJ >
void igl::ramer_douglas_peucker ( const Eigen::MatrixBase< DerivedP > &  P,
const typename DerivedP::Scalar  tol,
Eigen::PlainObjectBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedJ > &  J 
)

Ramer-Douglas-Peucker piecewise-linear curve simplification.

Parameters
[in]P#P by dim ordered list of vertices along the curve
[in]toltolerance (maximal euclidean distance allowed between the new line and a vertex)
[out]S#S by dim ordered list of points along the curve
[out]J#S list of indices into P so that S = P(J,:)

◆ ramer_douglas_peucker() [2/2]

template<typename DerivedP , typename DerivedS , typename DerivedJ , typename DerivedQ >
void igl::ramer_douglas_peucker ( const Eigen::MatrixBase< DerivedP > &  P,
const typename DerivedP::Scalar  tol,
Eigen::PlainObjectBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedJ > &  J,
Eigen::PlainObjectBase< DerivedQ > &  Q 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Run Ramer-Douglas-Peucker curve simplification but keep track of where every point on the original curve maps to on the simplified curve.

Parameters
[out]Q#P by dim list of points mapping along simplified curve

◆ random_dir()

Eigen::Vector3d igl::random_dir ( )

Generate a uniformly random unit direction in 3D, return as vector.

Returns
random direction

◆ random_dir_stratified()

Eigen::MatrixXd igl::random_dir_stratified ( const int  n)

Generate n stratified uniformly random unit directions in 3d, return as rows of an n by 3 matrix.

Parameters
[in]nnumber of directions
Returns
n by 3 matrix of random directions

◆ random_points_on_mesh()

template<typename DerivedV , typename DerivedF , typename DerivedB , typename DerivedFI , typename DerivedX , typename URBG = DEFAULT_URBG>
void igl::random_points_on_mesh ( const int  n,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedFI > &  FI,
Eigen::PlainObjectBase< DerivedX > &  X,
URBG &&  urbg = igl::generate_default_urbg() 
)

Randomly sample a mesh (V,F) n times.

Parameters
[in]nnumber of samples
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3 list of mesh triangle indices
[out]Bn by 3 list of barycentric coordinates, ith row are coordinates of ith sampled point in face FI(i)
[in]urbgAn instance of UnformRandomBitGenerator (e.g., std::minstd_rand(0))
[out]FIn list of indices into F
[in,out]urbgAn instance of UnformRandomBitGenerator.
[out]Xn by dim list of sample positions.

◆ random_points_on_mesh_intrinsic() [1/2]

template<typename DeriveddblA , typename DerivedB , typename DerivedFI , typename URBG = DEFAULT_URBG>
void igl::random_points_on_mesh_intrinsic ( const int  n,
const Eigen::MatrixBase< DeriveddblA > &  dblA,
Eigen::PlainObjectBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedFI > &  FI,
URBG &&  urbg = igl::generate_default_urbg() 
)

Randomly sample a mesh (V,F) n times.

Parameters
[in]nnumber of samples
[in]dblA#F list of double areas of triangles
[out]Bn by 3 list of barycentric coordinates, ith row are coordinates of ith sampled point in face FI(i)
[out]FIn list of indices into F
[in,out]urbgAn instance of UnformRandomBitGenerator.

◆ random_points_on_mesh_intrinsic() [2/2]

template<typename DeriveddblA , typename DerivedF , typename ScalarB , typename DerivedFI , typename URBG >
void igl::random_points_on_mesh_intrinsic ( const int  n,
const Eigen::MatrixBase< DeriveddblA > &  dblA,
const int  num_vertices,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< ScalarB > &  B,
Eigen::PlainObjectBase< DerivedFI > &  FI,
URBG &&  urbg 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]num_verticesnumber of vertices in mesh
[in]F#F by 3 list of mesh triangle indices
[out]Bn by num_vertices sparse matrix so that B*V produces a list of sample points if dbl = doublearea(V,F)

◆ random_quaternion()

template<typename Scalar >
Eigen::Quaternion< Scalar > igl::random_quaternion ( )

Generate a random quaternion via uniform sampling of the 4-sphere.

Returns
a random quaternion

◆ random_search()

template<typename Scalar , typename DerivedX , typename DerivedLB , typename DerivedUB >
Scalar igl::random_search ( const std::function< Scalar(DerivedX &) >  f,
const Eigen::MatrixBase< DerivedLB > &  LB,
const Eigen::MatrixBase< DerivedUB > &  UB,
const int  iters,
DerivedX &  X 
)

Global optimization via random search.

Solve the problem:

minimize f(x) subject to lb ≤ x ≤ ub

by uniform random search.

Parameters
[in]ffunction to minimize
[in]LB#X vector of finite lower bounds
[in]UB#X vector of finite upper bounds
[in]itersnumber of iterations
[out]X#X optimal parameter vector
Returns
f(X)

◆ randperm()

template<typename DerivedI , typename URBG = DEFAULT_URBG>
void igl::randperm ( const int  n,
Eigen::PlainObjectBase< DerivedI > &  I,
URBG &&  urbg = igl::generate_default_urbg() 
)

Like matlab's randperm(n) but minus 1.

When urbg is not specified, randperm will use default random bit generator std::minstd_rand initialized with random seed generated by std::rand()

Parameters
[in]nnumber of elements
[out]In list of rand permutation of 0:n-1
[in,out]urbgAn instance of UnformRandomBitGenerator.

◆ ray_box_intersect() [1/2]

template<typename Derivedsource , typename Deriveddir , typename Scalar >
bool igl::ray_box_intersect ( const Eigen::MatrixBase< Derivedsource > &  source,
const Eigen::MatrixBase< Deriveddir > &  dir,
const Eigen::AlignedBox< Scalar, 3 > &  box,
const Scalar &  t0,
const Scalar &  t1,
Scalar &  tmin,
Scalar &  tmax 
)

Determine whether a ray origin+t*dir and box intersect within the ray's parameterized range (t0,t1)

Parameters
[in]source3-vector origin of ray
[in]dir3-vector direction of ray
[in]boxaxis aligned box
[in]t0hit only if hit.t less than t0
[in]t1hit only if hit.t greater than t1
[out]tminminimum of interval of overlap within [t0,t1]
[out]tmaxmaximum of interval of overlap within [t0,t1]
Returns
true if hit

◆ ray_box_intersect() [2/2]

template<typename Derivedsource , typename Deriveddir , typename Scalar >
bool igl::ray_box_intersect ( const Eigen::MatrixBase< Derivedsource > &  source,
const Eigen::MatrixBase< Deriveddir > &  inv_dir,
const Eigen::MatrixBase< Deriveddir > &  inv_dir_pad,
const Eigen::AlignedBox< Scalar, 3 > &  box,
const Scalar &  t0,
const Scalar &  t1,
Scalar &  tmin,
Scalar &  tmax 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

same with direction inverse precomputed

◆ ray_mesh_intersect() [1/2]

template<typename Derivedsource , typename Deriveddir , typename DerivedV , typename DerivedF >
bool igl::ray_mesh_intersect ( const Eigen::MatrixBase< Derivedsource > &  source,
const Eigen::MatrixBase< Deriveddir > &  dir,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
std::vector< igl::Hit > &  hits 
)

Shoot a ray against a mesh (V,F) and collect all hits.

If you have many rays, consider using AABB.h

Parameters
[in]source3-vector origin of ray
[in]dir3-vector direction of ray
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh face indices into V
[out]hitssorted list of hits
Returns
true if there were any hits (hits.size() > 0)
See also
AABB

◆ ray_mesh_intersect() [2/2]

template<typename Derivedsource , typename Deriveddir , typename DerivedV , typename DerivedF >
bool igl::ray_mesh_intersect ( const Eigen::MatrixBase< Derivedsource > &  source,
const Eigen::MatrixBase< Deriveddir > &  dir,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
igl::Hit hit 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]hitfirst hit, set only if it exists

◆ ray_triangle_intersect()

template<typename Derivedsource , typename Deriveddir , typename DerivedV , typename DerivedF >
bool igl::ray_triangle_intersect ( const Eigen::MatrixBase< Derivedsource > &  source,
const Eigen::MatrixBase< Deriveddir > &  dir,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const int  f,
igl::Hit hit 
)

◆ ray_sphere_intersect()

template<typename Derivedo , typename Derivedd , typename Derivedc , typename r_type , typename t_type >
int igl::ray_sphere_intersect ( const Eigen::PlainObjectBase< Derivedo > &  o,
const Eigen::PlainObjectBase< Derivedd > &  d,
const Eigen::PlainObjectBase< Derivedc > &  c,
r_type  r,
t_type &  t0,
t_type &  t1 
)

Compute the intersection between a ray from O in direction D and a sphere centered at C with radius r.

Parameters
[in]oorigin of ray
[in]ddirection of ray
[in]ccenter of sphere
[in]rradius of sphere
[out]t0parameterization of first hit (set only if exists) so that hit position = o + t0*d
[out]t1parameterization of second hit (set only if exists)
Returns
the number of hits

◆ read_file_binary()

void igl::read_file_binary ( FILE *  fp,
std::vector< uint8_t > &  fileBufferBytes 
)

Read contents of file into a buffer of uint8_t bytes.

Parameters
[in,out]fppointer to open File
[out]fileBufferBytescontents of file as vector of bytes

Side effects:

closes fp

Exceptions
runtime_erroron error

◆ read_triangle_mesh() [1/4]

template<typename DerivedV , typename DerivedF >
bool igl::read_triangle_mesh ( const std::string  str,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

Read mesh from an ascii file with automatic detection of file format among: mesh, msh obj, off, ply, stl, wrl.

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Indextype for indices (will be read as int and cast to Index)
Parameters
[in]strpath to file
[out]Veigen double matrix #V by 3
[out]Feigen int matrix #F by 3
Returns
true iff success

◆ read_triangle_mesh() [2/4]

template<typename Scalar , typename Index >
bool igl::read_triangle_mesh ( const std::string  str,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Index > > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

outputs to vectors, only .off and .obj supported.

◆ read_triangle_mesh() [3/4]

template<typename DerivedV , typename DerivedF >
bool igl::read_triangle_mesh ( const std::string  str,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
std::string &  dir,
std::string &  base,
std::string &  ext,
std::string &  name 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]dirdirectory path (see pathinfo.h)
[out]basebase name (see pathinfo.h)
[out]extextension (see pathinfo.h)
[out]namefilename (see pathinfo.h)

◆ read_triangle_mesh() [4/4]

template<typename DerivedV , typename DerivedF >
bool igl::read_triangle_mesh ( const std::string &  ext,
FILE *  fp,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]extfile extension
[in,out]fppointer to already opened .ext file (will be closed)

◆ readBF() [1/2]

template<typename DerivedWI , typename DerivedP , typename DerivedO >
bool igl::readBF ( const std::string &  filename,
Eigen::PlainObjectBase< DerivedWI > &  WI,
Eigen::PlainObjectBase< DerivedP > &  P,
Eigen::PlainObjectBase< DerivedO > &  O 
)

Read a bones forest from a file, returns a list of bone roots.

Parameters
[in]file_namepath to .bf bones tree file
[out]WI#B list of unique weight indices
[out]P#B list of parent indices into B, -1 for roots
[out]O#B by 3 list of tip offset vectors from parent (or position for roots)
Returns
true on success, false on errors

◆ readBF() [2/2]

template<typename DerivedWI , typename DerivedbfP , typename DerivedO , typename DerivedC , typename DerivedBE , typename DerivedP >
bool igl::readBF ( const std::string &  filename,
Eigen::PlainObjectBase< DerivedWI > &  WI,
Eigen::PlainObjectBase< DerivedbfP > &  bfP,
Eigen::PlainObjectBase< DerivedO > &  O,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedBE > &  BE,
Eigen::PlainObjectBase< DerivedP > &  P 
)

Read bone forest into pure bone-skeleton format, expects only bones (no point handles), and that a root in the .bf <—> no weight attachment.

Parameters
[in]file_namepath to .bf bones tree file
[out]WI#B list of unique weight indices
[out]P#B list of parent indices into B, -1 for roots
[out]O#B by 3 list of tip offset vectors from parent (or position for roots)
[out]C#C by 3 list of absolute joint locations
[out]BE#BE by 3 list of bone indices into C, in order of weight index
[out]P#BE list of parent bone indices into BE, -1 means root bone
Returns
true on success, false on errors
See also
readTGF, bone_parents, forward_kinematics

◆ readCSV()

template<typename Scalar >
bool igl::readCSV ( const std::string  str,
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &  M 
)

read a matrix from a csv file into a Eigen matrix

Template Parameters
Scalartype for the matrix
Parameters
[in]strpath to .csv file
[out]Meigen matrix
Returns
true on success

◆ readDMAT() [1/2]

template<typename DerivedW >
bool igl::readDMAT ( const std::string  file_name,
Eigen::PlainObjectBase< DerivedW > &  W 
)

Read a matrix from an .dmat file.

Parameters
[in]file_namepath to .dmat file
[out]Weigen matrix containing read-in coefficients
Returns
true on success, false on error

◆ readDMAT() [2/2]

template<typename Scalar >
bool igl::readDMAT ( const std::string  file_name,
std::vector< std::vector< Scalar > > &  W 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readMESH() [1/4]

template<typename DerivedV , typename DerivedF , typename DerivedT >
bool igl::readMESH ( const std::string  mesh_file_name,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedF > &  F 
)

Load a tetrahedral volume mesh from a .mesh file.

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Indextype for indices (will be read as int and cast to Index)
Parameters
[in]mesh_file_namepath of .mesh file
[out]Vdouble matrix of vertex positions #V by 3
[out]T#T list of tet indices into vertex positions
[out]F#F list of face indices into vertex positions

◆ readMESH() [2/4]

template<typename Scalar , typename Index >
bool igl::readMESH ( const std::string  mesh_file_name,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Index > > &  T,
std::vector< std::vector< Index > > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readMESH() [3/4]

template<typename DerivedV , typename DerivedF , typename DerivedT >
bool igl::readMESH ( FILE *  mesh_file,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]pointerto already opened .mesh file (will be closed)

◆ readMESH() [4/4]

template<typename Scalar , typename Index >
bool igl::readMESH ( FILE *  mesh_file,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Index > > &  T,
std::vector< std::vector< Index > > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readMSH() [1/4]

template<int EigenMatrixOptions>
bool igl::readMSH ( const std::string &  msh,
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &  X,
Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &  Tri,
Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &  Tet,
Eigen::VectorXi &  TriTag,
Eigen::VectorXi &  TetTag,
std::vector< std::string > &  XFields,
std::vector< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > > &  XF,
std::vector< std::string > &  EFields,
std::vector< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > > &  TriF,
std::vector< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > > &  TetF 
)

read triangle surface mesh and tetrahedral volume mesh from .msh file

Template Parameters
EigenMatrixOptionsmatrix options of output matrices (e.g., Eigen::ColMajor, Eigen::RowMajor)
Parameters
[in]msh- file name
[out]Xeigen double matrix of vertex positions #X by 3
[out]Tri#Tri eigen integer matrix of triangular faces indices into vertex positions
[out]Tet#Tet eigen integer matrix of tetrahedral indices into vertex positions
[out]TriTag#Tri eigen integer vector of tags associated with surface faces
[out]TetTag#Tet eigen integer vector of tags associated with volume elements
[out]XFields#XFields list of strings with field names associated with nodes
[out]XF#XFields list of eigen double matrices, fields associated with nodes
[out]EFields#EFields list of strings with field names associated with elements
[out]TriF#EFields list of eigen double matrices, fields associated with surface elements
[out]TetF#EFields list of eigen double matrices, fields associated with volume elements
Returns
true on success

◆ readMSH() [2/4]

template<int EigenMatrixOptions>
bool igl::readMSH ( const std::string &  msh,
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &  X,
Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &  Tri,
Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &  Tet,
Eigen::VectorXi &  TriTag,
Eigen::VectorXi &  TetTag 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readMSH() [3/4]

template<int EigenMatrixOptions>
bool igl::readMSH ( const std::string &  msh,
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &  X,
Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &  Tri,
Eigen::VectorXi &  TriTag 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readMSH() [4/4]

template<int EigenMatrixOptions>
bool igl::readMSH ( const std::string &  msh,
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &  X,
Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, EigenMatrixOptions > &  Tri 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readNODE() [1/2]

template<typename DerivedV , typename DerivedI >
bool igl::readNODE ( const std::string  node_file_name,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedI > &  I 
)

load a list of points from a .node file

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Indextype for indices (will be read as int and cast to Index)
Parameters
[in]node_file_namepath of .node file
[out]Vdouble matrix of vertex positions #V by dim
[out]Ilist of indices (first tells whether 0 or 1 indexed)

◆ readNODE() [2/2]

template<typename Scalar , typename Index >
bool igl::readNODE ( const std::string  node_file_name,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Index > > &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readOBJ() [1/7]

template<typename Scalar , typename Index >
bool igl::readOBJ ( const std::string  obj_file_name,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Scalar > > &  TC,
std::vector< std::vector< Scalar > > &  N,
std::vector< std::vector< Index > > &  F,
std::vector< std::vector< Index > > &  FTC,
std::vector< std::vector< Index > > &  FN,
std::vector< std::tuple< std::string, Index, Index > > &  FM 
)

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

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Indextype for indices (will be read as int and cast to Index)
Parameters
[in]strpath to .obj file
[out]Vdouble matrix of vertex positions #V by 3
[out]TCdouble matrix of texture coordinats #TC by 2
[out]Ndouble matrix of corner normals #N by 3
[out]F#F list of face indices into vertex positions
[out]FTC#F list of face indices into vertex texture coordinates
[out]FN#F list of face indices into vertex normals
Returns
true on success, false on errors

◆ readOBJ() [2/7]

template<typename Scalar , typename Index >
bool igl::readOBJ ( const std::string  obj_file_name,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Scalar > > &  TC,
std::vector< std::vector< Scalar > > &  N,
std::vector< std::vector< Index > > &  F,
std::vector< std::vector< Index > > &  FTC,
std::vector< std::vector< Index > > &  FN 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readOBJ() [3/7]

template<typename Scalar , typename Index >
bool igl::readOBJ ( FILE *  obj_file,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Scalar > > &  TC,
std::vector< std::vector< Scalar > > &  N,
std::vector< std::vector< Index > > &  F,
std::vector< std::vector< Index > > &  FTC,
std::vector< std::vector< Index > > &  FN,
std::vector< std::tuple< std::string, Index, Index > > &  FM 
)
Parameters
[in,out]obj_filepointer to already opened .obj file (will be closed)

◆ readOBJ() [4/7]

template<typename Scalar , typename Index >
bool igl::readOBJ ( const std::string  obj_file_name,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Index > > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readOBJ() [5/7]

template<typename DerivedV , typename DerivedTC , typename DerivedCN , typename DerivedF , typename DerivedFTC , typename DerivedFN >
bool igl::readOBJ ( const std::string  str,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedTC > &  TC,
Eigen::PlainObjectBase< DerivedCN > &  CN,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedFTC > &  FTC,
Eigen::PlainObjectBase< DerivedFN > &  FN 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Eigen Wrappers. These will return true only if the data is perfectly "rectangular": All faces are the same degree, all have the same number of textures/normals etc.

◆ readOBJ() [6/7]

template<typename DerivedV , typename DerivedF >
bool igl::readOBJ ( const std::string  str,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readOBJ() [7/7]

template<typename DerivedV , typename DerivedI , typename DerivedC >
bool igl::readOBJ ( const std::string  str,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Polygon mesh version.

Parameters
[out]I#I vectorized list of polygon corner indices into rows of some matrix V
[out]C#P+1 list of cumulative polygon sizes so that C(i+1)-C(i) = size of the ith polygon, and so I(C(i)) through I(C(i+1)-1) are the indices of the ith polygon

◆ readOFF() [1/4]

template<typename Scalar , typename Index >
bool igl::readOFF ( const std::string  off_file_name,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Index > > &  F,
std::vector< std::vector< Scalar > > &  N,
std::vector< std::vector< Scalar > > &  C 
)

Read a mesh from an ascii OFF file, filling in vertex positions, normals and texture coordinates.

Mesh may have faces of any number of degree

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Indextype for indices (will be read as int and cast to Index)
Parameters
[in]strpath to .obj file
[out]Vdouble matrix of vertex positions #V by 3
[out]F#F list of face indices into vertex positions
[out]Nlist of vertex normals #V by 3
[out]Clist of rgb color values per vertex #V by 3
Returns
true on success, false on errors

◆ readOFF() [2/4]

template<typename DerivedV , typename DerivedF >
bool igl::readOFF ( const std::string  str,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readOFF() [3/4]

template<typename DerivedV , typename DerivedF >
bool igl::readOFF ( const std::string  str,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedV > &  N 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readOFF() [4/4]

template<typename Scalar , typename Index >
bool igl::readOFF ( FILE *  off_file,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Index > > &  F,
std::vector< std::vector< Scalar > > &  N,
std::vector< std::vector< Scalar > > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in,out]off_filepointer to already open .off file (will be closed)

◆ readPLY() [1/7]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV , typename DerivedVD , typename DerivedFD , typename DerivedED >
bool igl::readPLY ( std::istream &  ply_stream,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedF > &  E,
Eigen::PlainObjectBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedUV > &  UV,
Eigen::PlainObjectBase< DerivedVD > &  VD,
std::vector< std::string > &  Vheader,
Eigen::PlainObjectBase< DerivedFD > &  FD,
std::vector< std::string > &  Fheader,
Eigen::PlainObjectBase< DerivedED > &  ED,
std::vector< std::string > &  Eheader,
std::vector< std::string > &  comments 
)

Read triangular mesh from ply file, filling in vertex positions, normals and texture coordinates, if available also read additional properties associated with vertex,faces and edges and file comments.

Template Parameters
Derived*from Eigen matrix parameters
Parameters
[in]ply_streamply file input stream
[out]V(#V,3) matrix of vertex positions
[out]F(#F,3) list of face indices into vertex positions
[out]E(#E,2) list of edge indices into vertex positions
[out]N(#V,3) list of normals
[out]UV(#V,2) list of texture coordinates
[out]VD(#V,*) additional vertex data
[out]Vheader(#V) list of vertex data headers
[out]FD(#F,*) additional face data
[out]Fheader(#F) list of face data headers
[out]ED(#E,*) additional edge data
[out]Eheader(#E) list of edge data headers
[out]comments(*) file comments
Returns
true on success, false on errors
Note
Unlike previous versions, all matrices are left untouched if they are not read from the file.

◆ readPLY() [2/7]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV , typename DerivedVD , typename DerivedFD , typename DerivedED >
bool igl::readPLY ( const std::string &  ply_file,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedUV > &  UV,
Eigen::PlainObjectBase< DerivedVD > &  VD,
std::vector< std::string > &  VDheader,
Eigen::PlainObjectBase< DerivedFD > &  FD,
std::vector< std::string > &  FDheader,
Eigen::PlainObjectBase< DerivedED > &  ED,
std::vector< std::string > &  EDheader,
std::vector< std::string > &  comments 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]ply_fileply file name

◆ readPLY() [3/7]

template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedUV , typename DerivedVD >
bool igl::readPLY ( const std::string &  filename,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedUV > &  UV,
Eigen::PlainObjectBase< DerivedVD > &  VD,
std::vector< std::string > &  Vheader 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readPLY() [4/7]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV >
bool igl::readPLY ( const std::string &  filename,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedUV > &  UV 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readPLY() [5/7]

template<typename DerivedV , typename DerivedF >
bool igl::readPLY ( const std::string &  filename,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readPLY() [6/7]

template<typename DerivedV , typename DerivedF , typename DerivedE >
bool igl::readPLY ( const std::string &  filename,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readPLY() [7/7]

template<typename DerivedV , typename DerivedF >
bool igl::readPLY ( FILE *  fp,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in,out]fppointer to ply file (will be closed)

◆ readSTL() [1/3]

template<typename DerivedV , typename DerivedF , typename DerivedN >
bool igl::readSTL ( std::istream &  input,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedN > &  N 
)

Read a mesh from an ascii/binary stl file.

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Parameters
[in]filenamepath to .stl file
[out]Vdouble matrix of vertex positions #V*3 by 3
[out]Findex matrix of triangle indices #F by 3
[out]Ndouble matrix of surface normals #F by 3
Returns
true on success, false on errors

Example

bool success = readSTL(filename,temp_V,F,N);
remove_duplicate_vertices(temp_V,0,V,SVI,SVJ);
for_each(F.data(),F.data()+F.size(),[&SVJ](int & f){f=SVJ(f);});
writeOBJ("Downloads/cat.obj",V,F); 

◆ readSTL() [2/3]

template<typename TypeV , typename TypeF , typename TypeN >
bool igl::readSTL ( std::istream &  input,
std::vector< std::array< TypeV, 3 > > &  V,
std::vector< std::array< TypeF, 3 > > &  F,
std::vector< std::array< TypeN, 3 > > &  N 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readSTL() [3/3]

template<typename DerivedV , typename DerivedF , typename DerivedN >
bool igl::readSTL ( FILE *  fp,
Eigen::PlainObjectBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedN > &  N 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in,out]fppointer to ply file (will be closed)

◆ readTGF() [1/3]

bool igl::readTGF ( const std::string  tgf_filename,
std::vector< std::vector< double > > &  C,
std::vector< std::vector< int > > &  E,
std::vector< int > &  P,
std::vector< std::vector< int > > &  BE,
std::vector< std::vector< int > > &  CE,
std::vector< std::vector< int > > &  PE 
)

Read a graph from a .tgf file.

Input: filename .tgf file name Output: V # vertices by 3 list of vertex positions E # edges by 2 list of edge indices P # point-handles list of point handle indices BE # bone-edges by 2 list of bone-edge indices CE # cage-edges by 2 list of cage-edge indices PE # pseudo-edges by 2 list of pseudo-edge indices

Assumes that graph vertices are 3 dimensional

◆ readTGF() [2/3]

bool igl::readTGF ( const std::string  tgf_filename,
Eigen::MatrixXd &  C,
Eigen::MatrixXi &  E,
Eigen::VectorXi &  P,
Eigen::MatrixXi &  BE,
Eigen::MatrixXi &  CE,
Eigen::MatrixXi &  PE 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readTGF() [3/3]

bool igl::readTGF ( const std::string  tgf_filename,
Eigen::MatrixXd &  C,
Eigen::MatrixXi &  E 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ readWRL() [1/2]

template<typename Scalar , typename Index >
bool igl::readWRL ( const std::string  wrl_file_name,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Index > > &  F 
)

Read a mesh from an ascii wrl file, filling in vertex positions and face indices of the first model.

Mesh may have faces of any number of degree

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Indextype for indices (will be read as int and cast to Index)
Parameters
[in]strpath to .wrl file
[out]Vdouble matrix of vertex positions #V by 3
[out]F#F list of face indices into vertex positions
Returns
true on success, false on errors

◆ readWRL() [2/2]

template<typename Scalar , typename Index >
bool igl::readWRL ( FILE *  wrl_file,
std::vector< std::vector< Scalar > > &  V,
std::vector< std::vector< Index > > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in,out]wrl_filepointer to already opened .wrl file (will be closed)

◆ redux()

template<typename AType , typename Func , typename DerivedB >
void igl::redux ( const Eigen::SparseMatrix< AType > &  A,
const int  dim,
const Func &  func,
Eigen::PlainObjectBase< DerivedB > &  B 
)
inline

Perform reductions on the rows or columns of a SparseMatrix.

This is similar to DenseBase::redux, but different in two important ways:

  1. (unstored) Zeros are not "visited", however if the first element in the column/row does not appear in the first row/column then the reduction is assumed to start with zero. In this way, "any", "all", "count"(non-zeros) work as expected. This means it is not possible to use this to count (implicit) zeros.
  2. This redux is more powerful in the sense that A and B may have different types. This makes it possible to count the number of non-zeros in a SparseMatrix<bool> A into a VectorXi B.
Parameters
[in]Am by n sparse matrix
[in]dimdimension along which to sum (1 or 2)
[in]funcfunction handle with the prototype X(Y a, I i, J j, Z b) where a is the running value, b is A(i,j)
[out]Sn-long sparse vector (if dim == 1) or m-long sparse vector (if dim == 2)
See also
for_each

◆ remesh_along_isoline() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedS , typename DerivedU , typename DerivedG , typename DerivedJ , typename BCtype , typename DerivedSU , typename DerivedL >
void igl::remesh_along_isoline ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedS > &  S,
const typename DerivedS::Scalar  val,
Eigen::PlainObjectBase< DerivedU > &  U,
Eigen::PlainObjectBase< DerivedG > &  G,
Eigen::PlainObjectBase< DerivedSU > &  SU,
Eigen::PlainObjectBase< DerivedJ > &  J,
Eigen::SparseMatrix< BCtype > &  BC,
Eigen::PlainObjectBase< DerivedL > &  L 
)

Given a triangle mesh and a scalar field, remesh so that a given isovalue of the scalar field follows (new) edges of the output mesh.

Effectively running "marching triangles" on mesh, but not in any coherent order. The output mesh should be as manifold as the input.

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by 3 list of mesh triangle indices into V
[in]S#V by 1 list of scalar field
[in]valvalue of S to remesh along
[out]U#U by dim list of mesh vertex positions #U>=#V
[out]G#G by 3 list of mesh triangle indices into U, #G>=#F
[out]SU#U list of scalar field values over new mesh
[out]J#G list of indices into F revealing birth triangles
[out]BC#U by #V sparse matrix of barycentric coordinates so that U = BC*V
[out]L#G list of bools whether scalar field in triangle below or above val

◆ remesh_along_isoline() [2/2]

template<typename DerivedF , typename DerivedS , typename DerivedG , typename DerivedJ , typename BCtype , typename DerivedSU , typename DerivedL >
void igl::remesh_along_isoline ( const int  n,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedS > &  S,
const typename DerivedS::Scalar  val,
Eigen::PlainObjectBase< DerivedG > &  G,
Eigen::PlainObjectBase< DerivedSU > &  SU,
Eigen::PlainObjectBase< DerivedJ > &  J,
Eigen::SparseMatrix< BCtype > &  BC,
Eigen::PlainObjectBase< DerivedL > &  L 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]nnumber of vertices (#V)

◆ remove_duplicate_vertices() [1/2]

template<typename DerivedV , typename DerivedSV , typename DerivedSVI , typename DerivedSVJ >
void igl::remove_duplicate_vertices ( const Eigen::MatrixBase< DerivedV > &  V,
const double  epsilon,
Eigen::PlainObjectBase< DerivedSV > &  SV,
Eigen::PlainObjectBase< DerivedSVI > &  SVI,
Eigen::PlainObjectBase< DerivedSVJ > &  SVJ 
)

Remove duplicate vertices upto a uniqueness tolerance (epsilon)

Parameters
[in]V#V by dim list of vertex positions
[in]epsilonuniqueness tolerance used coordinate-wise: 1e0 --> integer match, 1e-1 --> match up to first decimal, ... , 0 --> exact match.
[out]SV#SV by dim new list of vertex positions
[out]SVI#SV by 1 list of indices so SV = V(SVI,:)
[out]SVJ#V by 1 list of indices so V = SV(SVJ,:)

◆ remove_duplicate_vertices() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedSV , typename DerivedSVI , typename DerivedSVJ , typename DerivedSF >
void igl::remove_duplicate_vertices ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const double  epsilon,
Eigen::PlainObjectBase< DerivedSV > &  SV,
Eigen::PlainObjectBase< DerivedSVI > &  SVI,
Eigen::PlainObjectBase< DerivedSVJ > &  SVJ,
Eigen::PlainObjectBase< DerivedSF > &  SF 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Wrapper that also remaps given faces (F) --> (SF) so that SF index SV

Parameters
[out]SF#F by dim list of face indices into SV

◆ remove_unreferenced() [1/3]

template<typename DerivedV , typename DerivedF , typename DerivedNV , typename DerivedNF , typename DerivedI , typename DerivedJ >
void igl::remove_unreferenced ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedNV > &  NV,
Eigen::PlainObjectBase< DerivedNF > &  NF,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedJ > &  J 
)

Remove unreferenced vertices from V, updating F accordingly.

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by ss list of simplices (Values of -1 are quitely skipped)
[out]NV#NV by dim list of mesh vertex positions
[out]NF#NF by ss list of simplices
[out]I#V by 1 list of indices such that: NF = IM(F) and NT = IM(T) and V(find(IM<=size(NV,1)),:) = NV
[out]J#NV by 1 list, such that NV = V(J,:)

◆ remove_unreferenced() [2/3]

template<typename DerivedV , typename DerivedF , typename DerivedNV , typename DerivedNF , typename DerivedI >
void igl::remove_unreferenced ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedNV > &  NV,
Eigen::PlainObjectBase< DerivedNF > &  NF,
Eigen::PlainObjectBase< DerivedI > &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ remove_unreferenced() [3/3]

template<typename DerivedF , typename DerivedI , typename DerivedJ >
void igl::remove_unreferenced ( const size_t  n,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedJ > &  J 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]nnumber of vertices (possibly greater than F.maxCoeff()+1)

◆ repdiag() [1/3]

template<typename T >
void igl::repdiag ( const Eigen::SparseMatrix< T > &  A,
const int  d,
Eigen::SparseMatrix< T > &  B 
)

Repeat a matrix along the diagonal a certain number of times, so that if A is a m by n matrix and we want to repeat along the diagonal d times, we get a m*d by n*d matrix B such that: B( (k*m+1):(k*m+1+m-1), (k*n+1):(k*n+1+n-1)) = A for k from 0 to d-1.

Parameters
[in]Am by n matrix we are repeating along the diagonal.
[in]dnumber of times to repeat A along the diagonal
[out]Bm*d by n*d matrix with A repeated d times along the diagonal, will be dense or sparse to match A

◆ repdiag() [2/3]

template<typename T >
void igl::repdiag ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  A,
const int  d,
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  B 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ repdiag() [3/3]

template<class Mat >
Mat igl::repdiag ( const Mat &  A,
const int  d 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ repmat() [1/2]

template<typename DerivedA , typename DerivedB >
void igl::repmat ( const Eigen::MatrixBase< DerivedA > &  A,
const int  r,
const int  c,
Eigen::PlainObjectBase< DerivedB > &  B 
)

Replicate and tile a matrix.

Template Parameters
Tshould be a eigen matrix primitive type like int or double
Parameters
[in]Am by n input matrix
[in]rnumber of row-direction copies
[in]cnumber of col-direction copies
[out]Br*m by c*n output matrix
Note
At least for Dense matrices this is replaced by replicate e.g., dst = src.replicate(n,m); http://forum.kde.org/viewtopic.php?f=74&t=90876#p173517

◆ repmat() [2/2]

template<typename T , int majorType>
void igl::repmat ( const Eigen::SparseMatrix< T, majorType > &  A,
const int  r,
const int  c,
Eigen::SparseMatrix< T, majorType > &  B 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ resolve_duplicated_faces()

template<typename DerivedF1 , typename DerivedF2 , typename DerivedJ >
void igl::resolve_duplicated_faces ( const Eigen::MatrixBase< DerivedF1 > &  F1,
Eigen::PlainObjectBase< DerivedF2 > &  F2,
Eigen::PlainObjectBase< DerivedJ > &  J 
)

Resolve duplicated faces according to the following rules per unique face:

  1. If the number of positively oriented faces equals the number of negatively oriented faces, remove all duplicated faces at this triangle.
  2. If the number of positively oriented faces equals the number of negatively oriented faces plus 1, keeps one of the positively oriented face.
  3. If the number of positively oriented faces equals the number of negatively oriented faces minus 1, keeps one of the negatively oriented face.
  4. If the number of postively oriented faces differ with the number of negativley oriented faces by more than 1, the mesh is not orientable. An exception will be thrown.
Parameters
[in]F1#F1 by 3 array of input faces.
[out]F2#F2 by 3 array of output faces without duplicated faces.
[out]J#F2 list of indices into F1.

◆ rgb_to_hsv() [1/2]

template<typename R , typename H >
void igl::rgb_to_hsv ( const R *  rgb,
H *  hsv 
)

Convert RGB to HSV.

Parameters
[in]rgbrgb triplet in (0,1)³
[out]hsvhsv triplet in (0,360),(0,1),(0,1)

◆ rgb_to_hsv() [2/2]

template<typename DerivedR , typename DerivedH >
void igl::rgb_to_hsv ( const Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedH > &  H 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]R#R by 3 list of rgb triplets in (0,1)ⁿˣ³
[out]H#R by 3 list of hsv triplets in [(0,360),(0,1),(0,1)]ⁿ

◆ rigid_alignment()

template<typename DerivedX , typename DerivedP , typename DerivedN , typename DerivedR , typename Derivedt >
void igl::rigid_alignment ( const Eigen::MatrixBase< DerivedX > &  X,
const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
Eigen::PlainObjectBase< DerivedR > &  R,
Eigen::PlainObjectBase< Derivedt > &  t 
)

Find the rigid transformation that best aligns the 3D points X to their corresponding points P with associated normals N.

 min       ‖(X*R+t-P)'N‖²
 R∈SO(3)
 t∈R³
Parameters
[in]X#X by 3 list of query points
[in]P#X by 3 list of corresponding (e.g., closest) points
[in]N#X by 3 list of unit normals for each row in P
[out]R3 by 3 rotation matrix
[out]t1 by 3 translation vector
See also
icp

◆ rotate_by_quat()

template<typename Q_type >
void igl::rotate_by_quat ( const Q_type *  v,
const Q_type *  q,
Q_type *  out 
)

Compute rotation of a given vector/point by a quaternion A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), such that q = x*i + y*j + z*k + w.

Parameters
[in]vinput 3d point/vector
[in]qinput quaternion
[out]outresult of rotation, allowed to be same as v

◆ rotate_vectors()

Eigen::MatrixXd igl::rotate_vectors ( const Eigen::MatrixXd &  V,
const Eigen::VectorXd &  A,
const Eigen::MatrixXd &  B1,
const Eigen::MatrixXd &  B2 
)

Rotate the vectors V by A radians on the tangent plane spanned by B1 and B2.

Parameters
[in]V#V by 3 eigen Matrix of vectors
[in]A#V eigen vector of rotation angles or a single angle to be applied to all vectors
[in]B1#V by 3 eigen Matrix of base vector 1
[in]B2#V by 3 eigen Matrix of base vector 2
Returns
the rotated vectors

◆ rotation_matrix_from_directions()

template<typename Scalar >
Eigen::Matrix< Scalar, 3, 3 > igl::rotation_matrix_from_directions ( const Eigen::Matrix< Scalar, 3, 1 >  v0,
const Eigen::Matrix< Scalar, 3, 1 >  v1 
)

Given 2 vectors centered on origin calculate the rotation matrix from first to the second.

Parameters
[in]v03D column vector
[in]v13D column vector
[out]3by 3 rotation matrix that takes v0 to v1

◆ round() [1/2]

template<typename DerivedX >
DerivedX igl::round ( const DerivedX  r)

Round a scalar value.

Parameters
[in]xnumber
Returns
x rounded to integer

◆ round() [2/2]

template<typename DerivedX , typename DerivedY >
void igl::round ( const Eigen::PlainObjectBase< DerivedX > &  X,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

Round a given matrix to nearest integers.

Parameters
[in]Xm by n matrix of scalars
[out]Ym by n matrix of rounded integers

◆ rows_to_matrix()

template<class Row , class Mat >
bool igl::rows_to_matrix ( const std::vector< Row > &  V,
Mat &  M 
)

Convert a list (std::vector) of row vectors of the same length to a matrix.

Template Parameters
Rowrow vector type, must implement: .size()
MatMatrix type, must implement: .resize(m,n) .row(i) = Row
Parameters
[in]Va m-long list of vectors of size n
[out]Man m by n matrix
Returns
true on success, false on errors

◆ sample_edges()

void igl::sample_edges ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  E,
const int  k,
Eigen::MatrixXd &  S 
)

Compute k extra points along each edge in E defined over vertices of V.

Parameters
[in]Vvertices over which edges are defined, # vertices by dim
[in]Eedge list, # edges by 2
[in]knumber of extra samples to be computed along edge not including start and end points
[out]Ssampled vertices, size less than # edges * (2+k) by dim always begins with V so that E is also defined over S

◆ scalar_to_cr_vector_gradient() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarG >
void igl::scalar_to_cr_vector_gradient ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarG > &  G 
)

Computes the gradient matrix with hat functions on the right, and vector CR functions on the left.

See Oded Stein, Max Wardetzky, Alec Jacobson, Eitan Grinspun, 2020. "A Simple Discretization of the Vector Dirichlet Energy"

Parameters
[in]V#V by dim list of vertex positions
[in]F#F by 3/4 list of triangle/tetrahedron indices
[in]E#F by 3 a mapping from each halfedge to each edge
[in]oE#F by 3 the orientation (e.g., -1 or 1) of each halfedge
[out]G2*|HE| by #V gradient matrix

◆ scalar_to_cr_vector_gradient() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedOE , typename ScalarG >
void igl::scalar_to_cr_vector_gradient ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarG > &  G 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]E#F by 3 a mapping from each halfedge to each edge
[out]oE#F by 3 the orientation (e.g., -1 or 1) of each halfedge

◆ scalar_to_cr_vector_gradient_intrinsic() [1/2]

template<typename DerivedF , typename DerivedL_sq , typename DeriveddA , typename DerivedE , typename DerivedOE , typename ScalarG >
void igl::scalar_to_cr_vector_gradient_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedL_sq > &  l_sq,
const Eigen::MatrixBase< DeriveddA > &  dA,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarG > &  G 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

intrinsic version.

Parameters
[in]l_sq#F by 3 list of squared edge lengths of each halfedge
[in]dA#F list of double areas

include/igl/scalar_to_cr_vector_gradient.h

◆ scalar_to_cr_vector_gradient_intrinsic() [2/2]

template<typename DerivedF , typename DerivedL_sq , typename DerivedE , typename DerivedOE , typename ScalarG >
void igl::scalar_to_cr_vector_gradient_intrinsic ( const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedL_sq > &  l_sq,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedOE > &  oE,
Eigen::SparseMatrix< ScalarG > &  G 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. include/igl/scalar_to_cr_vector_gradient.h.

◆ screen_space_selection() [1/3]

template<typename DerivedV , typename DerivedF , typename DerivedM , typename DerivedN , typename DerivedO , typename Ltype , typename DerivedW , typename Deriveda >
void igl::screen_space_selection ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const igl::AABB< DerivedV, 3 > &  tree,
const Eigen::MatrixBase< DerivedM > &  model,
const Eigen::MatrixBase< DerivedN > &  proj,
const Eigen::MatrixBase< DerivedO > &  viewport,
const std::vector< Eigen::Matrix< Ltype, 1, 2 > > &  L,
Eigen::PlainObjectBase< DerivedW > &  W,
Eigen::PlainObjectBase< Deriveda > &  and_visible 
)

Given a mesh, a camera determine which points are inside of a given 2D screen space polygon culling points based on self-occlusion.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh triangle indices into rows of V
[in]treeprecomputed bounding volume heirarchy
[in]model4 by 4 camera model-view matrix
[in]proj4 by 4 camera projection matrix (perspective or orthoraphic)
[in]viewport4-vector containing camera viewport
[in]L#L by 2 list of 2D polygon vertices (in order)
[out]W#V by 1 list of winding numbers (|W|>0.5 indicates inside)
[out]and_visible#V by 1 list of visibility values (only correct for vertices with |W|>0.5)

◆ screen_space_selection() [2/3]

template<typename DerivedV , typename DerivedM , typename DerivedN , typename DerivedO , typename Ltype , typename DerivedW >
void igl::screen_space_selection ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedM > &  model,
const Eigen::MatrixBase< DerivedN > &  proj,
const Eigen::MatrixBase< DerivedO > &  viewport,
const std::vector< Eigen::Matrix< Ltype, 1, 2 > > &  L,
Eigen::PlainObjectBase< DerivedW > &  W 
)

Given a mesh, a camera determine which points are inside of a given 2D screen space polygon.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]model4 by 4 camera model-view matrix
[in]proj4 by 4 camera projection matrix (perspective or orthoraphic)
[in]viewport4-vector containing camera viewport
[in]L#L by 2 list of 2D polygon vertices (in order)
[out]W#V by 1 list of winding numbers (|W|>0.5 indicates inside)

◆ screen_space_selection() [3/3]

template<typename DerivedV , typename DerivedM , typename DerivedN , typename DerivedO , typename DerivedP , typename DerivedE , typename DerivedW >
void igl::screen_space_selection ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedM > &  model,
const Eigen::MatrixBase< DerivedN > &  proj,
const Eigen::MatrixBase< DerivedO > &  viewport,
const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedE > &  E,
Eigen::PlainObjectBase< DerivedW > &  W 
)

Given a mesh, a camera determine which points are inside of a given 2D screen space polygon.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]model4 by 4 camera model-view matrix
[in]proj4 by 4 camera projection matrix (perspective or orthoraphic)
[in]viewport4-vector containing camera viewport
[in]P#P by 2 list of screen space polygon vertices
[in]E#E by 2 list of screen space edges as indices into rows of P
[out]W#V by 1 list of winding numbers (|W|>0.5 indicates inside)

◆ seam_edges()

template<typename DerivedV , typename DerivedTC , typename DerivedF , typename DerivedFTC , typename Derivedseams , typename Derivedboundaries , typename Derivedfoldovers >
void igl::seam_edges ( const Eigen::PlainObjectBase< DerivedV > &  V,
const Eigen::PlainObjectBase< DerivedTC > &  TC,
const Eigen::PlainObjectBase< DerivedF > &  F,
const Eigen::PlainObjectBase< DerivedFTC > &  FTC,
Eigen::PlainObjectBase< Derivedseams > &  seams,
Eigen::PlainObjectBase< Derivedboundaries > &  boundaries,
Eigen::PlainObjectBase< Derivedfoldovers > &  foldovers 
)

Finds all UV-space boundaries of a mesh.

Parameters
[in]V#V by dim list of positions of the input mesh.
[in]TC#TC by 2 list of 2D texture coordinates of the input mesh
[in]F#F by 3 list of triange indices into V representing a manifold-with-boundary triangle mesh
[in]FTC#F by 3 list of indices into TC for each corner
[out]seamsEdges 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 ]
[out]boundariesEdges 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 ]
[out]foldoversEdges 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 ]

◆ segment_segment_intersect()

template<typename DerivedSource , typename DerivedDir >
bool igl::segment_segment_intersect ( const Eigen::MatrixBase< DerivedSource > &  p,
const Eigen::MatrixBase< DerivedDir > &  r,
const Eigen::MatrixBase< DerivedSource > &  q,
const Eigen::MatrixBase< DerivedDir > &  s,
double &  t,
double &  u,
double  eps = 1e-6 
)

Determine whether two line segments A,B intersect.

A: p + t*r : t \in [0,1] B: q + u*s : u \in [0,1]

Parameters
[in]p3-vector origin of segment A
[in]r3-vector direction of segment A
[in]q3-vector origin of segment B
[in]s3-vector direction of segment B
[out]tscalar point of intersection along segment A, t \in [0,1]
[out]uscalar point of intersection along segment B, u \in [0,1]
[in]epsprecision
Returns
true if intersection

◆ serialize() [1/3]

template<typename T >
bool igl::serialize ( const T &  obj,
const std::string &  filename 
)
inline

◆ serialize() [2/3]

template<typename T >
bool igl::serialize ( const T &  obj,
const std::string &  objectName,
const std::string &  filename,
bool  overwrite = false 
)
inline

◆ serialize() [3/3]

template<typename T >
bool igl::serialize ( const T &  obj,
const std::string &  objectName,
std::vector< char > &  buffer 
)
inline

◆ deserialize() [1/3]

template<typename T >
bool igl::deserialize ( T &  obj,
const std::string &  filename 
)
inline

◆ deserialize() [2/3]

template<typename T >
bool igl::deserialize ( T &  obj,
const std::string &  objectName,
const std::string &  filename 
)
inline

◆ deserialize() [3/3]

template<typename T >
bool igl::deserialize ( T &  obj,
const std::string &  objectName,
const std::vector< char > &  buffer 
)
inline

◆ serializer() [1/3]

template<typename T >
bool igl::serializer ( bool  serialize,
T &  obj,
const std::string &  filename 
)
inline

◆ serializer() [2/3]

template<typename T >
bool igl::serializer ( bool  serialize,
T &  obj,
const std::string &  objectName,
const std::string &  filename,
bool  overwrite = false 
)
inline

◆ serializer() [3/3]

template<typename T >
bool igl::serializer ( bool  serialize,
T &  obj,
const std::string &  objectName,
std::vector< char > &  buffer 
)
inline

◆ setdiff()

template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedIA >
void igl::setdiff ( const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedIA > &  IA 
)

Set difference of elements of matrices.

Parameters
[in]Am-long vector of indices
[in]Bn-long vector of indices
[out]C(k<=m)-long vector of unique elements appearing in A but not in B
[out]IA(k<=m)-long list of indices into A so that C = A(IA)

◆ setunion()

template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedIA , typename DerivedIB >
void igl::setunion ( const Eigen::DenseBase< DerivedA > &  A,
const Eigen::DenseBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedIA > &  IA,
Eigen::PlainObjectBase< DerivedIB > &  IB 
)

Union of elements of matrices (like matlab's union)

Parameters
[in]Am-long vector of indices
[in]Bn-long vector of indices
[out]C(k>=m)-long vector of unique elements appearing in A and/or B
[out]IA(<k>=m)-long list of indices into A so that C = sort([A(IA);B(IB)])
[out]IB(<k>=m)-long list of indices into B so that C = sort([A(IA);B(IB)])

◆ setxor()

template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedIA , typename DerivedIB >
void igl::setxor ( const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedIA > &  IA,
Eigen::PlainObjectBase< DerivedIB > &  IB 
)

Set xor of elements of matrices.

Parameters
[in]Am-long vector of indices
[in]Bn-long vector of indices
[out]C(k<=m)-long vector of unique elements appearing in A but not in B or B but not in A
[out]IA(<k<=m)-long list of indices into A so that C = sort([A(IA);B(IB)])
[out]IB(<k<=m)-long list of indices into B so that C = sort([A(IA);B(IB)])

◆ shape_diameter_function() [1/4]

template<typename DerivedP , typename DerivedN , typename DerivedS >
void igl::shape_diameter_function ( const std::function< double(const Eigen::Vector3f &, const Eigen::Vector3f &) > &  shoot_ray,
const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
const int  num_samples,
Eigen::PlainObjectBase< DerivedS > &  S 
)

Compute shape diamater function per given point.

In the parlence of the paper "Consistent Mesh Partitioning and Skeletonisation using the Shape Diameter Function" [Shapiro et al. 2008], this implementation uses a 180° cone and a uniform average (not a average weighted by inverse angles).

Parameters
[in]shoot_rayfunction handle that outputs hits of a given ray against a mesh (embedded in function handles as captured variable/data)
[in]P#P by 3 list of origin points
[in]N#P by 3 list of origin normals
[out]S#P list of shape diamater function values between bounding box
[out]diagonal(perfect sphere) and 0 (perfect needle hook)

◆ shape_diameter_function() [2/4]

template<typename DerivedV , int DIM, typename DerivedF , typename DerivedP , typename DerivedN , typename DerivedS >
void igl::shape_diameter_function ( const igl::AABB< DerivedV, DIM > &  aabb,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
const int  num_samples,
Eigen::PlainObjectBase< DerivedS > &  S 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]AABBaxis-aligned bounding box hierarchy around (V,F)
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh face indices into V

◆ shape_diameter_function() [3/4]

template<typename DerivedV , typename DerivedF , typename DerivedP , typename DerivedN , typename DerivedS >
void igl::shape_diameter_function ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedN > &  N,
const int  num_samples,
Eigen::PlainObjectBase< DerivedS > &  S 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ shape_diameter_function() [4/4]

template<typename DerivedV , typename DerivedF , typename DerivedS >
void igl::shape_diameter_function ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const bool  per_face,
const int  num_samples,
Eigen::PlainObjectBase< DerivedS > &  S 
)
Parameters
[in]per_facewhether to compute per face (S is #F by 1) or per vertex (S is #V by 1)

◆ shapeup_identity_projection()

bool igl::shapeup_identity_projection ( const Eigen::PlainObjectBase< Eigen::MatrixXd > &  P,
const Eigen::PlainObjectBase< Eigen::VectorXi > &  SC,
const Eigen::PlainObjectBase< Eigen::MatrixXi > &  S,
Eigen::PlainObjectBase< Eigen::MatrixXd > &  projP 
)

This projection does nothing but render points into projP.

Mostly used for "echoing" the global step

Parameters
[in]P#P by 3 set of points, either the initial solution, or from previous iteration.
[in]SC#Set by 1 cardinalities of sets in S
[in]S#Sets by max(SC) independent sets where the local projection applies. Values beyond column SC(i)-1 in row S(i,:) are "don't care"
[out]projP#S by 3*max(SC) in format xyzxyzxyz, where the projected points correspond to each set in S in the same order.
Returns
Return value appears to be ignored

include/igl/shapeup.h

◆ shapeup_regular_face_projection()

bool igl::shapeup_regular_face_projection ( const Eigen::PlainObjectBase< Eigen::MatrixXd > &  P,
const Eigen::PlainObjectBase< Eigen::VectorXi > &  SC,
const Eigen::PlainObjectBase< Eigen::MatrixXi > &  S,
Eigen::PlainObjectBase< Eigen::MatrixXd > &  projP 
)

the projection assumes that the sets are vertices of polygons in cyclic order

Parameters
[in]P#P by 3 set of points, either the initial solution, or from previous iteration.
[in]SC#Set by 1 cardinalities of sets in S
[in]S#Sets by max(SC) independent sets where the local projection applies. Values beyond column SC(i)-1 in row S(i,:) are "don't care"
[out]projP#S by 3*max(SC) in format xyzxyzxyz, where the projected points correspond to each set in S in the same order.
Returns
Return value appears to be ignored

include/igl/shapeup.h

◆ shapeup_precomputation()

template<typename DerivedP , typename DerivedSC , typename DerivedS , typename Derivedw >
bool igl::shapeup_precomputation ( const Eigen::PlainObjectBase< DerivedP > &  P,
const Eigen::PlainObjectBase< DerivedSC > &  SC,
const Eigen::PlainObjectBase< DerivedS > &  S,
const Eigen::PlainObjectBase< DerivedS > &  E,
const Eigen::PlainObjectBase< DerivedSC > &  b,
const Eigen::PlainObjectBase< Derivedw > &  wShape,
const Eigen::PlainObjectBase< Derivedw > &  wSmooth,
ShapeupData sudata 
)

This function precomputation the necessary matrices for the ShapeUp process, and prefactorizes them.

Parameters
[in]P#P by 3 point positions
[in]SC#Set by 1 cardinalities of sets in S
[in]S#Sets by max(SC) independent sets where the local projection applies. Values beyond column SC(i)-1 in row S(i,:) are "don't care"
[in]E#E by 2 the "edges" of the set P; used for the smoothness energy.
[in]b#b by 1 boundary (fixed) vertices from P.
[in]wShape#Set by 1
[in]wSmooth#b by 1 weights for constraints from S and positional constraints (used in the global step)
[out]sudatastruct ShapeupData the data necessary to solve the system in shapeup_solve
Returns
true if precomputation was successful, false otherwise

include/igl/shapeup.h

◆ shapeup_solve()

template<typename DerivedP , typename DerivedSC , typename DerivedS >
bool igl::shapeup_solve ( const Eigen::PlainObjectBase< DerivedP > &  bc,
const std::function< bool(const Eigen::PlainObjectBase< DerivedP > &, const Eigen::PlainObjectBase< DerivedSC > &, const Eigen::PlainObjectBase< DerivedS > &, Eigen::PlainObjectBase< DerivedP > &)> &  local_projection,
const Eigen::PlainObjectBase< DerivedP > &  P0,
const ShapeupData sudata,
const bool  quietIterations,
Eigen::PlainObjectBase< DerivedP > &  P 
)

This function solve the shapeup project optimization.

shapeup_precompute must be called before with the same sudata, or results are unpredictable

Parameters
[in]bc#b by 3 fixed point values corresonding to "b" in sudata
[in]local_projectionfunction pointer taking (P,SC,S,projP), where the first three parameters are as defined, and "projP" is the output, as a #S by 3*max(SC) function in format xyzxyzxyz, and where it returns the projected points corresponding to each set in S in the same order. NOTE: the input values in P0 don't need to correspond to prescribed values in bc; the iterations will project them automatically (by design).
[in]P0#P by 3 initial solution (point positions)
[in]sudatathe ShapeUpData structure computed in shapeup_precomputation()
[in]quietIterationsflagging if to output iteration information.
[out]Pthe solution to the problem, indices corresponding to P0.
Returns
true if the solver converged, false otherwise.

include/igl/shapeup.h

◆ sharp_edges() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedSE , typename DerivedE , typename DeriveduE , typename DerivedEMAP , typename uE2Etype , typename sharptype >
void igl::sharp_edges ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const typename DerivedV::Scalar  angle,
Eigen::PlainObjectBase< DerivedSE > &  SE,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DeriveduE > &  uE,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP,
std::vector< std::vector< uE2Etype > > &  uE2E,
std::vector< sharptype > &  sharp 
)

Given a mesh, compute sharp edges.

Parameters
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of triangle mesh indices into V
[in]angledihedral angle considered to sharp (e.g., igl::PI * 0.11)
[out]SE#SE by 2 list of edge indices into V
[out]uE#uE by 2 list of unique undirected edges
[out]EMAP#F*3 list of indices into uE, mapping each directed edge to unique undirected edge so that uE(EMAP(f+#F*c)) is the unique edge corresponding to E.row(f+#F*c)
[out]uE2E#uE list of lists of indices into E of coexisting edges, so that E.row(uE2E[i][j]) corresponds to uE.row(i) for all j in 0..uE2E[i].size()-1.
[out]sharp#SE list of indices into uE revealing sharp undirected edges

◆ sharp_edges() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedSE >
void igl::sharp_edges ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const typename DerivedV::Scalar  angle,
Eigen::PlainObjectBase< DerivedSE > &  SE 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ shortest_edge_and_midpoint()

void igl::shortest_edge_and_midpoint ( const int  e,
const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  ,
const Eigen::MatrixXi &  E,
const Eigen::VectorXi &  ,
const Eigen::MatrixXi &  ,
const Eigen::MatrixXi &  ,
double &  cost,
Eigen::RowVectorXd &  p 
)

Cost and placement function compatible with igl::decimate.

The cost of collapsing an edge is its length (prefer to collapse short edges) and the placement strategy for the new vertex is the midpoint of the collapsed edge.

Parameters
[in]eindex into E of edge to be considered for collapse
[in]V#V by dim list of vertex positions
[in]F#F by 3 list of faces (ignored)
[in]E#E by 2 list of edge indices into V
[in]EMAP#F*3 list of half-edges indices into E (ignored)
[in]EF#E by 2 list of edge-face flaps into F (ignored)
[in]EI#E by 2 list of edge-face opposite corners (ignored)
[out]costset to edge length
[out]pplaced point set to edge midpoint

◆ signed_angle()

template<typename DerivedA , typename DerivedB , typename DerivedP >
DerivedA::Scalar igl::signed_angle ( const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< DerivedP > &  P 
)

Compute the signed angle subtended by the oriented 3d triangle (A,B,C) at some point P.

Parameters
[in]A2D position of corner
[in]B2D position of corner
[in]P2D position of query point
Returns
signed angle

◆ signed_distance() [1/2]

template<typename DerivedP , typename DerivedV , typename DerivedF , typename DerivedS , typename DerivedI , typename DerivedC , typename DerivedN >
void igl::signed_distance ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const SignedDistanceType  sign_type,
const typename DerivedV::Scalar  lower_bound,
const typename DerivedV::Scalar  upper_bound,
Eigen::PlainObjectBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedN > &  N 
)

Computes signed distance to a mesh.

Parameters
[in]P#P by (2|3) list of query point positions
[in]V#V by (2|3) list of vertex positions
[in]F#F by ss list of triangle indices, ss should be 3 unless sign_type == SIGNED_DISTANCE_TYPE_UNSIGNED | SIGNED_DISTANCE_TYPE_WINDING_NUMBER
[in]sign_typemethod for computing distance sign S
[in]lower_boundlower bound of distances needed {std::numeric_limits::min}
[in]upper_boundlower bound of distances needed {std::numeric_limits::max}
[out]S#P list of smallest signed distances
[out]I#P list of facet indices corresponding to smallest distances
[out]C#P by (2|3) list of closest points
[out]N#P by (2|3) list of closest normals (only set if sign_type=SIGNED_DISTANCE_TYPE_PSEUDONORMAL)

◆ signed_distance() [2/2]

template<typename DerivedP , typename DerivedV , typename DerivedF , typename DerivedS , typename DerivedI , typename DerivedC , typename DerivedN >
void igl::signed_distance ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const SignedDistanceType  sign_type,
Eigen::PlainObjectBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedN > &  N 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ signed_distance_pseudonormal() [1/4]

template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedVN , typename DerivedEN , typename DerivedEMAP , typename Derivedq >
DerivedV::Scalar igl::signed_distance_pseudonormal ( const AABB< DerivedV, 3 > &  tree,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedFN > &  FN,
const Eigen::MatrixBase< DerivedVN > &  VN,
const Eigen::MatrixBase< DerivedEN > &  EN,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
const Eigen::MatrixBase< Derivedq > &  q 
)

Computes signed distance to mesh using pseudonormal with precomputed AABB tree and edge/vertice normals.

Parameters
[in]treeAABB acceleration tree (see AABB.h)
[in]F#F by 3 list of triangle indices
[in]FN#F by 3 list of triangle normals
[in]VN#V by 3 list of vertex normals (ANGLE WEIGHTING)
[in]EN#E by 3 list of edge normals (UNIFORM WEIGHTING)
[in]EMAP#F*3 mapping edges in F to E
[in]qQuery point
Returns
signed distance to mesh

include/igl/signed_distance.h

◆ signed_distance_pseudonormal() [2/4]

template<typename DerivedP , typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedVN , typename DerivedEN , typename DerivedEMAP , typename DerivedS , typename DerivedI , typename DerivedC , typename DerivedN >
void igl::signed_distance_pseudonormal ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const AABB< DerivedV, 3 > &  tree,
const Eigen::MatrixBase< DerivedFN > &  FN,
const Eigen::MatrixBase< DerivedVN > &  VN,
const Eigen::MatrixBase< DerivedEN > &  EN,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
Eigen::PlainObjectBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedN > &  N 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.include/igl/signed_distance.h.

◆ signed_distance_pseudonormal() [3/4]

template<typename DerivedV , typename DerivedF , typename DerivedFN , typename DerivedVN , typename DerivedEN , typename DerivedEMAP , typename Derivedq , typename Scalar , typename Derivedc , typename Derivedn >
void igl::signed_distance_pseudonormal ( const AABB< DerivedV, 3 > &  tree,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedFN > &  FN,
const Eigen::MatrixBase< DerivedVN > &  VN,
const Eigen::MatrixBase< DerivedEN > &  EN,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
const Eigen::MatrixBase< Derivedq > &  q,
Scalar &  s,
Scalar &  sqrd,
int &  i,
Eigen::PlainObjectBase< Derivedc > &  c,
Eigen::PlainObjectBase< Derivedn > &  n 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]ssign
[out]sqrdsquared distance
[out]iclosest primitive
[out]cclosest point
[out]nnormal

include/igl/signed_distance.h

◆ signed_distance_pseudonormal() [4/4]

template<typename DerivedV , typename DerivedE , typename DerivedEN , typename DerivedVN , typename Derivedq , typename Scalar , typename Derivedc , typename Derivedn >
void igl::signed_distance_pseudonormal ( const AABB< DerivedV, 2 > &  tree,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedEN > &  EN,
const Eigen::MatrixBase< DerivedVN > &  VN,
const Eigen::MatrixBase< Derivedq > &  q,
Scalar &  s,
Scalar &  sqrd,
int &  i,
Eigen::PlainObjectBase< Derivedc > &  c,
Eigen::PlainObjectBase< Derivedn > &  n 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ signed_distance_winding_number() [1/3]

template<typename DerivedV , typename DerivedF , typename Derivedq >
DerivedV::Scalar igl::signed_distance_winding_number ( const AABB< DerivedV, 3 > &  tree,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const igl::WindingNumberAABB< Derivedq, DerivedV, DerivedF > &  hier,
const Eigen::MatrixBase< Derivedq > &  q 
)

Computes signed distance to mesh using winding number with precomputed AABB.

Parameters
[in]treeAABB acceleration tree (see cgal/point_mesh_squared_distance.h)
[in]hierWinding number evaluation hierarchy
[in]qQuery point
Returns
signed distance to mesh

include/igl/signed_distance.h

◆ signed_distance_winding_number() [2/3]

template<typename DerivedV , typename DerivedF , typename Derivedq , typename Scalar , typename Derivedc >
void igl::signed_distance_winding_number ( const AABB< DerivedV, 3 > &  tree,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const igl::WindingNumberAABB< Derivedq, DerivedV, DerivedF > &  hier,
const Eigen::MatrixBase< Derivedq > &  q,
Scalar &  s,
Scalar &  sqrd,
int &  i,
Eigen::PlainObjectBase< Derivedc > &  c 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]ssign
[out]sqrdsquared distance
[out]ppclosest point and primitve include/igl/signed_distance.h

◆ signed_distance_winding_number() [3/3]

template<typename DerivedV , typename DerivedF , typename Derivedq , typename Scalar , typename Derivedc >
void igl::signed_distance_winding_number ( const AABB< DerivedV, 2 > &  tree,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< Derivedq > &  q,
Scalar &  s,
Scalar &  sqrd,
int &  i,
Eigen::PlainObjectBase< Derivedc > &  c 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ signed_distance_fast_winding_number() [1/2]

template<typename DerivedP , typename DerivedV , typename DerivedF , typename DerivedS >
void igl::signed_distance_fast_winding_number ( const Eigen::MatrixBase< DerivedP > &  P,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const AABB< DerivedV, 3 > &  tree,
const igl::FastWindingNumberBVH &  fwn_bvh,
Eigen::PlainObjectBase< DerivedS > &  S 
)

Calculates signed distance at query points P, using fast winding number for sign.

Usage:

VectorXd S;
VectorXd V, P; //where V is mesh vertices, P are query points VectorXi F;
igl::FastWindingNumberBVH fwn_bvh; igl::fast_winding_number(V.cast<float>(), F, 2, fwn_bvh); igl::signed_distance_fast_winding_number(P,V,F,tree,fwn_bvh,S);

Parameters
[in]P#P by 3 list of query point positions
[in]V#V by 3 list of triangle indices
[in]F#F by 3 list of triangle normals
[in]treeAABB acceleration tree (see AABB.h)
[in]bvhfast winding precomputation (see Fast_Winding_Number.h)
[out]S#P list of signed distances of each point in P

include/igl/signed_distance.h

◆ signed_distance_fast_winding_number() [2/2]

template<typename Derivedq , typename DerivedV , typename DerivedF >
DerivedV::Scalar igl::signed_distance_fast_winding_number ( const Eigen::MatrixBase< Derivedq > &  q,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const AABB< DerivedV, 3 > &  tree,
const igl::FastWindingNumberBVH &  fwn_bvh 
)

Calculates signed distance at query point q, using fast winding number for sign.

Parameters
[in]treeAABB acceleration tree (see AABB.h)
[in]V#V by 3 list of triangle indices
[in]F#F by 3 list of triangle normals
[in]bvhfast winding precomputation (see Fast_Winding_Number.h)
[in]q1 by 3 list of query point positions
[out]S#P list of signed distances of each point in P

include/igl/signed_distance.h

◆ simplify_polyhedron()

void igl::simplify_polyhedron ( const Eigen::MatrixXd &  OV,
const Eigen::MatrixXi &  OF,
Eigen::MatrixXd &  V,
Eigen::MatrixXi &  F,
Eigen::VectorXi &  J 
)

Simplify a polyhedron represented as a triangle mesh (OV,OF) by collapsing any edge that doesn't contribute to defining surface's pointset.

Precondition
This would also make sense for open and non-manifold meshes, but the current implementation only works with closed manifold surfaces with well defined triangle normals.
Parameters
[in]OV#OV by 3 list of input mesh vertex positions
[in]OF#OF by 3 list of input mesh triangle indices into OV
[out]V#V by 3 list of output mesh vertex positions
[out]F#F by 3 list of input mesh triangle indices into V
[out]J#F list of indices into OF of birth parents

◆ slice() [1/7]

template<typename TX , typename TY , typename DerivedR , typename DerivedC >
void igl::slice ( const Eigen::SparseMatrix< TX > &  X,
const Eigen::DenseBase< DerivedR > &  R,
const Eigen::DenseBase< DerivedC > &  C,
Eigen::SparseMatrix< TY > &  Y 
)

Act like the matlab X(row_indices,col_indices) operator, where row_indices, col_indices are non-negative integer indices.

Parameters
[in]Xm by n matrix
[in]Rlist of row indices
[in]Clist of column indices
[out]Y#R by #C matrix
See also
slice_mask, slice_into
Note
See also Eigen's unaryExpr https://stackoverflow.com/a/49411587/148668

◆ slice() [2/7]

template<typename MatX , typename DerivedR , typename MatY >
void igl::slice ( const MatX &  X,
const Eigen::DenseBase< DerivedR > &  R,
const int  dim,
MatY &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Wrapper to only slice in one direction

Parameters
[in]dimdimension to slice in 1 or 2, dim=1 --> X(R,:), dim=2 --> X(:,R)
Note
For now this is just a cheap wrapper.

◆ slice() [3/7]

template<class T >
void igl::slice ( const std::vector< T > &  X,
std::vector< size_t > const &  R,
std::vector< T > &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ slice() [4/7]

template<typename DerivedX , typename DerivedY , typename DerivedR >
void igl::slice ( const Eigen::DenseBase< DerivedX > &  X,
const Eigen::DenseBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Vector version

◆ slice() [5/7]

template<typename DerivedX , typename DerivedR , typename DerivedC , typename DerivedY >
void igl::slice ( const Eigen::DenseBase< DerivedX > &  X,
const Eigen::DenseBase< DerivedR > &  R,
const Eigen::DenseBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See slice.h for more details

◆ slice() [6/7]

template<typename DerivedX , typename DerivedR >
DerivedX igl::slice ( const Eigen::DenseBase< DerivedX > &  X,
const Eigen::DenseBase< DerivedR > &  R 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

VectorXi Y = slice(X,R); This templating is bad because the return type might not have the same size as DerivedX. This will probably only work if DerivedX has Dynamic as it's non-trivial sizes or if the number of rows in R happens to equal the number of rows in DerivedX.

◆ slice() [7/7]

template<typename DerivedX , typename DerivedR >
DerivedX igl::slice ( const Eigen::DenseBase< DerivedX > &  X,
const Eigen::DenseBase< DerivedR > &  R,
const int  dim 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ slice_cached_precompute()

template<typename TX , typename TY , typename DerivedI >
void igl::slice_cached_precompute ( const Eigen::SparseMatrix< TX > &  X,
const Eigen::Matrix< int, Eigen::Dynamic, 1 > &  R,
const Eigen::Matrix< int, Eigen::Dynamic, 1 > &  C,
Eigen::MatrixBase< DerivedI > &  data,
Eigen::SparseMatrix< TY > &  Y 
)

Act like the matlab X(row_indices,col_indices) operator, where row_indices, col_indices are non-negative integer indices.

This is a fast version of igl::slice that can analyze and store the sparsity structure. It is slower at the irst evaluation (slice_cached_precompute), but faster on the subsequent ones.

Parameters
[in]Xm by n matrix
[in]Rlist of row indices
[in]Clist of column indices
[out]dataTemporary data used by slice_cached to repeat this operation
[out]Y#R by #C matrix

Example

// Construct and slice up Laplacian
SparseMatrix<double> L,L_sliced;
igl::cotmatrix(V,F,L);
// Normal igl::slice call
igl::slice(L,in,in,L_in_in);
…
// Fast version
static VectorXi data; // static or saved in a global state
if (data.size() == 0)
  igl::slice_cached_precompute(L,in,in,data,L_sliced);
else
  igl::slice_cached(L,data,L_sliced);

include/igl/slice_cached.h

◆ slice_cached()

template<typename TX , typename TY , typename DerivedI >
void igl::slice_cached ( const Eigen::SparseMatrix< TX > &  X,
const Eigen::MatrixBase< DerivedI > &  data,
Eigen::SparseMatrix< TY > &  Y 
)

Slice X by cached C,R indices into Y.

Parameters
[in]Xm by n matrix
[in]dataTemporary data used by slice_cached to repeat this operation
[out]Y#R by #C matrix

◆ slice_into() [1/4]

template<typename T , typename DerivedR , typename DerivedC >
void igl::slice_into ( const Eigen::SparseMatrix< T > &  X,
const Eigen::MatrixBase< DerivedR > &  R,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::SparseMatrix< T > &  Y 
)

Act like the matlab Y(row_indices,col_indices) = X.

Parameters
[in]Xxm by xn rhs matrix
[in]Rlist of row indices
[in]Clist of column indices
[in]Yym by yn lhs matrix
[out]Yym by yn lhs matrix, same as input but Y(R,C) = X
See also
slice

◆ slice_into() [2/4]

template<typename MatX , typename MatY , typename DerivedR >
void igl::slice_into ( const MatX &  X,
const Eigen::MatrixBase< DerivedR > &  R,
const int  dim,
MatY &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Wrapper to only slice in one direction

Parameters
[int]dim dimension to slice in 1 or 2, dim=1 --> X(R,:), dim=2 --> X(:,R)
Note
For now this is just a cheap wrapper.

◆ slice_into() [3/4]

template<typename DerivedX , typename DerivedY , typename DerivedR , typename DerivedC >
void igl::slice_into ( const Eigen::MatrixBase< DerivedX > &  X,
const Eigen::MatrixBase< DerivedR > &  R,
const Eigen::MatrixBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See slice.h for more details

◆ slice_into() [4/4]

template<typename DerivedX , typename DerivedR , typename DerivedY >
void igl::slice_into ( const Eigen::MatrixBase< DerivedX > &  X,
const Eigen::MatrixBase< DerivedR > &  R,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Vector version

◆ slice_mask() [1/6]

template<typename XType , typename YType >
void igl::slice_mask ( const Eigen::SparseMatrix< XType > &  X,
const Eigen::Array< bool, Eigen::Dynamic, 1 > &  R,
const Eigen::Array< bool, Eigen::Dynamic, 1 > &  C,
Eigen::SparseMatrix< YType > &  Y 
)

Act like the matlab X(row_mask,col_mask) operator, where row_mask, col_mask are non-negative integer indices.

Parameters
[in]Xm by n matrix
[in]Rm list of row bools
[in]Cn list of column bools
[out]Y#trues-in-R by #trues-in-C matrix
See also
slice

◆ slice_mask() [2/6]

template<typename XType , typename YType >
void igl::slice_mask ( const Eigen::SparseMatrix< XType > &  X,
const Eigen::Array< bool, Eigen::Dynamic, 1 > &  R,
const int  dim,
Eigen::SparseMatrix< YType > &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Wrapper to only slice in one direction

Parameters
[int]dim dimension to slice in 1 or 2, dim=1 --> X(R,:), dim=2 --> X(:,R)

◆ slice_mask() [3/6]

template<typename DerivedX , typename DerivedY >
void igl::slice_mask ( const Eigen::DenseBase< DerivedX > &  X,
const Eigen::Array< bool, Eigen::Dynamic, 1 > &  R,
const Eigen::Array< bool, Eigen::Dynamic, 1 > &  C,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See slice.h for more details

◆ slice_mask() [4/6]

template<typename DerivedX , typename DerivedY >
void igl::slice_mask ( const Eigen::DenseBase< DerivedX > &  X,
const Eigen::Array< bool, Eigen::Dynamic, 1 > &  R,
const int  dim,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

◆ slice_mask() [5/6]

template<typename DerivedX >
DerivedX igl::slice_mask ( const Eigen::DenseBase< DerivedX > &  X,
const Eigen::Array< bool, Eigen::Dynamic, 1 > &  R,
const Eigen::Array< bool, Eigen::Dynamic, 1 > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
This templating is bad because the return type might not have the same size as DerivedX. This will probably only work if DerivedX has Dynamic as it's non-trivial sizes or if the number of rows in R happens to equal the number of rows in DerivedX.

◆ slice_mask() [6/6]

template<typename DerivedX >
DerivedX igl::slice_mask ( const Eigen::DenseBase< DerivedX > &  X,
const Eigen::Array< bool, Eigen::Dynamic, 1 > &  R,
const int  dim 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ slice_sorted()

template<typename TX , typename TY , typename DerivedR , typename DerivedC >
void igl::slice_sorted ( const Eigen::SparseMatrix< TX > &  X,
const Eigen::DenseBase< DerivedR > &  R,
const Eigen::DenseBase< DerivedC > &  C,
Eigen::SparseMatrix< TY > &  Y 
)

Act like the matlab X(row_indices,col_indices) operator, where row_indices, col_indices are non-negative integer indices.

This version is about 2x faster than igl::slice, but it assumes that the indices to slice with are already sorted.

Parameters
[in]Xm by n matrix
[in]Rlist of row indices
[in]Clist of column indices
[out]Y#R by #C matrix
See also
slice

◆ slim_precompute()

void igl::slim_precompute ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const Eigen::MatrixXd &  V_init,
SLIMData data,
MappingEnergyType  slim_energy,
const Eigen::VectorXi &  b,
const Eigen::MatrixXd &  bc,
double  soft_p 
)

Compute necessary information to start using SLIM.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3/3 list of mesh faces (triangles/tets)
[in]V_init#V by 3 list of initial mesh vertex positions
[in,out]dataPrecomputation data structure
[in]slim_energyEnergy to minimize
[in]blist of boundary indices into V
[in]bc#b by dim list of boundary conditions
[in]soft_pSoft penalty factor (can be zero)

include/igl/slim.h

◆ slim_solve()

Eigen::MatrixXd igl::slim_solve ( SLIMData data,
int  iter_num 
)

Run iter_num iterations of SLIM.

Parameters
[in,out]dataPrecomputation data structure
[in]iter_numNumber of iterations to run
Returns
#V by dim list of mesh vertex positions

include/igl/slim.h

◆ slim_update_weights_and_closest_rotations_with_jacobians()

void igl::slim_update_weights_and_closest_rotations_with_jacobians ( const Eigen::MatrixXd &  Ji,
igl::MappingEnergyType  slim_energy,
double  exp_factor,
Eigen::MatrixXd &  W,
Eigen::MatrixXd &  Ri 
)

Internal Routine.

Exposed for Integration with SCAF

Parameters
[in]Ji?? by ?? list of Jacobians??
[in]slim_energyEnergy to minimize
[in]exp_factor??? used for exponential energies, ignored otherwise
[out]W?? by ?? list of weights??
[out]Ri?? by ?? list of rotations??

include/igl/slim.h

◆ slim_buildA()

void igl::slim_buildA ( const Eigen::SparseMatrix< double > &  Dx,
const Eigen::SparseMatrix< double > &  Dy,
const Eigen::SparseMatrix< double > &  Dz,
const Eigen::MatrixXd &  W,
std::vector< Eigen::Triplet< double > > &  IJV 
)

Undocumented function related to SLIM optimization.

Parameters
[in]Dx?? by ?? matrix to compute of x derivatives?
[in]Dy?? by ?? matrix to compute of y derivatives?
[in]Dz?? bz ?? matrix to compute of z derivatives?
[in]W?? by ?? list of weights??
[out]IJV?? by ?? list of triplets to some A matrix??

◆ smooth_corner_adjacency() [1/2]

void igl::smooth_corner_adjacency ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const double  corner_threshold_radians,
Eigen::VectorXi &  CI,
Eigen::VectorXi &  CC 
)

Determine the corner-to-face adjacency relationship that can be used for computing crease-aware per-corner normals.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of triangle mesh indices into rows of V
[in]corner_threshold_radiansdihedral angle considered non-smooth (in radians)
[out]CI#CI list of face neighbors as indices into rows of F
[out]CC3*#F+1 list of cumulative sizes so that CC(i*3+j+1) - CC(i*3+j) is the number of faces considered smoothly incident on corner at F(i,j)

◆ smooth_corner_adjacency() [2/2]

void igl::smooth_corner_adjacency ( const Eigen::MatrixXi &  FV,
const Eigen::MatrixXi &  FN,
Eigen::VectorXi &  CI,
Eigen::VectorXi &  CC 
)

Determine the effective corner-to-face adjacency relationship implied by a set of indexed vertex positions (FV) and normals (FV) (e.g., those read in from a .obj file).

Parameters
[in]FV#F by 3 list of triangle mesh indices into rows of some V
[in]FN#F by 3 list of triangle mesh indices into rows of some N
[out]CI#CI list of face neighbors as indices into rows of F
[out]CC3*#F+1 list of cumulative sizes so that CC(i*3+j+1) - CC(i*3+j) is the number of faces considered smoothly incident on corner at F(i,j)

◆ snap_points() [1/3]

template<typename DerivedC , typename DerivedV , typename DerivedI , typename DerivedminD , typename DerivedVI >
void igl::snap_points ( const Eigen::MatrixBase< DerivedC > &  C,
const Eigen::MatrixBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedminD > &  minD,
Eigen::PlainObjectBase< DerivedVI > &  VI 
)

Snap list of points C to closest of another list of points V.

Parameters
[in]C#C by dim list of query point positions
[in]V#V by dim list of data point positions
[out]I#C list of indices into V of closest points to C
[out]minD#C list of squared (^p) distances to closest points
[out]VI#C by dim list of new point positions, VI = V(I,:)

◆ snap_points() [2/3]

template<typename DerivedC , typename DerivedV , typename DerivedI , typename DerivedminD >
void igl::snap_points ( const Eigen::MatrixBase< DerivedC > &  C,
const Eigen::MatrixBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedI > &  I,
Eigen::PlainObjectBase< DerivedminD > &  minD 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ snap_points() [3/3]

template<typename DerivedC , typename DerivedV , typename DerivedI >
void igl::snap_points ( const Eigen::MatrixBase< DerivedC > &  C,
const Eigen::MatrixBase< DerivedV > &  V,
Eigen::PlainObjectBase< DerivedI > &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ snap_to_canonical_view_quat() [1/2]

template<typename Scalarq , typename Scalars >
bool igl::snap_to_canonical_view_quat ( const Eigen::Quaternion< Scalarq > &  q,
const double  threshold,
Eigen::Quaternion< Scalars > &  s 
)

Snap the quaternion q to the nearest canonical view quaternion.

Parameters
[in]qquaternion to be snapped (also see Outputs)
[in]threshold(optional) threshold: 1.0 --> snap any input 0.5 --> snap inputs somewhat close to canonical views 0.0 --> snap no input
[out]qquaternion possibly set to nearest canonical view
Returns
true only if q was snapped to the nearest canonical view

◆ snap_to_canonical_view_quat() [2/2]

template<typename Q_type >
bool igl::snap_to_canonical_view_quat ( const Q_type *  q,
const Q_type  threshold,
Q_type *  s 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ snap_to_fixed_up()

template<typename Qtype >
void igl::snap_to_fixed_up ( const Eigen::Quaternion< Qtype > &  q,
Eigen::Quaternion< Qtype > &  s 
)

Snap an arbitrary rotation to a rotation resulting from a rotation about the y-axis then the x-axis (maintaining fixed up like two_axis_valuator_fixed_up.)

Parameters
[in]qGeneral rotation as quaternion
[out]sthe resulting rotation (as quaternion)
See also
two_axis_valuator_fixed_up

◆ solid_angle()

template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedP >
DerivedA::Scalar igl::solid_angle ( const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< DerivedC > &  C,
const Eigen::MatrixBase< DerivedP > &  P 
)

Compute the signed solid angle subtended by the oriented 3d triangle (A,B,C) at some point P.

Parameters
[in]A3D position of corner
[in]B3D position of corner
[in]C3D position of corner
[in]P3D position of query point
Returns
signed solid angle

◆ sort() [1/3]

template<typename DerivedX , typename DerivedY , typename DerivedIX >
void igl::sort ( const Eigen::DenseBase< DerivedX > &  X,
const int  dim,
const bool  ascending,
Eigen::PlainObjectBase< DerivedY > &  Y,
Eigen::PlainObjectBase< DerivedIX > &  IX 
)

Sort the elements of a matrix X along a given dimension like matlabs sort function.

Template Parameters
DerivedXderived scalar type, e.g. MatrixXi or MatrixXd
DerivedIXderived integer type, e.g. MatrixXi
Parameters
[in]Xm by n matrix whose entries are to be sorted
[in]dimdimensional along which to sort: 1 sort each column (matlab default) 2 sort each row
[in]ascendingsort ascending (true, matlab default) or descending (false)
[out]Ym by n matrix whose entries are sorted
[out]IXm by n matrix of indices so that if dim = 1, then in matlab notation for j = 1:n, Y(:,j) = X(I(:,j),j); end

◆ sort() [2/3]

template<typename DerivedX , typename DerivedY >
void igl::sort ( const Eigen::DenseBase< DerivedX > &  X,
const int  dim,
const bool  ascending,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ sort_new()

template<typename DerivedX , typename DerivedY , typename DerivedIX >
void igl::sort_new ( const Eigen::DenseBase< DerivedX > &  X,
const int  dim,
const bool  ascending,
Eigen::PlainObjectBase< DerivedY > &  Y,
Eigen::PlainObjectBase< DerivedIX > &  IX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
This should be renamed to something like sort_small because it is only faster if size(X,dim) is small.

◆ sort2()

template<typename DerivedX , typename DerivedY , typename DerivedIX >
void igl::sort2 ( const Eigen::DenseBase< DerivedX > &  X,
const int  dim,
const bool  ascending,
Eigen::PlainObjectBase< DerivedY > &  Y,
Eigen::PlainObjectBase< DerivedIX > &  IX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Special case if size(X,dim) == 2

◆ sort3()

template<typename DerivedX , typename DerivedY , typename DerivedIX >
void igl::sort3 ( const Eigen::DenseBase< DerivedX > &  X,
const int  dim,
const bool  ascending,
Eigen::PlainObjectBase< DerivedY > &  Y,
Eigen::PlainObjectBase< DerivedIX > &  IX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Special case if size(X,dim) == 3

◆ sort() [3/3]

template<class T >
void igl::sort ( const std::vector< T > &  unsorted,
const bool  ascending,
std::vector< T > &  sorted,
std::vector< size_t > &  index_map 
)

Act like matlab's [Y,I] = SORT(X) for std library vectors.

Template Parameters
Tshould be a class that implements the '<' comparator operator
Parameters
[in]unsortedunsorted vector
[in]ascendingsort ascending (true, matlab default) or descending (false)
[out]sortedsorted vector, allowed to be same as unsorted
[out]index_mapan index map such that sorted[i] = unsorted[index_map[i]]

◆ sort_angles()

template<typename DerivedM , typename DerivedR >
void igl::sort_angles ( const Eigen::MatrixBase< DerivedM > &  M,
Eigen::PlainObjectBase< DerivedR > &  R 
)

Sort angles in ascending order in a numerically robust way.

Instead of computing angles using atan2(y, x), sort directly on (y, x).

Parameters
[in]Mm by n matrix of scalars. (n >= 2). Assuming the first column of M contains values for y, and the second column is x. Using the rest of the columns as tie-breaker.
[in]Ran array of m indices. M.row(R[i]) contains the i-th smallest angle.

◆ sort_triangles()

template<typename DerivedV , typename DerivedF , typename DerivedMV , typename DerivedP , typename DerivedFF , typename DerivedI >
void igl::sort_triangles ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedMV > &  MV,
const Eigen::MatrixBase< DerivedP > &  P,
Eigen::PlainObjectBase< DerivedFF > &  FF,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Sort triangles by depth (from back to front) using a painter's algorithm.

Parameters
[in]V#V by 4 list of homogeneous vertex positions
[in]F#F by 3 list of triangle indices
[in]MV4 by 4 model view matrix
[in]P4 by 4 projection matrix
[out]FF#F by 3 list of sorted triangles indices
[out]I#F list of sorted indices

◆ sort_vectors_ccw() [1/4]

template<typename DerivedS , typename DerivedI >
void igl::sort_vectors_ccw ( const Eigen::PlainObjectBase< DerivedS > &  P,
const Eigen::PlainObjectBase< DerivedS > &  N,
Eigen::PlainObjectBase< DerivedI > &  order,
Eigen::PlainObjectBase< DerivedS > &  sorted,
Eigen::PlainObjectBase< DerivedI > &  inv_order 
)

Sorts a set of N coplanar vectors in a ccw order, and returns their order.

Optionally it also returns a copy of the ordered vector set, or the indices, in the original unordered set, of the vectors in the ordered set (called here the "inverse" set of indices).

Parameters
[in]P1 by 3N row vector of the vectors to be sorted, stacked horizontally
[in]N#1 by 3 normal of the plane where the vectors lie
[out]orderN by 1 order of the vectors (indices of the unordered vectors into the ordered vector set)
[out]sorted1 by 3N row vector of the ordered vectors, stacked horizontally
[out]inv_orderN by 1 "inverse" order of the vectors (the indices of the ordered vectors into the unordered vector set)

◆ sort_vectors_ccw() [2/4]

template<typename DerivedS , typename DerivedI >
void igl::sort_vectors_ccw ( const Eigen::PlainObjectBase< DerivedS > &  P,
const Eigen::PlainObjectBase< DerivedS > &  N,
Eigen::PlainObjectBase< DerivedI > &  order,
Eigen::PlainObjectBase< DerivedS > &  sorted 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ sort_vectors_ccw() [3/4]

template<typename DerivedS , typename DerivedI >
void igl::sort_vectors_ccw ( const Eigen::PlainObjectBase< DerivedS > &  P,
const Eigen::PlainObjectBase< DerivedS > &  N,
Eigen::PlainObjectBase< DerivedI > &  order,
Eigen::PlainObjectBase< DerivedI > &  inv_order 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ sort_vectors_ccw() [4/4]

template<typename DerivedS , typename DerivedI >
void igl::sort_vectors_ccw ( const Eigen::PlainObjectBase< DerivedS > &  P,
const Eigen::PlainObjectBase< DerivedS > &  N,
Eigen::PlainObjectBase< DerivedI > &  order 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ sortrows() [1/2]

template<typename DerivedX , typename DerivedY , typename DerivedI >
void igl::sortrows ( const Eigen::DenseBase< DerivedX > &  X,
const bool  ascending,
Eigen::PlainObjectBase< DerivedY > &  Y,
Eigen::PlainObjectBase< DerivedI > &  I 
)

Act like matlab's [Y,I] = sortrows(X)

Template Parameters
DerivedXderived scalar type, e.g. MatrixXi or MatrixXd
DerivedIderived integer type, e.g. MatrixXi
Parameters
[in]Xm by n matrix whose entries are to be sorted
[in]ascendingsort ascending (true, matlab default) or descending (false)
[out]Ym by n matrix whose entries are sorted (should not be same reference as X)
[out]Im list of indices so that Y = X(I,:);

◆ sortrows() [2/2]

template<typename DerivedX , typename DerivedY >
void igl::sortrows ( const Eigen::DenseBase< DerivedX > &  X,
const bool  ascending,
Eigen::PlainObjectBase< DerivedY > &  Y 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ sparse() [1/4]

template<class IndexVectorI , class IndexVectorJ , class ValueVector , typename T >
void igl::sparse ( const IndexVectorI &  I,
const IndexVectorJ &  J,
const ValueVector &  V,
const size_t  m,
const size_t  n,
Eigen::SparseMatrix< T > &  X 
)

Build a sparse matrix from list of indices and values (I,J,V), functions like the sparse function in matlab.

Template Parameters
IndexVectorlist of indices, value should be non-negative and should expect to be cast to an index. Must implement operator(i) to retrieve ith element
ValueVectorlist of values, value should be expect to be cast to type T. Must implement operator(i) to retrieve ith element
Tshould be a eigen sparse matrix primitive type like int or double
Parameters
[in]Innz vector of row indices of non zeros entries in X
[in]Jnnz vector of column indices of non zeros entries in X
[in]Vnnz vector of non-zeros entries in X
[in]mnumber of rows
[in]nnumber of cols
[out]Xm by n matrix of type T whose entries are to be found

◆ sparse() [2/4]

template<class IndexVector , class ValueVector , typename T >
void igl::sparse ( const IndexVector &  I,
const IndexVector &  J,
const ValueVector &  V,
Eigen::SparseMatrix< T > &  X 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ sparse() [3/4]

template<typename DerivedD , typename T >
void igl::sparse ( const Eigen::PlainObjectBase< DerivedD > &  D,
Eigen::SparseMatrix< T > &  X 
)

Convert a full, dense matrix to a sparse one.

Note
Just use .sparseView()
Template Parameters
Tshould be a eigen sparse matrix primitive type like int or double
Parameters
[in]Dm by n full, dense matrix
[out]Xm by n sparse matrix

◆ sparse() [4/4]

template<typename DerivedD >
Eigen::SparseMatrix< typename DerivedD::Scalar > igl::sparse ( const Eigen::PlainObjectBase< DerivedD > &  D)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ sparse_cached_precompute() [1/2]

template<typename DerivedI , typename Scalar >
void igl::sparse_cached_precompute ( const Eigen::MatrixBase< DerivedI > &  I,
const Eigen::MatrixBase< DerivedI > &  J,
Eigen::VectorXi &  data,
Eigen::SparseMatrix< Scalar > &  X 
)

Build a sparse matrix from list of indices and values (I,J,V), similarly to the sparse function in matlab.

Divides the construction in two phases, one for fixing the sparsity pattern, and one to populate it with values. Compared to igl::sparse, this version is slower for the first time (since it requires a precomputation), but faster to the subsequent evaluations.

Parameters
[in]Innz vector of row indices of non zeros entries in X
[in]Jnnz vector of column indices of non zeros entries in X
[out]data?? vector of ??
[out]Xm by n matrix of type T whose entries are to be found

Example:

  Eigen::SparseMatrix<double> A;
  std::vector<Eigen::Triplet<double> > IJV;
  slim_buildA(IJV);
  if (A.rows() == 0)
  {
    A = Eigen::SparseMatrix<double>(rows,cols);
    igl::sparse_cached_precompute(IJV,A_data,A);
  }
  else
    igl::sparse_cached(IJV,A_data,A);

◆ sparse_cached_precompute() [2/2]

template<typename Scalar >
void igl::sparse_cached_precompute ( const std::vector< Eigen::Triplet< Scalar > > &  triplets,
Eigen::VectorXi &  data,
Eigen::SparseMatrix< Scalar > &  X 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]tripletsnnz vector of triplets of non zeros entries in X

◆ sparse_cached() [1/2]

template<typename Scalar >
void igl::sparse_cached ( const std::vector< Eigen::Triplet< Scalar > > &  triplets,
const Eigen::VectorXi &  data,
Eigen::SparseMatrix< Scalar > &  X 
)

Build a sparse matrix from cached list of data and values.

Parameters
[in]tripletsnnz vector of triplets of non zeros entries in X
[in]data?? vector of ??
[in,out]Xm by n matrix of type T whose entries are to be found

◆ sparse_cached() [2/2]

template<typename DerivedV , typename Scalar >
void igl::sparse_cached ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::VectorXi &  data,
Eigen::SparseMatrix< Scalar > &  X 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]V#V list of values

◆ sparse_voxel_grid()

template<typename DerivedP0 , typename Func , typename DerivedS , typename DerivedV , typename DerivedI >
void igl::sparse_voxel_grid ( const Eigen::MatrixBase< DerivedP0 > &  p0,
const Func &  scalarFunc,
const double  eps,
const int  expected_number_of_cubes,
Eigen::PlainObjectBase< DerivedS > &  CS,
Eigen::PlainObjectBase< DerivedV > &  CV,
Eigen::PlainObjectBase< DerivedI > &  CI 
)

Given a point, p0, on an isosurface, construct a shell of epsilon sized cubes surrounding the surface.

These cubes can be used as the input to marching cubes.

Parameters
[in]p0A 3D point on the isosurface surface defined by scalarFunc(x) = 0
[in]scalarFuncA scalar function from R^3 to R – points which map to 0 lie on the surface, points which are negative lie inside the surface, and points which are positive lie outside the surface
[in]epsThe edge length of the cubes surrounding the surface
[in]expected_number_of_cubesThis pre-allocates internal data structures to speed things up
[out]CS#CV by 1 list of scalar values at the cube vertices
[out]CV#CV by 3 list of cube vertex positions
[out]CI#CI by 8 list of cube indices into rows of CS and CV. Each row represents 8 corners of cube in y-x-z binary counting order.

◆ speye() [1/2]

template<typename T >
void igl::speye ( const int  n,
const int  m,
Eigen::SparseMatrix< T > &  I 
)

Builds an m by n sparse identity matrix like matlab's speye function.

Template Parameters
Tshould be a eigen sparse matrix primitive type like int or double
Parameters
[in]mnumber of rows
[in]nnumber of cols
[out]Im by n sparse matrix with 1's on the main diagonal

◆ speye() [2/2]

template<typename T >
void igl::speye ( const int  n,
Eigen::SparseMatrix< T > &  I 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

m = n

◆ split_nonmanifold() [1/2]

template<typename DerivedF , typename DerivedSF , typename DerivedSVI >
void igl::split_nonmanifold ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedSF > &  SF,
Eigen::PlainObjectBase< DerivedSVI > &  SVI 
)

Split a non-manifold (or non-orientable) mesh into a orientable manifold mesh possibly with more connected components and geometrically duplicate vertices.

Parameters
[in]F#F by 3 list of mesh triangle indices into rows of some V
[out]SF#F by 3 list of mesh triangle indices into rows of a new vertex list SV = V(SVI,:)
[out]SVI#SV list of indices into V identifying vertex positions

◆ split_nonmanifold() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedSV , typename DerivedSF , typename DerivedSVI >
void igl::split_nonmanifold ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedSV > &  SV,
Eigen::PlainObjectBase< DerivedSF > &  SF,
Eigen::PlainObjectBase< DerivedSVI > &  SVI 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]V#V by dim explicit list of vertex positions
[out]SV#SV by dim explicit list of vertex positions

◆ squared_edge_lengths()

template<typename DerivedV , typename DerivedF , typename DerivedL >
void igl::squared_edge_lengths ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedL > &  L 
)

Constructs a list of squared lengths of edges opposite each index in a face (triangle/tet) list.

Template Parameters
DerivedVderived from vertex positions matrix type: i.e. MatrixXd
DerivedFderived from face indices matrix type: i.e. MatrixXi
DerivedLderived from edge lengths matrix type: i.e. MatrixXd
Parameters
[in]Veigen matrix #V by 3
[in]F#F by (2|3|4) list of mesh edges, triangles or tets
[out]L#F by {1|3|6} list of edge lengths squared 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]

◆ stdin_to_temp()

bool igl::stdin_to_temp ( FILE **  temp_file)

Write stdin/piped input to a temporary file which can than be preprocessed as it is (a normal file).

This is often useful if you want to process stdin/piped with library functions that expect to be able to fseek(), rewind() etc..

If your application is not using fseek(), rewind(), etc. but just reading from stdin then this will likely cause a bottle neck as it defeats the whole purpose of piping.

Parameters
[out]temp_filepointer to temp file pointer, rewound to beginning of file so its ready to be read
Returns
true only if no errors were found
Note
caller is responsible for closing the file (tmpfile() automatically unlinks the file so there is no need to remove/delete/unlink the file)

◆ straighten_seams()

template<typename DerivedV , typename DerivedF , typename DerivedVT , typename DerivedFT , typename Scalar , typename DerivedUE , typename DerivedUT , typename DerivedOT >
void igl::straighten_seams ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedVT > &  VT,
const Eigen::MatrixBase< DerivedFT > &  FT,
const Scalar  tol,
Eigen::PlainObjectBase< DerivedUE > &  UE,
Eigen::PlainObjectBase< DerivedUT > &  UT,
Eigen::PlainObjectBase< DerivedOT > &  OT 
)

Given a obj-style mesh with (V,F) defining the geometric surface of the mesh and (VT,FT) defining the parameterization/texture-mapping of the mesh in the uv-domain, find all seams and boundaries in the texture-mapping and "straighten" them, remapping vertices along the boundary and in the interior.

This will be careful to consistently straighten multiple seams in the texture-mesh corresponding to the same edge chains in the surface-mesh.

Parameters
[in]V#V by 3 list of vertices
[in]F#F by 3 list of triangle indices
[in]VT#VT by 2 list of texture coordinates
[in]FT#F by 3 list of triangle texture coordinates
[in]tolfollowed by Ramer-Douglas-Peucker tolerance as a fraction of the curves bounding box diagonal (see dpsimplify)
[out]UE#UE by 2 list of indices into VT of coarse output polygon edges
[out]UT#VT by 3 list of new texture coordinates
[out]OT#OT by 2 list of indices into VT of boundary edges
See also
ramer_douglas_peucker

◆ starts_with() [1/2]

bool igl::starts_with ( const std::string &  str,
const std::string &  prefix 
)

Check if a string starts with a given prefix.

Parameters
[in]strstring to check
[in]prefixprefix to check
Returns
true if str starts with prefix, false otherwise

include/igl/string_utils.h

◆ starts_with() [2/2]

bool igl::starts_with ( const char *  str,
const char *  prefix 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.include/igl/string_utils.h.

◆ sum() [1/2]

template<typename T >
void igl::sum ( const Eigen::SparseMatrix< T > &  X,
const int  dim,
Eigen::SparseVector< T > &  S 
)

Sum the columns or rows of a sparse matrix.

Template Parameters
shouldbe a eigen sparse matrix primitive type like int or double
Parameters
[in]Xm by n sparse matrix
[in]dimdimension along which to sum (1 or 2)
[out]Sn-long sparse vector (if dim == 1) or m-long sparse vector (if dim == 2)
Note
If your looking for dense matrix matlab like sum for eigen matrics just use:
 M.colwise().sum() or M.rowwise().sum()

◆ sum() [2/2]

template<typename AType , typename DerivedB >
void igl::sum ( const Eigen::SparseMatrix< AType > &  A,
const int  dim,
Eigen::PlainObjectBase< DerivedB > &  B 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Sum is "conducted" in the type of DerivedB::Scalar

Template Parameters
ATypeshould be a eigen sparse matrix primitive type like int or double
DerivedBshould be a eigen dense matrix primitive type like int or double

◆ svd3x3()

template<typename T >
void igl::svd3x3 ( const Eigen::Matrix< T, 3, 3 > &  A,
Eigen::Matrix< T, 3, 3 > &  U,
Eigen::Matrix< T, 3, 1 > &  S,
Eigen::Matrix< T, 3, 3 > &  V 
)

Super fast 3x3 SVD according to http://pages.cs.wisc.edu/~sifakis/project_pages/svd.html The resulting decomposition is A = U * diag(S[0], S[1], S[2]) * V'.

Note
this SVD algorithm guarantees that det(U) = det(V) = 1, but this comes at the cost that 'sigma3' can be negative for computing polar decomposition it's great because all we need to do is U*V' and the result will automatically have positive determinant
Parameters
[in]A3x3 matrix
[out]U3x3 left singular vectors
[out]S3x1 singular values
[out]V3x3 right singular vectors

◆ svd3x3_avx()

template<typename T >
void igl::svd3x3_avx ( const Eigen::Matrix< T, 3 *8, 3 > &  A,
Eigen::Matrix< T, 3 *8, 3 > &  U,
Eigen::Matrix< T, 3 *8, 1 > &  S,
Eigen::Matrix< T, 3 *8, 3 > &  V 
)

Super fast 3x3 SVD according to http://pages.cs.wisc.edu/~sifakis/project_pages/svd.html This is AVX version of svd3x3 (see svd3x3.h) which works on 8 matrices at a time These eight matrices are simply stacked in columns, the rest is the same as for svd3x3.

Parameters
[in]A12 by 3 stack of 3x3 matrices
[out]U12x3 left singular vectors stacked
[out]S12x1 singular values stacked
[out]V12x3 right singular vectors stacked

◆ svd3x3_sse()

template<typename T >
void igl::svd3x3_sse ( const Eigen::Matrix< T, 3 *4, 3 > &  A,
Eigen::Matrix< T, 3 *4, 3 > &  U,
Eigen::Matrix< T, 3 *4, 1 > &  S,
Eigen::Matrix< T, 3 *4, 3 > &  V 
)
Parameters
[in]A12 by 3 stack of 3x3 matrices
[out]U12x3 left singular vectors stacked
[out]S12x1 singular values stacked
[out]V12x3 right singular vectors stacked

◆ swept_volume()

void igl::swept_volume ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const std::function< Eigen::Affine3d(const double t)> &  transform,
const size_t  steps,
const size_t  grid_res,
const size_t  isolevel,
Eigen::MatrixXd &  SV,
Eigen::MatrixXi &  SF 
)

Compute the surface of the swept volume of a solid object with surface (V,F) mesh under going rigid motion.

Parameters
[in]V#V by 3 list of mesh positions in reference pose
[in]F#F by 3 list of mesh indices into V
[in]transformfunction handle so that transform(t) returns the rigid transformation at time t∈[0,1]
[in]stepsnumber of time steps: steps=3 --> t∈{0,0.5,1}
[in]grid_resnumber of grid cells on the longest side containing the motion (isolevel+1 cells will also be added on each side as padding)
[in]isoleveldistance level to be contoured as swept volume
[out]SV#SV by 3 list of mesh positions of the swept surface
[out]SF#SF by 3 list of mesh faces into SV

◆ swept_volume_bounding_box()

void igl::swept_volume_bounding_box ( const size_t &  n,
const std::function< Eigen::RowVector3d(const size_t vi, const double t)> &  V,
const size_t &  steps,
Eigen::AlignedBox3d &  box 
)

Construct an axis-aligned bounding box containing a shape undergoing a motion sampled at steps discrete momements.

Parameters
[in]nnumber of mesh vertices
[in]Vfunction handle so that V(i,t) returns the 3d position of vertex i at time t, for t∈[0,1]
[in]stepsnumber of time steps: steps=3 --> t∈{0,0.5,1}
[out]boxbox containing mesh under motion

◆ swept_volume_signed_distance() [1/2]

void igl::swept_volume_signed_distance ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const std::function< Eigen::Affine3d(const double t)> &  transform,
const size_t &  steps,
const Eigen::MatrixXd &  GV,
const Eigen::RowVector3i &  res,
const double  h,
const double  isolevel,
const Eigen::VectorXd &  S0,
Eigen::VectorXd &  S 
)

Compute the signed distance to a sweep surface of a mesh under-going an arbitrary motion V(t) discretely sampled at steps-many moments in time at a grid.

Parameters
[in]V#V by 3 list of mesh positions in reference pose
[in]F#F by 3 list of triangle indices [0,n)
[in]transformfunction handle so that transform(t) returns the rigid transformation at time t∈[0,1]
[in]stepsnumber of time steps: steps=3 --> t∈{0,0.5,1}
[in]GV#GV by 3 list of evaluation point grid positions
[in]res3-long resolution of GV grid
[in]hedge-length of grid
[in]isolevelisolevel to "focus" on; grid positions far enough away from isolevel (based on h) will get approximate values). Set isolevel=infinity to get good values everywhere (slow and unnecessary if just trying to extract isolevel-level set).
[in]S0#GV initial values (will take minimum with these), can be same as S)
[out]S#GV list of signed distances

◆ swept_volume_signed_distance() [2/2]

void igl::swept_volume_signed_distance ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const std::function< Eigen::Affine3d(const double t)> &  transform,
const size_t &  steps,
const Eigen::MatrixXd &  GV,
const Eigen::RowVector3i &  res,
const double  h,
const double  isolevel,
Eigen::VectorXd &  S 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ tan_half_angle()

template<typename Scalar >
Scalar igl::tan_half_angle ( const Scalar &  a,
const Scalar &  b,
const Scalar &  c 
)

Compute the tangent of half of the angle opposite the side with length a, in a triangle with side lengths (a,b,c).

Parameters
[in]ascalar edge length of first side of triangle
[in]bscalar edge length of second side of triangle
[in]cscalar edge length of third side of triangle
Returns
tangent of half of the angle opposite side with length a
is_intrinsic_delaunay

◆ tet_tet_adjacency() [1/2]

template<typename DerivedT , typename DerivedTT , typename DerivedTTi >
void igl::tet_tet_adjacency ( const Eigen::MatrixBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedTT > &  TT,
Eigen::PlainObjectBase< DerivedTTi > &  TTi 
)

Constructs the tet_tet adjacency matrix for a given tet mesh with tets T.

Parameters
[in]T#T by 4 list of tets
[out]TT#T by #4 adjacency matrix, the element i,j is the id of the tet adjacent to the j face of tet i
[out]TTi#T by #4 adjacency matrix, the element i,j is the id of face of the tet TT(i,j) that is adjacent to tet i
Note
the first face of a tet is [0,1,2], the second [0,1,3], the third [1,2,3], and the fourth [2,0,3].

◆ tet_tet_adjacency() [2/2]

template<typename DerivedT , typename DerivedTT >
void igl::tet_tet_adjacency ( const Eigen::MatrixBase< DerivedT > &  T,
Eigen::PlainObjectBase< DerivedTT > &  TT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ tetrahedralized_grid() [1/2]

template<typename DerivedGV , typename DerivedGT >
void igl::tetrahedralized_grid ( const int  nx,
const int  ny,
const int  nz,
const TetrahedralizedGripType  type,
Eigen::PlainObjectBase< DerivedGV > &  GV,
Eigen::PlainObjectBase< DerivedGT > &  GT 
)

Construct vertices of a regular grid, suitable for input to igl::marching_tets

Parameters
[in]nxnumber of grid vertices in x direction
[in]nynumber of grid vertices in y direction
[in]nznumber of grid vertices in z direction
[in]typetype of tetrahedralization of cube to use
[out]GVnx*ny*nz by 3 list of grid vertex positions
[out]GT(nx-1)*(ny-1)*(nz-1)*k by 4 list of tetrahedron indices into rows of V, where k is the number of tets per cube (dependent on type)
See also
triangulated_grid, quad_grid

◆ tetrahedralized_grid() [2/2]

template<typename Derivedside , typename DerivedGT >
void igl::tetrahedralized_grid ( const Eigen::MatrixBase< Derivedside > &  side,
const TetrahedralizedGripType  type,
Eigen::PlainObjectBase< DerivedGT > &  GT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]side3-long list {nx,ny,nz} see above

◆ topological_hole_fill()

template<typename DerivedF , typename VectorIndex , typename DerivedF_filled >
void igl::topological_hole_fill ( const Eigen::MatrixBase< DerivedF > &  F,
const std::vector< VectorIndex > &  holes,
Eigen::PlainObjectBase< DerivedF_filled > &  F_filled 
)

Topological fill hole on a mesh, with one additional vertex each hole Index of new abstract vertices will be F.maxCoeff() + (index of hole)

Parameters
[in]F#F by simplex-size list of element indices
[in]holesvector of hole loops to fill
[out]F_filledinput F stacked with filled triangles.

◆ trackball() [1/3]

template<typename Q_type >
void igl::trackball ( const double  w,
const double  h,
const Q_type  speed_factor,
const double  down_mouse_x,
const double  down_mouse_y,
const double  mouse_x,
const double  mouse_y,
Q_type *  quat 
)

Applies a trackball drag to identity.

Parameters
[in]wwidth of the trackball context
[in]hheight of the trackball context
[in]speed_factorcontrols how fast the trackball feels, 1 is normal
[in]down_mouse_xx position of mouse down
[in]down_mouse_yy position of mouse down
[in]mouse_xcurrent x position of mouse
[in]mouse_ycurrent y position of mouse
[out]quatthe resulting rotation (as quaternion)

◆ trackball() [2/3]

template<typename Q_type >
void igl::trackball ( const double  w,
const double  h,
const Q_type  speed_factor,
const Q_type *  down_quat,
const double  down_mouse_x,
const double  down_mouse_y,
const double  mouse_x,
const double  mouse_y,
Q_type *  quat 
)

Applies a trackball drag to a given rotation.

Parameters
[in]wwidth of the trackball context
[in]hheight of the trackball context
[in]speed_factorcontrols how fast the trackball feels, 1 is normal
[in]down_quatrotation at mouse down, i.e. the rotation we're applying the trackball motion to (as quaternion)
[in]down_mouse_xx position of mouse down
[in]down_mouse_yy position of mouse down
[in]mouse_xcurrent x position of mouse
[in]mouse_ycurrent y position of mouse
[out]quatthe resulting rotation (as quaternion)

◆ trackball() [3/3]

template<typename Scalardown_quat , typename Scalarquat >
void igl::trackball ( const double  w,
const double  h,
const double  speed_factor,
const Eigen::Quaternion< Scalardown_quat > &  down_quat,
const double  down_mouse_x,
const double  down_mouse_y,
const double  mouse_x,
const double  mouse_y,
Eigen::Quaternion< Scalarquat > &  quat 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ transpose_blocks()

template<typename T >
void igl::transpose_blocks ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  A,
const size_t  k,
const size_t  dim,
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  B 
)

Transpose blocks of a matrix.

Template Parameters
Tshould be a eigen matrix primitive type like int or double
Parameters
[in]Am*k by n (dim: 1) or m by n*k (dim: 2) eigen Matrix of type T values
[in]knumber of blocks
[in]dimdimension in which to transpose
[out]Bn*k by m (dim: 1) or n by m*k (dim: 2) eigen Matrix of type T values, NOT allowed to be the same as A

Example:

A = [ 1 2 3 4 5 6 7 8 101 102 103 104 105 106 107 108 201 202 203 204 205 206 207 208]; transpose_blocks(A,1,3,B); B -> [ 1 5 2 6 3 7 4 8 101 105 102 106 103 107 104 108 201 205 202 206 203 207 204 208];

◆ tri_tri_overlap_test_3d()

template<typename DerivedP1 , typename DerivedQ1 , typename DerivedR1 , typename DerivedP2 , typename DerivedQ2 , typename DerivedR2 >
bool igl::tri_tri_overlap_test_3d ( const Eigen::MatrixBase< DerivedP1 > &  p1,
const Eigen::MatrixBase< DerivedQ1 > &  q1,
const Eigen::MatrixBase< DerivedR1 > &  r1,
const Eigen::MatrixBase< DerivedP2 > &  p2,
const Eigen::MatrixBase< DerivedQ2 > &  q2,
const Eigen::MatrixBase< DerivedR2 > &  r2 
)

◆ tri_tri_intersection_test_3d()

template<typename DerivedP1 , typename DerivedQ1 , typename DerivedR1 , typename DerivedP2 , typename DerivedQ2 , typename DerivedR2 , typename DerivedS , typename DerivedT >
bool igl::tri_tri_intersection_test_3d ( const Eigen::MatrixBase< DerivedP1 > &  p1,
const Eigen::MatrixBase< DerivedQ1 > &  q1,
const Eigen::MatrixBase< DerivedR1 > &  r1,
const Eigen::MatrixBase< DerivedP2 > &  p2,
const Eigen::MatrixBase< DerivedQ2 > &  q2,
const Eigen::MatrixBase< DerivedR2 > &  r2,
bool &  coplanar,
Eigen::MatrixBase< DerivedS > &  source,
Eigen::MatrixBase< DerivedT > &  target 
)

◆ tri_tri_overlap_test_2d()

template<typename DerivedP1 , typename DerivedQ1 , typename DerivedR1 , typename DerivedP2 , typename DerivedQ2 , typename DerivedR2 >
bool igl::tri_tri_overlap_test_2d ( const Eigen::MatrixBase< DerivedP1 > &  p1,
const Eigen::MatrixBase< DerivedQ1 > &  q1,
const Eigen::MatrixBase< DerivedR1 > &  r1,
const Eigen::MatrixBase< DerivedP2 > &  p2,
const Eigen::MatrixBase< DerivedQ2 > &  q2,
const Eigen::MatrixBase< DerivedR2 > &  r2 
)

◆ triangle_fan() [1/2]

template<typename DerivedE , typename Derivedcap >
void igl::triangle_fan ( const Eigen::MatrixBase< DerivedE > &  E,
Eigen::PlainObjectBase< Derivedcap > &  cap 
)

Given a list of faces tessellate all of the "exterior" edges forming another list of.

Parameters
[in]E#E by simplex_size-1 list of exterior edges (see exterior_edges.h)
[out]cap#cap by simplex_size list of "faces" tessellating the boundary edges

◆ triangle_fan() [2/2]

Eigen::MatrixXi igl::triangle_fan ( const Eigen::MatrixXi &  E)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ triangle_triangle_adjacency() [1/7]

template<typename DerivedF , typename DerivedTT , typename DerivedTTi >
void igl::triangle_triangle_adjacency ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedTT > &  TT,
Eigen::PlainObjectBase< DerivedTTi > &  TTi 
)

Constructs the triangle-triangle adjacency matrix for a given mesh (V,F).

Parameters
[in]F#F by simplex_size list of mesh faces (must be triangles)
[out]TT#F by #3 adjacent matrix, the element i,j is the id of the triangle adjacent to the j edge of triangle i
[out]TTi#F by #3 adjacent matrix, the element i,j is the id of edge of the triangle TT(i,j) that is adjacent with triangle i
Note
the first edge of a triangle is [0,1] the second [1,2] and the third [2,3]. This convention is DIFFERENT from cotmatrix_entries.h/edge_lengths.h/etc. To fix this you could use:
// Fix mis-match convention
{
Eigen::PermutationMatrix<3,3> perm(3);
perm.indices() = Eigen::Vector3i(1,2,0);
TT = (TT*perm).eval();
TTi = (TTi*perm).eval();
for(int i=0;i<TTi.rows();i++)
for(int j=0;j<TTi.cols();j++)
TTi(i,j)=TTi(i,j)==-1?-1:(TTi(i,j)+3-1)%3;
}

◆ triangle_triangle_adjacency() [2/7]

template<typename DerivedF , typename DerivedTT >
void igl::triangle_triangle_adjacency ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedTT > &  TT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ triangle_triangle_adjacency_preprocess()

template<typename DerivedF , typename TTT_type >
void igl::triangle_triangle_adjacency_preprocess ( const Eigen::MatrixBase< DerivedF > &  F,
std::vector< std::vector< TTT_type > > &  TTT 
)

Preprocessing for triangle_triangle_adjacency.

Parameters
[in]F#F by simplex_size list of mesh faces (must be triangles)
[in]TT#F by #3 adjacent matrix, the element i,j is the id of the triangle adjacent to the j edge of triangle i

include/igl/triangle_triangle_adjacency.h

◆ triangle_triangle_adjacency_extractTT()

template<typename DerivedF , typename TTT_type , typename DerivedTT >
void igl::triangle_triangle_adjacency_extractTT ( const Eigen::MatrixBase< DerivedF > &  F,
std::vector< std::vector< TTT_type > > &  TTT,
Eigen::PlainObjectBase< DerivedTT > &  TT 
)

Extract the face adjacencies for triangle_triangle_adjacency.

Parameters
[in]F#F by simplex_size list of mesh faces (must be triangles)
[in]TTT#F list of lists adjacent triangles
[in]TT#F by #3 adjacentmatrix, the element i,j is the id of edge of the triangle TT(i,j) that is adjacent with triangle i

include/igl/triangle_triangle_adjacency.h

◆ triangle_triangle_adjacency_extractTTi()

template<typename DerivedF , typename TTT_type , typename DerivedTTi >
void igl::triangle_triangle_adjacency_extractTTi ( const Eigen::MatrixBase< DerivedF > &  F,
std::vector< std::vector< TTT_type > > &  TTT,
Eigen::PlainObjectBase< DerivedTTi > &  TTi 
)

Extract the face adjacencies indices for triangle_triangle_adjacency.

Parameters
[in]F#F by simplex_size list of mesh faces (must be triangles)
[in]TTT#F list of lists adjacent triangles
[out]TTi#F by #3 adjacent matrix, the element i,j is the id of edge of the triangle TT(i,j) that is adjacent with triangle i

include/igl/triangle_triangle_adjacency.h

◆ triangle_triangle_adjacency() [3/7]

template<typename DerivedF , typename TTIndex , typename TTiIndex >
void igl::triangle_triangle_adjacency ( const Eigen::MatrixBase< DerivedF > &  F,
std::vector< std::vector< std::vector< TTIndex > > > &  TT,
std::vector< std::vector< std::vector< TTiIndex > > > &  TTi 
)

Adjacency list version, which works with non-manifold meshes.

Parameters
[in]F#F by 3 list of triangle indices
[out]TT#F by 3 list of lists so that TT[i][c] --> {j,k,...} means that faces j and k etc. are edge-neighbors of face i on face i's edge opposite corner c
[out]TTj#F list of lists so that TTj[i][c] --> {j,k,...} means that face TT[i][c][0] is an edge-neighbor of face i incident on the edge of face TT[i][c][0] opposite corner j, and TT[i][c][1] " corner k, etc.

◆ triangle_triangle_adjacency() [4/7]

template<typename DerivedF , typename TTIndex >
void igl::triangle_triangle_adjacency ( const Eigen::MatrixBase< DerivedF > &  F,
std::vector< std::vector< std::vector< TTIndex > > > &  TT 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ triangle_triangle_adjacency() [5/7]

template<typename DerivedF , typename TTIndex , typename TTiIndex >
void igl::triangle_triangle_adjacency ( const Eigen::MatrixBase< DerivedF > &  F,
const bool  construct_TTi,
std::vector< std::vector< std::vector< TTIndex > > > &  TT,
std::vector< std::vector< std::vector< TTiIndex > > > &  TTi 
)

◆ triangle_triangle_adjacency() [6/7]

template<typename DerivedE , typename DerivedEMAP , typename uE2EType , typename TTIndex , typename TTiIndex >
void igl::triangle_triangle_adjacency ( const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
const std::vector< std::vector< uE2EType > > &  uE2E,
const bool  construct_TTi,
std::vector< std::vector< std::vector< TTIndex > > > &  TT,
std::vector< std::vector< std::vector< TTiIndex > > > &  TTi 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]E#F*3 by 2 list of all of directed edges in order (see oriented_facets)
[in]EMAP#F*3 list of indices into uE, mapping each directed edge to unique undirected edge
[in]uE2E#uE list of lists of indices into E of coexisting edges
[in]construct_TTiwhether to compute TTi
See also
unique_edge_map, oriented_facets

◆ triangle_triangle_adjacency() [7/7]

template<typename DerivedEMAP , typename DeriveduEC , typename DeriveduEE , typename TTIndex , typename TTiIndex >
void igl::triangle_triangle_adjacency ( const Eigen::MatrixBase< DerivedEMAP > &  EMAP,
const Eigen::MatrixBase< DeriveduEC > &  uEC,
const Eigen::MatrixBase< DeriveduEE > &  uEE,
const bool  construct_TTi,
std::vector< std::vector< std::vector< TTIndex > > > &  TT,
std::vector< std::vector< std::vector< TTiIndex > > > &  TTi 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]uEC#uE+1 list of cumulative counts of directed edges sharing each unique edge so the uEC(i+1)-uEC(i) is the number of directed edges sharing the ith unique edge.
[in]uEE#E list of indices into E, so that the consecutive segment of indices uEE.segment(uEC(i),uEC(i+1)-uEC(i)) lists all directed edges sharing the ith unique edge.

◆ triangles_from_strip()

template<typename DerivedS , typename DerivedF >
void igl::triangles_from_strip ( const Eigen::MatrixBase< DerivedS > &  S,
Eigen::PlainObjectBase< DerivedF > &  F 
)

Create a list of triangles from a stream of indices along a strip.

Parameters
[in]S#S list of indices
[out]F#S-2 by 3 list of triangle indices

◆ triangulated_grid() [1/2]

template<typename XType , typename YType , typename DerivedGV , typename DerivedGF >
void igl::triangulated_grid ( const XType &  nx,
const YType &  ny,
Eigen::PlainObjectBase< DerivedGV > &  GV,
Eigen::PlainObjectBase< DerivedGF > &  GF 
)

Create a regular grid of elements (only 2D supported, currently) Vertex position order is compatible with igl::grid

Parameters
[in]nxnumber of vertices in the x direction
[in]nynumber of vertices in the y direction
[out]GVnx*ny by 2 list of mesh vertex positions.
[out]GF2*(nx-1)*(ny-1) by 3 list of triangle indices
See also
grid, quad_grid

◆ triangulated_grid() [2/2]

template<typename XType , typename YType , typename DerivedGF >
void igl::triangulated_grid ( const XType &  nx,
const YType &  ny,
Eigen::PlainObjectBase< DerivedGF > &  GF 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ turning_number()

template<typename DerivedV >
DerivedV::Scalar igl::turning_number ( const Eigen::MatrixBase< DerivedV > &  V)

Compute the turning number of a closed curve in the plane.

Parameters
[in]V#V by 2 list of vertex positions
Returns
tn turning number

◆ two_axis_valuator_fixed_up()

template<typename Scalardown_quat , typename Scalarquat >
void igl::two_axis_valuator_fixed_up ( const int  w,
const int  h,
const double  speed,
const Eigen::Quaternion< Scalardown_quat > &  down_quat,
const int  down_x,
const int  down_y,
const int  mouse_x,
const int  mouse_y,
Eigen::Quaternion< Scalarquat > &  quat 
)

Applies a two-axis valuator drag rotation (as seen in Maya/Studio max) to a given rotation.

Parameters
[in]wwidth of the trackball context
[in]hheight of the trackball context
[in]speedcontrols how fast the trackball feels, 1 is normal
[in]down_quatrotation at mouse down, i.e. the rotation we're applying the trackball motion to (as quaternion). Note: Up-vector that is fixed is with respect to this rotation.
[in]down_xposition of mouse down
[in]down_yposition of mouse down
[in]mouse_xcurrent x position of mouse
[in]mouse_ycurrent y position of mouse
[out]quatthe resulting rotation (as quaternion)
See also
snap_to_fixed_up

◆ uniformly_sample_two_manifold()

void igl::uniformly_sample_two_manifold ( const Eigen::MatrixXd &  W,
const Eigen::MatrixXi &  F,
const int  k,
const double  push,
Eigen::MatrixXd &  WS 
)

Attempt to sample a mesh uniformly with k-points by furthest point relaxation as described in "Fast Automatic Skinning Transformations" [Jacobson et al.

12] Section 3.3. The input is not expected to be a typical 3D triangle mesh (e.g., [V,F]), instead each vertex is embedded in a high dimensional unit-hypercude ("weight space") defined by W, with triangles given by F. This algorithm will first conduct furthest point sampling from the set of vertices and then attempt to relax the sampled points along the surface of the high-dimensional triangle mesh (i.e., the output points may be in the middle of triangles, not just at vertices). An additional "push" factor will repel samples away from the corners of the hypercube.

Parameters
[in]W#W by dim positions of mesh in weight space
[in]F#F by 3 indices of triangles
[in]knumber of samples
[in]pushfactor by which corners should be pushed away
[out]WSk by dim locations in weight space
See also
random_points_on_mesh

◆ uniformly_sample_two_manifold_at_vertices()

void igl::uniformly_sample_two_manifold_at_vertices ( const Eigen::MatrixXd &  W,
const int  k,
const double  push,
Eigen::VectorXi &  S 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.include/igl/uniformly_sample_two_manifold.h.

◆ unique() [1/4]

template<typename T >
void igl::unique ( const std::vector< T > &  A,
std::vector< T > &  C,
std::vector< size_t > &  IA,
std::vector< size_t > &  IC 
)

Act like matlab's [C,IA,IC] = unique(X)

Template Parameters
Tcomparable type T
Parameters
[in]A#A vector of type T
[out]C#C vector of unique entries in A
[out]IA#C index vector so that C = A(IA);
[out]IC#A index vector so that A = C(IC);

◆ unique() [2/4]

template<typename T >
void igl::unique ( const std::vector< T > &  A,
std::vector< T > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ unique() [3/4]

template<typename DerivedA , typename DerivedC , typename DerivedIA , typename DerivedIC >
void igl::unique ( const Eigen::MatrixBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedIA > &  IA,
Eigen::PlainObjectBase< DerivedIC > &  IC 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ unique() [4/4]

template<typename DerivedA , typename DerivedC >
void igl::unique ( const Eigen::MatrixBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ unique_edge_map() [1/3]

template<typename DerivedF , typename DerivedE , typename DeriveduE , typename DerivedEMAP , typename uE2EType >
void igl::unique_edge_map ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DeriveduE > &  uE,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP,
std::vector< std::vector< uE2EType > > &  uE2E 
)

Construct relationships between facet "half"-(or rather "viewed")-edges E to unique edges of the mesh seen as a graph.

Parameters
[in]F#F by 3 list of simplices
[out]E#F*3 by 2 list of all directed edges, such that E.row(f+#F*c) is the edge opposite F(f,c)
[out]uE#uE by 2 list of unique undirected edges
[out]EMAP#F*3 list of indices into uE, mapping each directed edge to unique undirected edge so that uE(EMAP(f+#F*c)) is the unique edge corresponding to E.row(f+#F*c)
[out]uE2E#uE list of lists of indices into E of coexisting edges, so that E.row(uE2E[i][j]) corresponds to uE.row(i) for all j in 0..uE2E[i].size()-1.

◆ unique_edge_map() [2/3]

template<typename DerivedF , typename DerivedE , typename DeriveduE , typename DerivedEMAP >
void igl::unique_edge_map ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DeriveduE > &  uE,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ unique_edge_map() [3/3]

template<typename DerivedF , typename DerivedE , typename DeriveduE , typename DerivedEMAP , typename DeriveduEC , typename DeriveduEE >
void igl::unique_edge_map ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedE > &  E,
Eigen::PlainObjectBase< DeriveduE > &  uE,
Eigen::PlainObjectBase< DerivedEMAP > &  EMAP,
Eigen::PlainObjectBase< DeriveduEC > &  uEC,
Eigen::PlainObjectBase< DeriveduEE > &  uEE 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

It is usual much faster if your algorithm can be written in terms of (uEC,uEE) rather than (uE2E).

Parameters
[out]uEC#uE+1 list of cumulative counts of directed edges sharing each unique edge so the uEC(i+1)-uEC(i) is the number of directed edges sharing the ith unique edge.
[out]uEE#E list of indices into E, so that the consecutive segment of indices uEE.segment(uEC(i),uEC(i+1)-uEC(i)) lists all directed edges sharing the ith unique edge.

Example:

// Using uE2E
for(int u = 0;u<uE2E.size();u++)
{
for(int i = 0;i<uE2E[u].size();i++)
{
// eth directed-edge is ith edge equivalent to uth undirected edge
e = uE2E[u][i];
}
}
// Using uEC,uEE
for(int u = 0;u<uE.size();u++)
{
for(int j = uEC(u);j<uEC(u+1);j++)
{
e = uEE(j); // i = j-uEC(u);
}
}

◆ unique_rows()

template<typename DerivedA , typename DerivedC , typename DerivedIA , typename DerivedIC >
void igl::unique_rows ( const Eigen::DenseBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< DerivedIA > &  IA,
Eigen::PlainObjectBase< DerivedIC > &  IC 
)

Act like matlab's [C,IA,IC] = unique(X,'rows')

Template Parameters
DerivedAderived scalar type, e.g. MatrixXi or MatrixXd
DerivedIAderived integer type, e.g. MatrixXi
DerivedICderived integer type, e.g. MatrixXi
Parameters
[in]Am by n matrix whose entries are to unique'd according to rows
[out]C#C vector of unique rows in A
[out]IA#C index vector so that C = A(IA,:);
[out]IC#A index vector so that A = C(IC,:);

◆ unique_simplices() [1/2]

template<typename DerivedF , typename DerivedFF , typename DerivedIA , typename DerivedIC >
void igl::unique_simplices ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedFF > &  FF,
Eigen::PlainObjectBase< DerivedIA > &  IA,
Eigen::PlainObjectBase< DerivedIC > &  IC 
)

Find combinatorially unique simplices in F.

Order independent

Parameters
[in]F#F by simplex-size list of simplices
[out]FF#FF by simplex-size list of unique simplices in F
[out]IA#FF index vector so that FF == sort(F(IA,:),2);
[out]IC#F index vector so that sort(F,2) == FF(IC,:);

◆ unique_simplices() [2/2]

template<typename DerivedF , typename DerivedFF >
void igl::unique_simplices ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedFF > &  FF 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ unproject() [1/2]

template<typename Derivedwin , typename Derivedmodel , typename Derivedproj , typename Derivedviewport , typename Derivedscene >
void igl::unproject ( const Eigen::MatrixBase< Derivedwin > &  win,
const Eigen::MatrixBase< Derivedmodel > &  model,
const Eigen::MatrixBase< Derivedproj > &  proj,
const Eigen::MatrixBase< Derivedviewport > &  viewport,
Eigen::PlainObjectBase< Derivedscene > &  scene 
)

Eigen reimplementation of gluUnproject.

Parameters
[in]win#P by 3 or 3-vector (#P=1) of screen space x, y, and z coordinates
[in]model4x4 model-view matrix
[in]proj4x4 projection matrix
[in]viewport4-long viewport vector
[out]scene#P by 3 or 3-vector (#P=1) the unprojected x, y, and z coordinates

◆ unproject() [2/2]

template<typename Scalar >
Eigen::Matrix< Scalar, 3, 1 > igl::unproject ( const Eigen::Matrix< Scalar, 3, 1 > &  win,
const Eigen::Matrix< Scalar, 4, 4 > &  model,
const Eigen::Matrix< Scalar, 4, 4 > &  proj,
const Eigen::Matrix< Scalar, 4, 1 > &  viewport 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ unproject_in_mesh() [1/3]

template<typename DerivedV , typename DerivedF , typename Derivedobj >
int igl::unproject_in_mesh ( const Eigen::Vector2f &  pos,
const Eigen::Matrix4f &  model,
const Eigen::Matrix4f &  proj,
const Eigen::Vector4f &  viewport,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< Derivedobj > &  obj,
std::vector< igl::Hit > &  hits 
)

Unproject a screen location (using current opengl viewport, projection, and model view) to a 3D position inside a given mesh.

If the ray through the given screen location (x,y) hits the mesh more than twice then the 3D midpoint between the first two hits is return. If it hits once, then that point is return. If it does not hit the mesh then obj is not set.

Parameters
[in]posscreen space coordinates
[in]modelmodel matrix
[in]projprojection matrix
[in]viewportvieweport vector
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh triangle indices into V
[out]obj3d unprojected mouse point in mesh
[out]hitsvector of hits
Returns
number of hits

◆ unproject_in_mesh() [2/3]

template<typename DerivedV , typename DerivedF , typename Derivedobj >
int igl::unproject_in_mesh ( const Eigen::Vector2f &  pos,
const Eigen::Matrix4f &  model,
const Eigen::Matrix4f &  proj,
const Eigen::Vector4f &  viewport,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< Derivedobj > &  obj 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ unproject_in_mesh() [3/3]

template<typename Derivedobj >
int igl::unproject_in_mesh ( const Eigen::Vector2f &  pos,
const Eigen::Matrix4f &  model,
const Eigen::Matrix4f &  proj,
const Eigen::Vector4f &  viewport,
const std::function< void(const Eigen::Vector3f &, const Eigen::Vector3f &, std::vector< igl::Hit > &) > &  shoot_ray,
Eigen::PlainObjectBase< Derivedobj > &  obj,
std::vector< igl::Hit > &  hits 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]shoot_rayfunction handle that outputs first hit of a given ray against a mesh (embedded in function handles as captured variable/data)

◆ unproject_on_line() [1/2]

template<typename DerivedUV , typename DerivedM , typename DerivedVP , typename Derivedorigin , typename Deriveddir >
void igl::unproject_on_line ( const Eigen::MatrixBase< DerivedUV > &  UV,
const Eigen::MatrixBase< DerivedM > &  M,
const Eigen::MatrixBase< DerivedVP > &  VP,
const Eigen::MatrixBase< Derivedorigin > &  origin,
const Eigen::MatrixBase< Deriveddir > &  dir,
typename DerivedUV::Scalar &  t 
)

Given a screen space point (u,v) and the current projection matrix (e.g.

gl_proj * gl_modelview) and viewport, unproject the point into the scene so that it lies on given line (origin and dir) and projects as closely as possible to the given screen space point.

Parameters
[in]UV2-long uv-coordinates of screen space point
[in]M4 by 4 projection matrix
[in]VP4-long viewport: (corner_u, corner_v, width, height)
[in]originpoint on line
[in]dirvector parallel to line
[out]tline parameter so that closest poin on line to viewer ray through UV lies at origin+t*dir

◆ unproject_on_line() [2/2]

template<typename DerivedUV , typename DerivedM , typename DerivedVP , typename Derivedorigin , typename Deriveddir , typename DerivedZ >
void igl::unproject_on_line ( const Eigen::MatrixBase< DerivedUV > &  UV,
const Eigen::MatrixBase< DerivedM > &  M,
const Eigen::MatrixBase< DerivedVP > &  VP,
const Eigen::MatrixBase< Derivedorigin > &  origin,
const Eigen::MatrixBase< Deriveddir > &  dir,
Eigen::PlainObjectBase< DerivedZ > &  Z 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]Z3d position of closest point on line to viewing ray through UV

◆ unproject_on_plane()

template<typename DerivedUV , typename DerivedM , typename DerivedVP , typename DerivedP , typename DerivedZ >
void igl::unproject_on_plane ( const Eigen::MatrixBase< DerivedUV > &  UV,
const Eigen::MatrixBase< DerivedM > &  M,
const Eigen::MatrixBase< DerivedVP > &  VP,
const Eigen::MatrixBase< DerivedP > &  P,
Eigen::PlainObjectBase< DerivedZ > &  Z 
)

Given a screen space point (u,v) and the current projection matrix (e.g.

gl_proj * gl_modelview) and viewport, unproject the point into the scene so that it lies on given plane.

Parameters
[in]UV2-long uv-coordinates of screen space point
[in]M4 by 4 projection matrix
[in]VP4-long viewport: (corner_u, corner_v, width, height)
[in]P4-long plane equation coefficients: P*(X 1) = 0
[out]Z3-long world coordinate

◆ unproject_onto_mesh() [1/2]

template<typename DerivedV , typename DerivedF , typename Derivedbc >
bool igl::unproject_onto_mesh ( const Eigen::Vector2f &  pos,
const Eigen::Matrix4f &  model,
const Eigen::Matrix4f &  proj,
const Eigen::Vector4f &  viewport,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
int &  fid,
Eigen::PlainObjectBase< Derivedbc > &  bc 
)

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.

Parameters
[in]posscreen space coordinates
[in]modelmodel matrix
[in]projprojection matrix
[in]viewportvieweport vector
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of mesh triangle indices into V
[out]fidid of the first face hit
[out]bcbarycentric coordinates of hit
Returns
true if there's a hit

Example:

...
igl::unproject_onto_mesh(
pos,vr.core().view,vr.core().proj,vr.core().viewport,V,F,fid,bc);

◆ unproject_onto_mesh() [2/2]

template<typename Derivedbc >
bool igl::unproject_onto_mesh ( const Eigen::Vector2f &  pos,
const Eigen::Matrix4f &  model,
const Eigen::Matrix4f &  proj,
const Eigen::Vector4f &  viewport,
const std::function< bool(const Eigen::Vector3f &, const Eigen::Vector3f &, igl::Hit &) > &  shoot_ray,
int &  fid,
Eigen::PlainObjectBase< Derivedbc > &  bc 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]shoot_rayfunction handle that outputs hits of a given ray against a mesh (embedded in function handles as captured variable/data)

◆ unproject_ray()

template<typename Derivedpos , typename Derivedmodel , typename Derivedproj , typename Derivedviewport , typename Deriveds , typename Deriveddir >
void igl::unproject_ray ( const Eigen::MatrixBase< Derivedpos > &  pos,
const Eigen::MatrixBase< Derivedmodel > &  model,
const Eigen::MatrixBase< Derivedproj > &  proj,
const Eigen::MatrixBase< Derivedviewport > &  viewport,
Eigen::PlainObjectBase< Deriveds > &  s,
Eigen::PlainObjectBase< Deriveddir > &  dir 
)

Construct a ray (source point + direction vector) given a screen space positions (e.g.

mouse) and a model-view projection constellation.

Parameters
[in]pos2d screen-space position (x,y)
[in]model4x4 model-view matrix
[in]proj4x4 projection matrix
[in]viewport4-long viewport vector
[out]ssource of ray (pos unprojected with z=0)
[out]dirdirection of ray (d - s) where d is pos unprojected with z=1

◆ unzip_corners()

template<typename DerivedA , typename DerivedU , typename DerivedG , typename DerivedJ >
void igl::unzip_corners ( const std::vector< std::reference_wrapper< DerivedA > > &  A,
Eigen::PlainObjectBase< DerivedU > &  U,
Eigen::PlainObjectBase< DerivedG > &  G,
Eigen::PlainObjectBase< DerivedJ > &  J 
)

Given a triangle mesh where corners of each triangle index different matrices of attributes (e.g.

read from an OBJ file), unzip the corners into unique efficiently: attributes become properly vertex valued (usually creating greater than #V but less than #F*3 vertices).

To pass a list of attributes this function takes an std::vector of std::reference_wrapper of an Eigen::... type. This allows you to use list initializers without incurring a copy, but means you'll need to provide the derived type of A as an explicit template parameter:

 unzip_corners<Eigen::MatrixXi>({F,FTC,FN},U,G,J);
Parameters
[in]A#A list of #F by 3 attribute indices, typically {F,FTC,FN}
[out]U#U by #A list of indices into each attribute for each unique mesh vertex: U(v,a) is the attribute index of vertex v in attribute a.
[out]G#F by 3 list of triangle indices into U
[out]J#F*3 by 1 list of indices so that A[](i,j) = U.row(i+j*#F)

Matlibberish Example

[V,F,TC,FTC] = readOBJ('~/Downloads/kiwis/kiwi.obj'); [U,G] = unzip_corners(cat(3,F,FTC)); % display mesh tsurf(G,V(U(:,1),:)); % display texture coordinates tsurf(G,TC(U(:,2),:));

◆ upsample() [1/3]

template<typename DerivedF , typename SType , typename DerivedNF >
void igl::upsample ( const int  n_verts,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< SType > &  S,
Eigen::PlainObjectBase< DerivedNF > &  NF 
)

Subdivide without moving vertices: Given the triangle mesh [V, F], where n_verts = V.rows(), computes newV and a sparse matrix S s.t.

[newV, newF] is the subdivided mesh where newV = S*V.

Parameters
[in]n_vertsan integer (number of mesh vertices)
[in]Fan m by 3 matrix of integers of triangle faces
[out]Sa sparse matrix (will become the subdivision matrix)
[out]newFa matrix containing the new faces

◆ upsample() [2/3]

template<typename DerivedV , typename DerivedF , typename DerivedNV , typename DerivedNF >
void igl::upsample ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedNV > &  NV,
Eigen::PlainObjectBase< DerivedNF > &  NF,
const int  number_of_subdivs = 1 
)

Subdivide a mesh without moving vertices: loop subdivision but odd vertices stay put and even vertices are just edge midpoints.

Template Parameters
MatVmatrix for vertex positions, e.g. MatrixXd
MatFmatrix for vertex positions, e.g. MatrixXi
Parameters
[in]V#V by dim mesh vertices
[in]F#F by 3 mesh triangles
[out]NVnew vertex positions, V is guaranteed to be at top
[out]NFnew list of face indices
Note
V should not be the same as NV,
F should not be the same as NF, use other proto
Precondition
assumes (V,F) is edge-manifold.

◆ upsample() [3/3]

template<typename MatV , typename MatF >
void igl::upsample ( MatV &  V,
MatF &  F,
const int  number_of_subdivs = 1 
)

◆ vector_area_matrix()

template<typename DerivedF , typename Scalar >
void igl::vector_area_matrix ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::SparseMatrix< Scalar > &  A 
)

Constructs the symmetric area matrix A, s.t.

[V.col(0)' V.col(1)'] * A * [V.col(0); V.col(1)] is the vector area of the mesh (V,F).

Template Parameters
DerivedVderived type of eigen matrix for V (e.g. derived from MatrixXd)
DerivedFderived type of eigen matrix for F (e.g. derived from MatrixXi)
Scalarscalar type for eigen sparse matrix (e.g. double)
Parameters
[in]F#F by 3 list of mesh faces (must be triangles)
[out]A#Vx2 by #Vx2 area matrix

◆ verbose()

int igl::verbose ( const char *  msg,
  ... 
)
inline

Provide a wrapper for printf, called verbose that functions exactly like printf if VERBOSE is defined and does exactly nothing if VERBOSE is undefined.

Parameters
[in]msgprintf style format string
[in]...printf style arguments
Returns
number of characters printed

◆ vertex_components() [1/3]

template<typename DerivedA , typename DerivedC , typename Derivedcounts >
void igl::vertex_components ( const Eigen::SparseCompressedBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedC > &  C,
Eigen::PlainObjectBase< Derivedcounts > &  counts 
)

Compute connected components of a graph represented by an adjacency matrix.

Outputs a component ID per vertex of the graph where connectivity is established by edges.

Parameters
[in]An by n adjacency matrix
[out]Cn list of component ids (starting with 0)
[out]counts#components list of counts for each component

◆ vertex_components() [2/3]

template<typename DerivedA , typename DerivedC >
void igl::vertex_components ( const Eigen::SparseCompressedBase< DerivedA > &  A,
Eigen::PlainObjectBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ vertex_components() [3/3]

template<typename DerivedF , typename DerivedC >
void igl::vertex_components ( const Eigen::MatrixBase< DerivedF > &  F,
Eigen::PlainObjectBase< DerivedC > &  C 
)

Compute the connected components for a mesh given its faces.

Returns a component ID per vertex of the mesh where connectivity is established by edges.

For computing connected components per face see igl::facet_components

Parameters
[in]Fn by 3 list of triangle indices
[out]Cmax(F) list of component ids

◆ vertex_triangle_adjacency() [1/3]

template<typename DerivedF , typename VFType , typename VFiType >
void igl::vertex_triangle_adjacency ( const typename DerivedF::Scalar  n,
const Eigen::MatrixBase< DerivedF > &  F,
std::vector< std::vector< VFType > > &  VF,
std::vector< std::vector< VFiType > > &  VFi 
)

vertex_face_adjacency constructs the vertex-face topology of a given mesh (V,F)

Parameters
[in]nnumber of vertices #V (e.g. F.maxCoeff()+1 or V.rows())
[in]F#F by dim list of mesh faces (must be triangles)
[out]VF#V list of lists of incident faces (adjacency list)
[out]VI#V list of lists of index of incidence within incident faces listed in VF
See also
edges, cotmatrix, diag, vv

◆ vertex_triangle_adjacency() [2/3]

template<typename DerivedV , typename DerivedF , typename IndexType >
void igl::vertex_triangle_adjacency ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
std::vector< std::vector< IndexType > > &  VF,
std::vector< std::vector< IndexType > > &  VFi 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ vertex_triangle_adjacency() [3/3]

template<typename DerivedF , typename DerivedVF , typename DerivedNI >
void igl::vertex_triangle_adjacency ( const Eigen::MatrixBase< DerivedF > &  F,
const int  n,
Eigen::PlainObjectBase< DerivedVF > &  VF,
Eigen::PlainObjectBase< DerivedNI > &  NI 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]F#F by 3 list of triangle indices into some vertex list V
[in]nnumber of vertices, #V (e.g., F.maxCoeff()+1)
[out]VF3*#F list List of faces indice on each vertex, so that VF(NI(i)+j) = f, means that face f is the jth face (in no particular order) incident on vertex i.
[out]NI#V+1 list cumulative sum of vertex-triangle degrees with a preceeding zero. "How many faces" have been seen before visiting this vertex and its incident faces.

◆ volume() [1/3]

template<typename DerivedV , typename DerivedT , typename Derivedvol >
void igl::volume ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedT > &  T,
Eigen::PlainObjectBase< Derivedvol > &  vol 
)

Compute volume for all tets of a given tet mesh (V,T)

Parameters
[in]V#V by dim list of vertex positions
[in]T#T by 4 list of tet indices
[out]vol#T list of tetrahedron volumes

◆ volume() [2/3]

template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedD , typename Derivedvol >
void igl::volume ( const Eigen::MatrixBase< DerivedA > &  A,
const Eigen::MatrixBase< DerivedB > &  B,
const Eigen::MatrixBase< DerivedC > &  C,
const Eigen::MatrixBase< DerivedD > &  D,
Eigen::PlainObjectBase< Derivedvol > &  vol 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]A#V by dim list of first corner position
[in]B#V by dim list of second corner position
[in]C#V by dim list of third corner position
[in]D#V by dim list of fourth corner position

◆ volume_single()

template<typename VecA , typename VecB , typename VecC , typename VecD >
VecA::Scalar igl::volume_single ( const VecA &  a,
const VecB &  b,
const VecC &  c,
const VecD &  d 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Single tet

◆ volume() [3/3]

template<typename DerivedL , typename Derivedvol >
void igl::volume ( const Eigen::MatrixBase< DerivedL > &  L,
Eigen::PlainObjectBase< Derivedvol > &  vol 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Intrinsic version:

Parameters
[in]L#V by 6 list of edge lengths (see edge_lengths)

◆ voxel_grid() [1/2]

template<typename Scalar , typename DerivedGV , typename Derivedside >
void igl::voxel_grid ( const Eigen::AlignedBox< Scalar, 3 > &  box,
const int  s,
const int  pad_count,
Eigen::PlainObjectBase< DerivedGV > &  GV,
Eigen::PlainObjectBase< Derivedside > &  side 
)

Construct the cell center positions of a regular voxel grid (lattice) made of perfectly square voxels.

Parameters
[in]boxbounding box to enclose by grid
[in]snumber of cell centers on largest side (including 2*pad_count)
[in]pad_countnumber of cells beyond box
[out]GVside(0)*side(1)*side(2) by 3 list of cell center positions
[out]side1 by 3 list of dimension of voxel grid

◆ voxel_grid() [2/2]

template<typename DerivedV , typename DerivedGV , typename Derivedside >
void igl::voxel_grid ( const Eigen::MatrixBase< DerivedV > &  V,
const typename DerivedV::Scalar  offset,
const int  s,
const int  pad_count,
Eigen::PlainObjectBase< DerivedGV > &  GV,
Eigen::PlainObjectBase< Derivedside > &  side 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]offsetoffset to add to each cell center

◆ winding_number() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedO , typename DerivedW >
void igl::winding_number ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedO > &  O,
Eigen::PlainObjectBase< DerivedW > &  W 
)

Computes the generalized winding number at each dim-dimensional query point in O with respect to the oriented one-codimensional mesh (V,F).

This is equivalent to summing the subtended signed angles/solid angles of each element in (V,F). See, "Robust Inside-Outside Segmentation using Generalized Winding Numbers" [Jacobson et al. 2013].

Parameters
[in]V#V by dim list of mesh vertex positions
[in]F#F by dim list of mesh facets as indices into rows of V. If dim==2, then (V,F) describes a set of edges in the plane. If dim==3, then (V,F) describes a triangle mesh/soup.
[in]O#O by dim list of query points
[out]W#O by 1 list of winding numbers
See also
fast_winding_number

◆ winding_number() [2/2]

template<typename DerivedV , typename DerivedF , typename Derivedp >
DerivedV::Scalar igl::winding_number ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< Derivedp > &  p 
)

Compute winding number of a single point.

Parameters
[in]Vn by dim list of vertex positions
[in]F#F by dim list of triangle indices, minimum index is 0
[in]psingle origin position
[out]wwinding number of this point

◆ write_triangle_mesh()

template<typename DerivedV , typename DerivedF >
bool igl::write_triangle_mesh ( const std::string  str,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
FileEncoding  encoding = FileEncoding::Ascii 
)

write mesh to a file with automatic detection of file format.

supported: obj, off, stl, wrl, ply, mesh).

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Indextype for indices (will be read as int and cast to Index)
Parameters
[in]strpath to file
[in]Veigen double matrix #V by 3
[in]Feigen int matrix #F by 3
[in]encodingset file encoding (ascii or binary) when both are available
Returns
true iff success

◆ writeBF()

template<typename DerivedWI , typename DerivedP , typename DerivedO >
bool igl::writeBF ( const std::string &  filename,
const Eigen::PlainObjectBase< DerivedWI > &  WI,
const Eigen::PlainObjectBase< DerivedP > &  P,
const Eigen::PlainObjectBase< DerivedO > &  O 
)

Write a bones forest to a file.

Parameters
[in]file_namepath to .bf bones tree file
[in]WI#B list of unique weight indices
[in]P#B list of parent indices into B, -1 for roots
[in]O#B list of tip offsets
Returns
true on success, false on errors
See also
readBF

◆ writeDMAT() [1/3]

template<typename DerivedW >
bool igl::writeDMAT ( const std::string  file_name,
const Eigen::MatrixBase< DerivedW > &  W,
const bool  ascii = true 
)

Write a matrix using ascii dmat file type.

Template Parameters
Matmatrix type that supports .rows(), .cols(), operator(i,j)
Parameters
[in]file_namepath to .dmat file
[in]Weigen matrix containing to-be-written coefficients
[in]asciiwrite ascii file {true}
Returns
true on success, false on error
See also
readDMAT

◆ writeDMAT() [2/3]

template<typename Scalar >
bool igl::writeDMAT ( const std::string  file_name,
const std::vector< std::vector< Scalar > > &  W,
const bool  ascii = true 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writeDMAT() [3/3]

template<typename Scalar >
bool igl::writeDMAT ( const std::string  file_name,
const std::vector< Scalar > &  W,
const bool  ascii = true 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writeMESH() [1/2]

template<typename Scalar , typename Index >
bool igl::writeMESH ( const std::string  mesh_file_name,
const std::vector< std::vector< Scalar > > &  V,
const std::vector< std::vector< Index > > &  T,
const std::vector< std::vector< Index > > &  F 
)

save a tetrahedral volume mesh to a .mesh file

Template Parameters
Scalartype for positions and vectors (will be cast as double)
Indextype for indices (will be cast to int)
Parameters
[in]mesh_file_namepath of .mesh file
[in]Vdouble matrix of vertex positions #V by 3
[in]T#T list of tet indices into vertex positions
[in]F#F list of face indices into vertex positions
Returns
true on success, false on errors

◆ writeMESH() [2/2]

template<typename DerivedV , typename DerivedT , typename DerivedF >
bool igl::writeMESH ( const std::string  str,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedT > &  T,
const Eigen::MatrixBase< DerivedF > &  F 
)

save a tetrahedral volume mesh to a .mesh file

Template Parameters
DerivedVreal-value: i.e. from MatrixXd
DerivedTinteger-value: i.e. from MatrixXi
DerivedFinteger-value: i.e. from MatrixXi
Parameters
[in]mesh_file_namepath of .mesh file
[in]Veigen double matrix #V by 3
[in]Teigen int matrix #T by 4
[in]Feigen int matrix #F by 3
Returns
true on success, false on errors

◆ writeMSH()

bool igl::writeMSH ( const std::string &  msh,
const Eigen::MatrixXd &  X,
const Eigen::MatrixXi &  Tri,
const Eigen::MatrixXi &  Tet,
const Eigen::MatrixXi &  TriTag,
const Eigen::MatrixXi &  TetTag,
const std::vector< std::string > &  XFields,
const std::vector< Eigen::MatrixXd > &  XF,
const std::vector< std::string > &  EFields,
const std::vector< Eigen::MatrixXd > &  TriF,
const std::vector< Eigen::MatrixXd > &  TetF 
)

write triangle surface mesh and tetrahedral volume mesh to .msh file

Parameters
[in]msh- file name
[in]Xeigen double matrix of vertex positions #X by 3
[in]Tri#Tri eigen integer matrix of triangular faces indices into vertex positions
[in]Tet#Tet eigen integer matrix of tetrahedral indices into vertex positions
[in]TriTag#Tri eigen integer vector of tags associated with surface faces
[in]TetTag#Tet eigen integer vector of tags associated with volume elements
[in]XFields#XFields list of strings with field names associated with nodes
[in]XF#XFields list of eigen double matrices, fields associated with nodes
[in]EFields#EFields list of strings with field names associated with elements
[in]TriF#EFields list of eigen double matrices, fields associated with surface elements
[in]TetF#EFields list of eigen double matrices, fields associated with volume elements

◆ writeOBJ() [1/3]

template<typename DerivedV , typename DerivedF , typename DerivedCN , typename DerivedFN , typename DerivedTC , typename DerivedFTC >
bool igl::writeOBJ ( const std::string  str,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedCN > &  CN,
const Eigen::MatrixBase< DerivedFN > &  FN,
const Eigen::MatrixBase< DerivedTC > &  TC,
const Eigen::MatrixBase< DerivedFTC > &  FTC 
)

Write a mesh in an ascii obj file.

Parameters
[in]strpath to outputfile
[in]V#V by 3 mesh vertex positions
[in]F#F by 3|4 mesh indices into V
[in]CN#CN by 3 normal vectors
[in]FN#F by 3|4 corner normal indices into CN
[in]TC#TC by 2|3 texture coordinates
[in]FTC#F by 3|4 corner texture coord indices into TC
Returns
true on success, false on error
See also
readOBJ

◆ writeOBJ() [2/3]

template<typename DerivedV , typename DerivedF >
bool igl::writeOBJ ( const std::string  str,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writeOBJ() [3/3]

template<typename DerivedV , typename T >
bool igl::writeOBJ ( const std::string &  str,
const Eigen::MatrixBase< DerivedV > &  V,
const std::vector< std::vector< T > > &  F 
)

Write a mesh of mixed tris and quads to an ascii obj file.

Parameters
[in]strpath to outputfile
[in]V#V by 3 mesh vertex positions
[in]F#F std::vector of std::vector<Index> of size 3 or 4 mesh indices into V
Returns
true on success, false on error

◆ writeOFF() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedC >
bool igl::writeOFF ( const std::string  str,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedC > &  C 
)

Export geometry and colors-by-vertex to an ascii OFF file.

Only triangle meshes are supported

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Indextype for indices (will be read as int and cast to Index)
Parameters
[in]strpath to .off output file
[in]V#V by 3 mesh vertex positions
[in]F#F by 3 mesh indices into V
[in]Cdouble matrix of rgb values per vertex #V by 3
Returns
true on success, false on errors

◆ writeOFF() [2/2]

template<typename DerivedV , typename DerivedF >
bool igl::writeOFF ( const std::string  str,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writePLY() [1/10]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV , typename DerivedVD , typename DerivedFD , typename DerivedED >
bool igl::writePLY ( std::ostream &  ply_stream,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedUV > &  UV,
const Eigen::MatrixBase< DerivedVD > &  VD,
const std::vector< std::string > &  VDheader,
const Eigen::MatrixBase< DerivedFD > &  FD,
const std::vector< std::string > &  FDheader,
const Eigen::MatrixBase< DerivedED > &  ED,
const std::vector< std::string > &  EDheader,
const std::vector< std::string > &  comments,
FileEncoding  encoding 
)

write triangular mesh to ply file

Template Parameters
Derivedfrom Eigen matrix parameters
Parameters
[in]ply_streamply file output stream
[in]V(#V,3) matrix of vertex positions
[in]F(#F,3) list of face indices into vertex positions
[in]E(#E,2) list of edge indices into vertex positions
[in]N(#V,3) list of normals
[in]UV(#V,2) list of texture coordinates
[in]VD(#V,*) additional vertex data
[in]Vheader(#V) list of vertex data headers
[in]FD(#F,*) additional face data
[in]Fheader(#F) list of face data headers
[in]ED(#E,*) additional edge data
[in]Eheader(#E) list of edge data headers
[in]comments(*) file comments
[in]encoding- enum, to set binary or ascii file format
Returns
true on success, false on errors

◆ writePLY() [2/10]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV , typename DerivedVD , typename DerivedFD , typename DerivedED >
bool igl::writePLY ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedUV > &  UV,
const Eigen::MatrixBase< DerivedVD > &  VD,
const std::vector< std::string > &  VDheader,
const Eigen::MatrixBase< DerivedFD > &  FD,
const std::vector< std::string > &  FDheader,
const Eigen::MatrixBase< DerivedED > &  ED,
const std::vector< std::string > &  EDheader,
const std::vector< std::string > &  comments,
FileEncoding  encoding 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]filenamepath to .ply file

◆ writePLY() [3/10]

template<typename DerivedV , typename DerivedF >
bool igl::writePLY ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writePLY() [4/10]

template<typename DerivedV , typename DerivedF , typename DerivedE >
bool igl::writePLY ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedF > &  E 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writePLY() [5/10]

template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedUV >
bool igl::writePLY ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedUV > &  UV 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writePLY() [6/10]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV >
bool igl::writePLY ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedUV > &  UV 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writePLY() [7/10]

template<typename DerivedV , typename DerivedF >
bool igl::writePLY ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
FileEncoding  encoding 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writePLY() [8/10]

template<typename DerivedV , typename DerivedF , typename DerivedE >
bool igl::writePLY ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
FileEncoding  encoding 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writePLY() [9/10]

template<typename DerivedV , typename DerivedF , typename DerivedN , typename DerivedUV , typename DerivedVD >
bool igl::writePLY ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedUV > &  UV,
const Eigen::MatrixBase< DerivedVD > &  VD = Eigen::MatrixXd(0, 0),
const std::vector< std::string > &  VDheader = {},
const std::vector< std::string > &  comments = {} 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writePLY() [10/10]

template<typename DerivedV , typename DerivedF , typename DerivedE , typename DerivedN , typename DerivedUV , typename DerivedVD >
bool igl::writePLY ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedE > &  E,
const Eigen::MatrixBase< DerivedN > &  N,
const Eigen::MatrixBase< DerivedUV > &  UV,
const Eigen::MatrixBase< DerivedVD > &  VD = Eigen::MatrixXd(0, 0),
const std::vector< std::string > &  VDheader = {},
const std::vector< std::string > &  comments = {} 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writeSTL() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedN >
bool igl::writeSTL ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedN > &  N,
FileEncoding  encoding = FileEncoding::Ascii 
)

Write a mesh to an stl file.

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Parameters
[in]filenamepath to .obj file
[in]Vdouble matrix of vertex positions #F*3 by 3
[in]Findex matrix of triangle indices #F by 3
[in]Ndouble matrix of vertex positions #F by 3
[in]encodingenum to set file encoding (ascii by default)
Returns
true on success, false on errors

◆ writeSTL() [2/2]

template<typename DerivedV , typename DerivedF >
bool igl::writeSTL ( const std::string &  filename,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
FileEncoding  encoding = FileEncoding::Ascii 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writeTGF() [1/2]

bool igl::writeTGF ( const std::string  tgf_filename,
const std::vector< std::vector< double > > &  C,
const std::vector< std::vector< int > > &  E 
)

Write a graph to a .tgf file.

Parameters
[in]filename.tgf file name
[in]V# vertices by 3 list of vertex positions
[in]E# edges by 2 list of edge indices
Precondition
Assumes that graph vertices are 3 dimensional
See also
readTGF

◆ writeTGF() [2/2]

bool igl::writeTGF ( const std::string  tgf_filename,
const Eigen::MatrixXd &  C,
const Eigen::MatrixXi &  E 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ writeWRL() [1/2]

template<typename DerivedV , typename DerivedF >
bool igl::writeWRL ( const std::string &  str,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F 
)

Write mesh to a .wrl file.

Parameters
[in]strpath to .wrl file
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of triangle indices
Returns
true iff succes

◆ writeWRL() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedC >
bool igl::writeWRL ( const std::string &  str,
const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedF > &  F,
const Eigen::MatrixBase< DerivedC > &  C 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]Cdouble matrix of rgb values per vertex #V by 3

Variable Documentation

◆ IDENTITY_QUAT_F

const float igl::IDENTITY_QUAT_F[4] = {0,0,0,1}

◆ XY_PLANE_QUAT_F

const float igl::XY_PLANE_QUAT_F[4] = {0,0,0,1}

◆ XZ_PLANE_QUAT_F

const float igl::XZ_PLANE_QUAT_F[4] = {-SQRT_2_OVER_2,0,0,SQRT_2_OVER_2}

◆ YZ_PLANE_QUAT_F

const float igl::YZ_PLANE_QUAT_F[4] = {-0.5,-0.5,-0.5,0.5}

◆ CANONICAL_VIEW_QUAT_F

const float igl::CANONICAL_VIEW_QUAT_F[][4]

◆ IDENTITY_QUAT_D

const double igl::IDENTITY_QUAT_D[4] = {0,0,0,1}

◆ XY_PLANE_QUAT_D

const double igl::XY_PLANE_QUAT_D[4] = {0,0,0,1}

◆ XZ_PLANE_QUAT_D

const double igl::XZ_PLANE_QUAT_D[4] = {-SQRT_2_OVER_2,0,0,SQRT_2_OVER_2}

◆ YZ_PLANE_QUAT_D

const double igl::YZ_PLANE_QUAT_D[4] = {-0.5,-0.5,-0.5,0.5}

◆ CANONICAL_VIEW_QUAT_D

const double igl::CANONICAL_VIEW_QUAT_D[][4]

◆ DOUBLE_EPS

const double igl::DOUBLE_EPS = 1.0e-14

Standard value for double epsilon.

◆ DOUBLE_EPS_SQ

const double igl::DOUBLE_EPS_SQ = 1.0e-28

Standard value for double epsilon²

◆ FLOAT_EPS

const float igl::FLOAT_EPS = 1.0e-7f

Standard value for single epsilon.

◆ FLOAT_EPS_SQ

const float igl::FLOAT_EPS_SQ = 1.0e-14f

Standard value for single epsilon²

◆ GOLD_AMBIENT

const float igl::GOLD_AMBIENT[4] = { 51.0/255.0, 43.0/255.0,33.3/255.0,1.0f }

◆ GOLD_DIFFUSE

const float igl::GOLD_DIFFUSE[4] = { 255.0/255.0,228.0/255.0,58.0/255.0,1.0f }

◆ GOLD_SPECULAR

const float igl::GOLD_SPECULAR[4] = { 255.0/255.0,235.0/255.0,80.0/255.0,1.0f }

◆ SILVER_AMBIENT

const float igl::SILVER_AMBIENT[4] = { 0.2f, 0.2f, 0.2f, 1.0f }

◆ SILVER_DIFFUSE

const float igl::SILVER_DIFFUSE[4] = { 1.0f, 1.0f, 1.0f, 1.0f }

◆ SILVER_SPECULAR

const float igl::SILVER_SPECULAR[4] = { 1.0f, 1.0f, 1.0f, 1.0f }

◆ CYAN_AMBIENT

const float igl::CYAN_AMBIENT[4] = { 59.0/255.0, 68.0/255.0,255.0/255.0,1.0f }

◆ CYAN_DIFFUSE

const float igl::CYAN_DIFFUSE[4] = { 94.0/255.0,185.0/255.0,238.0/255.0,1.0f }

◆ CYAN_SPECULAR

const float igl::CYAN_SPECULAR[4] = { 163.0/255.0,221.0/255.0,255.0/255.0,1.0f }

◆ DENIS_PURPLE_DIFFUSE

const float igl::DENIS_PURPLE_DIFFUSE[4] = { 80.0/255.0,64.0/255.0,255.0/255.0,1.0f }

◆ LADISLAV_ORANGE_DIFFUSE

const float igl::LADISLAV_ORANGE_DIFFUSE[4] = {1.0f, 125.0f / 255.0f, 19.0f / 255.0f, 0.0f}

◆ FAST_GREEN_DIFFUSE

const float igl::FAST_GREEN_DIFFUSE[4] = { 113.0f/255.0f, 239.0f/255.0f, 46.0f/255.0f, 1.0f}

◆ FAST_RED_DIFFUSE

const float igl::FAST_RED_DIFFUSE[4] = { 255.0f/255.0f, 65.0f/255.0f, 46.0f/255.0f, 1.0f}

◆ FAST_BLUE_DIFFUSE

const float igl::FAST_BLUE_DIFFUSE[4] = { 106.0f/255.0f, 106.0f/255.0f, 255.0f/255.0f, 1.0f}

◆ FAST_GRAY_DIFFUSE

const float igl::FAST_GRAY_DIFFUSE[4] = { 150.0f/255.0f, 150.0f/255.0f, 150.0f/255.0f, 1.0f}

◆ WHITE

const float igl::WHITE[4] = { 255.0/255.0,255.0/255.0,255.0/255.0,1.0f }

◆ BLACK

const float igl::BLACK[4] = { 0.0/255.0,0.0/255.0,0.0/255.0,1.0f }

◆ WHITE_AMBIENT

const float igl::WHITE_AMBIENT[4] = { 255.0/255.0,255.0/255.0,255.0/255.0,1.0f }

◆ WHITE_DIFFUSE

const float igl::WHITE_DIFFUSE[4] = { 255.0/255.0,255.0/255.0,255.0/255.0,1.0f }

◆ WHITE_SPECULAR

const float igl::WHITE_SPECULAR[4] = { 255.0/255.0,255.0/255.0,255.0/255.0,1.0f }

◆ BBW_POINT_COLOR

const float igl::BBW_POINT_COLOR[4] = {239./255.,213./255.,46./255.,255.0/255.0}

◆ BBW_LINE_COLOR

const float igl::BBW_LINE_COLOR[4] = {106./255.,106./255.,255./255.,255./255.}

◆ MIDNIGHT_BLUE_DIFFUSE

const float igl::MIDNIGHT_BLUE_DIFFUSE[4] = { 21.0f/255.0f, 27.0f/255.0f, 84.0f/255.0f, 1.0f}

◆ EASTER_RED_DIFFUSE

const float igl::EASTER_RED_DIFFUSE[4] = {0.603922,0.494118f,0.603922f,1.0f}

◆ WN_OPEN_BOUNDARY_COLOR

const float igl::WN_OPEN_BOUNDARY_COLOR[4] = {154./255.,0./255.,0./255.,1.0f}

◆ WN_NON_MANIFOLD_EDGE_COLOR

const float igl::WN_NON_MANIFOLD_EDGE_COLOR[4] = {201./255., 51./255.,255./255.,1.0f}

◆ CHAR_ONE

const char igl::CHAR_ONE = 1

Often one needs a reference to a dummy variable containing one as its value, for example when using AntTweakBar's TwSetParam( "3D View", "opened", TW_PARAM_INT32, 1, &INT_ONE);.

◆ INT_ONE

const int igl::INT_ONE = 1

◆ UNSIGNED_INT_ONE

const unsigned int igl::UNSIGNED_INT_ONE = 1

◆ DOUBLE_ONE

const double igl::DOUBLE_ONE = 1

◆ FLOAT_ONE

const float igl::FLOAT_ONE = 1

◆ PI

constexpr double igl::PI = 3.1415926535897932384626433832795
constexpr

π

◆ CHAR_ZERO

const char igl::CHAR_ZERO = 0

◆ INT_ZERO

const int igl::INT_ZERO = 0

◆ UNSIGNED_INT_ZERO

const unsigned int igl::UNSIGNED_INT_ZERO = 0

◆ DOUBLE_ZERO

const double igl::DOUBLE_ZERO = 0

◆ FLOAT_ZERO

const float igl::FLOAT_ZERO = 0