├── CMakeLists.txt ├── LICENSE ├── README.md ├── bunnyhole.off ├── img ├── bunnymontage.png └── spheremontage.png ├── libigl ├── eigen │ ├── Eigen │ │ ├── Array │ │ ├── CMakeLists.txt │ │ ├── Cholesky │ │ ├── CholmodSupport │ │ ├── Core │ │ ├── Dense │ │ ├── Eigen │ │ ├── Eigen2Support │ │ ├── Eigenvalues │ │ ├── Geometry │ │ ├── Householder │ │ ├── IterativeLinearSolvers │ │ ├── Jacobi │ │ ├── LU │ │ ├── LeastSquares │ │ ├── MetisSupport │ │ ├── OrderingMethods │ │ ├── PaStiXSupport │ │ ├── PardisoSupport │ │ ├── QR │ │ ├── QtAlignedMalloc │ │ ├── SPQRSupport │ │ ├── SVD │ │ ├── Sparse │ │ ├── SparseCholesky │ │ ├── SparseCore │ │ ├── SparseLU │ │ ├── SparseQR │ │ ├── StdDeque │ │ ├── StdList │ │ ├── StdVector │ │ ├── SuperLUSupport │ │ ├── UmfPackSupport │ │ └── src │ │ │ ├── CMakeLists.txt │ │ │ ├── Cholesky │ │ │ ├── CMakeLists.txt │ │ │ ├── LDLT.h │ │ │ ├── LLT.h │ │ │ └── LLT_MKL.h │ │ │ ├── CholmodSupport │ │ │ ├── CMakeLists.txt │ │ │ └── CholmodSupport.h │ │ │ ├── Core │ │ │ ├── Array.h │ │ │ ├── ArrayBase.h │ │ │ ├── ArrayWrapper.h │ │ │ ├── Assign.h │ │ │ ├── Assign_MKL.h │ │ │ ├── BandMatrix.h │ │ │ ├── Block.h │ │ │ ├── BooleanRedux.h │ │ │ ├── CMakeLists.txt │ │ │ ├── CommaInitializer.h │ │ │ ├── CoreIterators.h │ │ │ ├── CwiseBinaryOp.h │ │ │ ├── CwiseNullaryOp.h │ │ │ ├── CwiseUnaryOp.h │ │ │ ├── CwiseUnaryView.h │ │ │ ├── DenseBase.h │ │ │ ├── DenseCoeffsBase.h │ │ │ ├── DenseStorage.h │ │ │ ├── Diagonal.h │ │ │ ├── DiagonalMatrix.h │ │ │ ├── DiagonalProduct.h │ │ │ ├── Dot.h │ │ │ ├── EigenBase.h │ │ │ ├── Flagged.h │ │ │ ├── ForceAlignedAccess.h │ │ │ ├── Functors.h │ │ │ ├── Fuzzy.h │ │ │ ├── GeneralProduct.h │ │ │ ├── GenericPacketMath.h │ │ │ ├── GlobalFunctions.h │ │ │ ├── IO.h │ │ │ ├── Map.h │ │ │ ├── MapBase.h │ │ │ ├── MathFunctions.h │ │ │ ├── Matrix.h │ │ │ ├── MatrixBase.h │ │ │ ├── NestByValue.h │ │ │ ├── NoAlias.h │ │ │ ├── NumTraits.h │ │ │ ├── PermutationMatrix.h │ │ │ ├── PlainObjectBase.h │ │ │ ├── ProductBase.h │ │ │ ├── Random.h │ │ │ ├── Redux.h │ │ │ ├── Ref.h │ │ │ ├── Replicate.h │ │ │ ├── ReturnByValue.h │ │ │ ├── Reverse.h │ │ │ ├── Select.h │ │ │ ├── SelfAdjointView.h │ │ │ ├── SelfCwiseBinaryOp.h │ │ │ ├── SolveTriangular.h │ │ │ ├── StableNorm.h │ │ │ ├── Stride.h │ │ │ ├── Swap.h │ │ │ ├── Transpose.h │ │ │ ├── Transpositions.h │ │ │ ├── TriangularMatrix.h │ │ │ ├── VectorBlock.h │ │ │ ├── VectorwiseOp.h │ │ │ ├── Visitor.h │ │ │ ├── arch │ │ │ │ ├── AltiVec │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── Complex.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── Default │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── Settings.h │ │ │ │ ├── NEON │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── Complex.h │ │ │ │ │ └── PacketMath.h │ │ │ │ └── SSE │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ ├── products │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── CoeffBasedProduct.h │ │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ │ ├── GeneralMatrixMatrix.h │ │ │ │ ├── GeneralMatrixMatrixTriangular.h │ │ │ │ ├── GeneralMatrixMatrixTriangular_MKL.h │ │ │ │ ├── GeneralMatrixMatrix_MKL.h │ │ │ │ ├── GeneralMatrixVector.h │ │ │ │ ├── GeneralMatrixVector_MKL.h │ │ │ │ ├── Parallelizer.h │ │ │ │ ├── SelfadjointMatrixMatrix.h │ │ │ │ ├── SelfadjointMatrixMatrix_MKL.h │ │ │ │ ├── SelfadjointMatrixVector.h │ │ │ │ ├── SelfadjointMatrixVector_MKL.h │ │ │ │ ├── SelfadjointProduct.h │ │ │ │ ├── SelfadjointRank2Update.h │ │ │ │ ├── TriangularMatrixMatrix.h │ │ │ │ ├── TriangularMatrixMatrix_MKL.h │ │ │ │ ├── TriangularMatrixVector.h │ │ │ │ ├── TriangularMatrixVector_MKL.h │ │ │ │ ├── TriangularSolverMatrix.h │ │ │ │ ├── TriangularSolverMatrix_MKL.h │ │ │ │ └── TriangularSolverVector.h │ │ │ └── util │ │ │ │ ├── BlasUtil.h │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── Constants.h │ │ │ │ ├── DisableStupidWarnings.h │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ ├── MKL_support.h │ │ │ │ ├── Macros.h │ │ │ │ ├── Memory.h │ │ │ │ ├── Meta.h │ │ │ │ ├── NonMPL2.h │ │ │ │ ├── ReenableStupidWarnings.h │ │ │ │ ├── StaticAssert.h │ │ │ │ └── XprHelper.h │ │ │ ├── Eigen2Support │ │ │ ├── Block.h │ │ │ ├── CMakeLists.txt │ │ │ ├── Cwise.h │ │ │ ├── CwiseOperators.h │ │ │ ├── Geometry │ │ │ │ ├── AlignedBox.h │ │ │ │ ├── All.h │ │ │ │ ├── AngleAxis.h │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── Hyperplane.h │ │ │ │ ├── ParametrizedLine.h │ │ │ │ ├── Quaternion.h │ │ │ │ ├── Rotation2D.h │ │ │ │ ├── RotationBase.h │ │ │ │ ├── Scaling.h │ │ │ │ ├── Transform.h │ │ │ │ └── Translation.h │ │ │ ├── LU.h │ │ │ ├── Lazy.h │ │ │ ├── LeastSquares.h │ │ │ ├── Macros.h │ │ │ ├── MathFunctions.h │ │ │ ├── Memory.h │ │ │ ├── Meta.h │ │ │ ├── Minor.h │ │ │ ├── QR.h │ │ │ ├── SVD.h │ │ │ ├── TriangularSolver.h │ │ │ └── VectorBlock.h │ │ │ ├── Eigenvalues │ │ │ ├── CMakeLists.txt │ │ │ ├── ComplexEigenSolver.h │ │ │ ├── ComplexSchur.h │ │ │ ├── ComplexSchur_MKL.h │ │ │ ├── EigenSolver.h │ │ │ ├── GeneralizedEigenSolver.h │ │ │ ├── GeneralizedSelfAdjointEigenSolver.h │ │ │ ├── HessenbergDecomposition.h │ │ │ ├── MatrixBaseEigenvalues.h │ │ │ ├── RealQZ.h │ │ │ ├── RealSchur.h │ │ │ ├── RealSchur_MKL.h │ │ │ ├── SelfAdjointEigenSolver.h │ │ │ ├── SelfAdjointEigenSolver_MKL.h │ │ │ └── Tridiagonalization.h │ │ │ ├── Geometry │ │ │ ├── AlignedBox.h │ │ │ ├── AngleAxis.h │ │ │ ├── CMakeLists.txt │ │ │ ├── EulerAngles.h │ │ │ ├── Homogeneous.h │ │ │ ├── Hyperplane.h │ │ │ ├── OrthoMethods.h │ │ │ ├── ParametrizedLine.h │ │ │ ├── Quaternion.h │ │ │ ├── Rotation2D.h │ │ │ ├── RotationBase.h │ │ │ ├── Scaling.h │ │ │ ├── Transform.h │ │ │ ├── Translation.h │ │ │ ├── Umeyama.h │ │ │ └── arch │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── Geometry_SSE.h │ │ │ ├── Householder │ │ │ ├── BlockHouseholder.h │ │ │ ├── CMakeLists.txt │ │ │ ├── Householder.h │ │ │ └── HouseholderSequence.h │ │ │ ├── IterativeLinearSolvers │ │ │ ├── BasicPreconditioners.h │ │ │ ├── BiCGSTAB.h │ │ │ ├── CMakeLists.txt │ │ │ ├── ConjugateGradient.h │ │ │ ├── IncompleteLUT.h │ │ │ └── IterativeSolverBase.h │ │ │ ├── Jacobi │ │ │ ├── CMakeLists.txt │ │ │ └── Jacobi.h │ │ │ ├── LU │ │ │ ├── CMakeLists.txt │ │ │ ├── Determinant.h │ │ │ ├── FullPivLU.h │ │ │ ├── Inverse.h │ │ │ ├── PartialPivLU.h │ │ │ ├── PartialPivLU_MKL.h │ │ │ └── arch │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── Inverse_SSE.h │ │ │ ├── MetisSupport │ │ │ ├── CMakeLists.txt │ │ │ └── MetisSupport.h │ │ │ ├── OrderingMethods │ │ │ ├── Amd.h │ │ │ ├── CMakeLists.txt │ │ │ ├── Eigen_Colamd.h │ │ │ └── Ordering.h │ │ │ ├── PaStiXSupport │ │ │ ├── CMakeLists.txt │ │ │ └── PaStiXSupport.h │ │ │ ├── PardisoSupport │ │ │ ├── CMakeLists.txt │ │ │ └── PardisoSupport.h │ │ │ ├── QR │ │ │ ├── CMakeLists.txt │ │ │ ├── ColPivHouseholderQR.h │ │ │ ├── ColPivHouseholderQR_MKL.h │ │ │ ├── FullPivHouseholderQR.h │ │ │ ├── HouseholderQR.h │ │ │ └── HouseholderQR_MKL.h │ │ │ ├── SPQRSupport │ │ │ ├── CMakeLists.txt │ │ │ └── SuiteSparseQRSupport.h │ │ │ ├── SVD │ │ │ ├── CMakeLists.txt │ │ │ ├── JacobiSVD.h │ │ │ ├── JacobiSVD_MKL.h │ │ │ └── UpperBidiagonalization.h │ │ │ ├── SparseCholesky │ │ │ ├── CMakeLists.txt │ │ │ ├── SimplicialCholesky.h │ │ │ └── SimplicialCholesky_impl.h │ │ │ ├── SparseCore │ │ │ ├── AmbiVector.h │ │ │ ├── CMakeLists.txt │ │ │ ├── CompressedStorage.h │ │ │ ├── ConservativeSparseSparseProduct.h │ │ │ ├── MappedSparseMatrix.h │ │ │ ├── SparseBlock.h │ │ │ ├── SparseColEtree.h │ │ │ ├── SparseCwiseBinaryOp.h │ │ │ ├── SparseCwiseUnaryOp.h │ │ │ ├── SparseDenseProduct.h │ │ │ ├── SparseDiagonalProduct.h │ │ │ ├── SparseDot.h │ │ │ ├── SparseFuzzy.h │ │ │ ├── SparseMatrix.h │ │ │ ├── SparseMatrixBase.h │ │ │ ├── SparsePermutation.h │ │ │ ├── SparseProduct.h │ │ │ ├── SparseRedux.h │ │ │ ├── SparseSelfAdjointView.h │ │ │ ├── SparseSparseProductWithPruning.h │ │ │ ├── SparseTranspose.h │ │ │ ├── SparseTriangularView.h │ │ │ ├── SparseUtil.h │ │ │ ├── SparseVector.h │ │ │ ├── SparseView.h │ │ │ └── TriangularSolver.h │ │ │ ├── SparseLU │ │ │ ├── CMakeLists.txt │ │ │ ├── SparseLU.h │ │ │ ├── SparseLUImpl.h │ │ │ ├── SparseLU_Memory.h │ │ │ ├── SparseLU_Structs.h │ │ │ ├── SparseLU_SupernodalMatrix.h │ │ │ ├── SparseLU_Utils.h │ │ │ ├── SparseLU_column_bmod.h │ │ │ ├── SparseLU_column_dfs.h │ │ │ ├── SparseLU_copy_to_ucol.h │ │ │ ├── SparseLU_gemm_kernel.h │ │ │ ├── SparseLU_heap_relax_snode.h │ │ │ ├── SparseLU_kernel_bmod.h │ │ │ ├── SparseLU_panel_bmod.h │ │ │ ├── SparseLU_panel_dfs.h │ │ │ ├── SparseLU_pivotL.h │ │ │ ├── SparseLU_pruneL.h │ │ │ └── SparseLU_relax_snode.h │ │ │ ├── SparseQR │ │ │ ├── CMakeLists.txt │ │ │ └── SparseQR.h │ │ │ ├── StlSupport │ │ │ ├── CMakeLists.txt │ │ │ ├── StdDeque.h │ │ │ ├── StdList.h │ │ │ ├── StdVector.h │ │ │ └── details.h │ │ │ ├── SuperLUSupport │ │ │ ├── CMakeLists.txt │ │ │ └── SuperLUSupport.h │ │ │ ├── UmfPackSupport │ │ │ ├── CMakeLists.txt │ │ │ └── UmfPackSupport.h │ │ │ ├── misc │ │ │ ├── CMakeLists.txt │ │ │ ├── Image.h │ │ │ ├── Kernel.h │ │ │ ├── Solve.h │ │ │ ├── SparseSolve.h │ │ │ └── blas.h │ │ │ └── plugins │ │ │ ├── ArrayCwiseBinaryOps.h │ │ │ ├── ArrayCwiseUnaryOps.h │ │ │ ├── BlockMethods.h │ │ │ ├── CMakeLists.txt │ │ │ ├── CommonCwiseBinaryOps.h │ │ │ ├── CommonCwiseUnaryOps.h │ │ │ ├── MatrixCwiseBinaryOps.h │ │ │ └── MatrixCwiseUnaryOps.h │ └── unsupported │ │ ├── CMakeLists.txt │ │ ├── Eigen │ │ ├── AdolcForward │ │ ├── AlignedVector3 │ │ ├── ArpackSupport │ │ ├── AutoDiff │ │ ├── BVH │ │ ├── CMakeLists.txt │ │ ├── FFT │ │ ├── IterativeSolvers │ │ ├── KroneckerProduct │ │ ├── LevenbergMarquardt │ │ ├── MPRealSupport │ │ ├── MatrixFunctions │ │ ├── MoreVectorization │ │ ├── NonLinearOptimization │ │ ├── NumericalDiff │ │ ├── OpenGLSupport │ │ ├── Polynomials │ │ ├── SVD │ │ ├── Skyline │ │ ├── SparseExtra │ │ ├── Splines │ │ └── src │ │ │ ├── AutoDiff │ │ │ ├── AutoDiffJacobian.h │ │ │ ├── AutoDiffScalar.h │ │ │ ├── AutoDiffVector.h │ │ │ └── CMakeLists.txt │ │ │ ├── BVH │ │ │ ├── BVAlgorithms.h │ │ │ ├── CMakeLists.txt │ │ │ └── KdBVH.h │ │ │ ├── CMakeLists.txt │ │ │ ├── Eigenvalues │ │ │ ├── ArpackSelfAdjointEigenSolver.h │ │ │ └── CMakeLists.txt │ │ │ ├── FFT │ │ │ ├── CMakeLists.txt │ │ │ ├── ei_fftw_impl.h │ │ │ └── ei_kissfft_impl.h │ │ │ ├── IterativeSolvers │ │ │ ├── CMakeLists.txt │ │ │ ├── ConstrainedConjGrad.h │ │ │ ├── DGMRES.h │ │ │ ├── GMRES.h │ │ │ ├── IncompleteCholesky.h │ │ │ ├── IncompleteLU.h │ │ │ ├── IterationController.h │ │ │ ├── MINRES.h │ │ │ └── Scaling.h │ │ │ ├── KroneckerProduct │ │ │ ├── CMakeLists.txt │ │ │ └── KroneckerTensorProduct.h │ │ │ ├── LevenbergMarquardt │ │ │ ├── CMakeLists.txt │ │ │ ├── CopyrightMINPACK.txt │ │ │ ├── LMcovar.h │ │ │ ├── LMonestep.h │ │ │ ├── LMpar.h │ │ │ ├── LMqrsolv.h │ │ │ └── LevenbergMarquardt.h │ │ │ ├── MatrixFunctions │ │ │ ├── CMakeLists.txt │ │ │ ├── MatrixExponential.h │ │ │ ├── MatrixFunction.h │ │ │ ├── MatrixFunctionAtomic.h │ │ │ ├── MatrixLogarithm.h │ │ │ ├── MatrixPower.h │ │ │ ├── MatrixSquareRoot.h │ │ │ └── StemFunction.h │ │ │ ├── MoreVectorization │ │ │ ├── CMakeLists.txt │ │ │ └── MathFunctions.h │ │ │ ├── NonLinearOptimization │ │ │ ├── CMakeLists.txt │ │ │ ├── HybridNonLinearSolver.h │ │ │ ├── LevenbergMarquardt.h │ │ │ ├── chkder.h │ │ │ ├── covar.h │ │ │ ├── dogleg.h │ │ │ ├── fdjac1.h │ │ │ ├── lmpar.h │ │ │ ├── qrsolv.h │ │ │ ├── r1mpyq.h │ │ │ ├── r1updt.h │ │ │ └── rwupdt.h │ │ │ ├── NumericalDiff │ │ │ ├── CMakeLists.txt │ │ │ └── NumericalDiff.h │ │ │ ├── Polynomials │ │ │ ├── CMakeLists.txt │ │ │ ├── Companion.h │ │ │ ├── PolynomialSolver.h │ │ │ └── PolynomialUtils.h │ │ │ ├── SVD │ │ │ ├── BDCSVD.h │ │ │ ├── CMakeLists.txt │ │ │ ├── JacobiSVD.h │ │ │ ├── SVDBase.h │ │ │ ├── TODOBdcsvd.txt │ │ │ └── doneInBDCSVD.txt │ │ │ ├── Skyline │ │ │ ├── CMakeLists.txt │ │ │ ├── SkylineInplaceLU.h │ │ │ ├── SkylineMatrix.h │ │ │ ├── SkylineMatrixBase.h │ │ │ ├── SkylineProduct.h │ │ │ ├── SkylineStorage.h │ │ │ └── SkylineUtil.h │ │ │ ├── SparseExtra │ │ │ ├── BlockOfDynamicSparseMatrix.h │ │ │ ├── CMakeLists.txt │ │ │ ├── DynamicSparseMatrix.h │ │ │ ├── MarketIO.h │ │ │ ├── MatrixMarketIterator.h │ │ │ └── RandomSetter.h │ │ │ └── Splines │ │ │ ├── CMakeLists.txt │ │ │ ├── Spline.h │ │ │ ├── SplineFitting.h │ │ │ └── SplineFwd.h │ │ ├── README.txt │ │ ├── bench │ │ └── bench_svd.cpp │ │ ├── doc │ │ ├── CMakeLists.txt │ │ ├── Overview.dox │ │ ├── eigendoxy_layout.xml.in │ │ ├── examples │ │ │ ├── BVH_Example.cpp │ │ │ ├── CMakeLists.txt │ │ │ ├── FFT.cpp │ │ │ ├── MatrixExponential.cpp │ │ │ ├── MatrixFunction.cpp │ │ │ ├── MatrixLogarithm.cpp │ │ │ ├── MatrixPower.cpp │ │ │ ├── MatrixPower_optimal.cpp │ │ │ ├── MatrixSine.cpp │ │ │ ├── MatrixSinh.cpp │ │ │ ├── MatrixSquareRoot.cpp │ │ │ ├── PolynomialSolver1.cpp │ │ │ └── PolynomialUtils1.cpp │ │ └── snippets │ │ │ └── CMakeLists.txt │ │ └── test │ │ ├── BVH.cpp │ │ ├── CMakeLists.txt │ │ ├── FFT.cpp │ │ ├── FFTW.cpp │ │ ├── NonLinearOptimization.cpp │ │ ├── NumericalDiff.cpp │ │ ├── alignedvector3.cpp │ │ ├── autodiff.cpp │ │ ├── bdcsvd.cpp │ │ ├── dgmres.cpp │ │ ├── forward_adolc.cpp │ │ ├── gmres.cpp │ │ ├── jacobisvd.cpp │ │ ├── kronecker_product.cpp │ │ ├── levenberg_marquardt.cpp │ │ ├── matrix_exponential.cpp │ │ ├── matrix_function.cpp │ │ ├── matrix_functions.h │ │ ├── matrix_power.cpp │ │ ├── matrix_square_root.cpp │ │ ├── minres.cpp │ │ ├── mpreal │ │ └── mpreal.h │ │ ├── mpreal_support.cpp │ │ ├── openglsupport.cpp │ │ ├── polynomialsolver.cpp │ │ ├── polynomialutils.cpp │ │ ├── sparse_extra.cpp │ │ ├── splines.cpp │ │ └── svd_common.h └── igl │ ├── AABB.cpp │ ├── AABB.h │ ├── ARAPEnergyType.h │ ├── AtA_cached.cpp │ ├── AtA_cached.h │ ├── Attribute.h │ ├── C_STR.h │ ├── Camera.h │ ├── ConjugateFFSolverData.h │ ├── EPS.cpp │ ├── EPS.h │ ├── HalfEdgeIterator.cpp │ ├── HalfEdgeIterator.h │ ├── Hit.h │ ├── IO │ ├── IndexComparison.h │ ├── LinSpaced.h │ ├── MeshBooleanType.h │ ├── NormalType.h │ ├── ONE.h │ ├── PI.h │ ├── REDRUM.h │ ├── STR.h │ ├── Singular_Value_Decomposition_Givens_QR_Factorization_Kernel.hpp │ ├── Singular_Value_Decomposition_Jacobi_Conjugation_Kernel.hpp │ ├── Singular_Value_Decomposition_Kernel_Declarations.hpp │ ├── Singular_Value_Decomposition_Main_Kernel_Body.hpp │ ├── Singular_Value_Decomposition_Preamble.hpp │ ├── SolverStatus.h │ ├── SortableRow.h │ ├── Timer.h │ ├── Viewport.h │ ├── WindingNumberAABB.h │ ├── WindingNumberMethod.h │ ├── WindingNumberTree.h │ ├── ZERO.h │ ├── active_set.cpp │ ├── active_set.h │ ├── adjacency_list.cpp │ ├── adjacency_list.h │ ├── adjacency_matrix.cpp │ ├── adjacency_matrix.h │ ├── all.cpp │ ├── all.h │ ├── all_edges.cpp │ ├── all_edges.h │ ├── all_pairs_distances.cpp │ ├── all_pairs_distances.h │ ├── ambient_occlusion.cpp │ ├── ambient_occlusion.h │ ├── angle_bound_frame_fields.cpp │ ├── angle_bound_frame_fields.h │ ├── angular_distance.cpp │ ├── angular_distance.h │ ├── anttweakbar │ ├── ReAntTweakBar.cpp │ ├── ReAntTweakBar.h │ ├── cocoa_key_to_anttweakbar_key.cpp │ └── cocoa_key_to_anttweakbar_key.h │ ├── any.cpp │ ├── any.h │ ├── any_of.cpp │ ├── any_of.h │ ├── arap.cpp │ ├── arap.h │ ├── arap_dof.cpp │ ├── arap_dof.h │ ├── arap_linear_block.cpp │ ├── arap_linear_block.h │ ├── arap_rhs.cpp │ ├── arap_rhs.h │ ├── average_onto_faces.cpp │ ├── average_onto_faces.h │ ├── average_onto_vertices.cpp │ ├── average_onto_vertices.h │ ├── avg_edge_length.cpp │ ├── avg_edge_length.h │ ├── axis_angle_to_quat.cpp │ ├── axis_angle_to_quat.h │ ├── barycenter.cpp │ ├── barycenter.h │ ├── barycentric_coordinates.cpp │ ├── barycentric_coordinates.h │ ├── barycentric_to_global.cpp │ ├── barycentric_to_global.h │ ├── basename.cpp │ ├── basename.h │ ├── bbw.cpp │ ├── bbw.h │ ├── bfs.cpp │ ├── bfs.h │ ├── bfs_orient.cpp │ ├── bfs_orient.h │ ├── biharmonic_coordinates.cpp │ ├── biharmonic_coordinates.h │ ├── bijective_composite_harmonic_mapping.cpp │ ├── bijective_composite_harmonic_mapping.h │ ├── bone_parents.cpp │ ├── bone_parents.h │ ├── boundary_conditions.cpp │ ├── boundary_conditions.h │ ├── boundary_facets.cpp │ ├── boundary_facets.h │ ├── boundary_loop.cpp │ ├── boundary_loop.h │ ├── bounding_box.cpp │ ├── bounding_box.h │ ├── bounding_box_diagonal.cpp │ ├── bounding_box_diagonal.h │ ├── canonical_quaternions.cpp │ ├── canonical_quaternions.h │ ├── cat.cpp │ ├── cat.h │ ├── ceil.cpp │ ├── ceil.h │ ├── centroid.cpp │ ├── centroid.h │ ├── circulation.cpp │ ├── circulation.h │ ├── circumradius.cpp │ ├── circumradius.h │ ├── collapse_edge.cpp │ ├── collapse_edge.h │ ├── collapse_small_triangles.cpp │ ├── collapse_small_triangles.h │ ├── colon.cpp │ ├── colon.h │ ├── colormap.cpp │ ├── colormap.h │ ├── column_to_quats.cpp │ ├── column_to_quats.h │ ├── columnize.cpp │ ├── columnize.h │ ├── comb_cross_field.cpp │ ├── comb_cross_field.h │ ├── comb_frame_field.cpp │ ├── comb_frame_field.h │ ├── comb_line_field.cpp │ ├── comb_line_field.h │ ├── combine.cpp │ ├── combine.h │ ├── components.cpp │ ├── components.h │ ├── compute_frame_field_bisectors.cpp │ ├── compute_frame_field_bisectors.h │ ├── conjugate_frame_fields.cpp │ ├── conjugate_frame_fields.h │ ├── connect_boundary_to_infinity.cpp │ ├── connect_boundary_to_infinity.h │ ├── copyleft │ ├── README.md │ ├── cgal │ │ ├── BinaryWindingNumberOperations.h │ │ ├── CGAL_includes.hpp │ │ ├── CSGTree.h │ │ ├── RemeshSelfIntersectionsParam.h │ │ ├── SelfIntersectMesh.h │ │ ├── assign.cpp │ │ ├── assign.h │ │ ├── assign_scalar.cpp │ │ ├── assign_scalar.h │ │ ├── barycenter.cpp │ │ ├── cell_adjacency.cpp │ │ ├── cell_adjacency.h │ │ ├── closest_facet.cpp │ │ ├── closest_facet.h │ │ ├── complex_to_mesh.cpp │ │ ├── complex_to_mesh.h │ │ ├── component_inside_component.cpp │ │ ├── component_inside_component.h │ │ ├── convex_hull.cpp │ │ ├── convex_hull.h │ │ ├── delaunay_triangulation.cpp │ │ ├── delaunay_triangulation.h │ │ ├── extract_cells.cpp │ │ ├── extract_cells.h │ │ ├── extract_feature.cpp │ │ ├── extract_feature.h │ │ ├── half_space_box.cpp │ │ ├── half_space_box.h │ │ ├── hausdorff.cpp │ │ ├── hausdorff.h │ │ ├── incircle.cpp │ │ ├── incircle.h │ │ ├── insert_into_cdt.cpp │ │ ├── insert_into_cdt.h │ │ ├── insphere.cpp │ │ ├── insphere.h │ │ ├── intersect_other.cpp │ │ ├── intersect_other.h │ │ ├── intersect_with_half_space.cpp │ │ ├── intersect_with_half_space.h │ │ ├── lexicographic_triangulation.cpp │ │ ├── lexicographic_triangulation.h │ │ ├── list_to_matrix.cpp │ │ ├── mesh_boolean.cpp │ │ ├── mesh_boolean.h │ │ ├── mesh_boolean_type_to_funcs.cpp │ │ ├── mesh_boolean_type_to_funcs.h │ │ ├── mesh_to_cgal_triangle_list.cpp │ │ ├── mesh_to_cgal_triangle_list.h │ │ ├── mesh_to_polyhedron.cpp │ │ ├── mesh_to_polyhedron.h │ │ ├── minkowski_sum.cpp │ │ ├── minkowski_sum.h │ │ ├── order_facets_around_edge.cpp │ │ ├── order_facets_around_edge.h │ │ ├── order_facets_around_edges.cpp │ │ ├── order_facets_around_edges.h │ │ ├── orient2D.cpp │ │ ├── orient2D.h │ │ ├── orient3D.cpp │ │ ├── orient3D.h │ │ ├── outer_element.cpp │ │ ├── outer_element.h │ │ ├── outer_facet.cpp │ │ ├── outer_facet.h │ │ ├── outer_hull.cpp │ │ ├── outer_hull.h │ │ ├── peel_outer_hull_layers.cpp │ │ ├── peel_outer_hull_layers.h │ │ ├── peel_winding_number_layers.cpp │ │ ├── peel_winding_number_layers.h │ │ ├── piecewise_constant_winding_number.cpp │ │ ├── piecewise_constant_winding_number.h │ │ ├── point_mesh_squared_distance.cpp │ │ ├── point_mesh_squared_distance.h │ │ ├── point_segment_squared_distance.cpp │ │ ├── point_segment_squared_distance.h │ │ ├── point_solid_signed_squared_distance.cpp │ │ ├── point_solid_signed_squared_distance.h │ │ ├── point_triangle_squared_distance.cpp │ │ ├── point_triangle_squared_distance.h │ │ ├── points_inside_component.cpp │ │ ├── points_inside_component.h │ │ ├── polyhedron_to_mesh.cpp │ │ ├── polyhedron_to_mesh.h │ │ ├── projected_cdt.cpp │ │ ├── projected_cdt.h │ │ ├── projected_delaunay.cpp │ │ ├── projected_delaunay.h │ │ ├── propagate_winding_numbers.cpp │ │ ├── propagate_winding_numbers.h │ │ ├── read_triangle_mesh.cpp │ │ ├── read_triangle_mesh.h │ │ ├── relabel_small_immersed_cells.cpp │ │ ├── relabel_small_immersed_cells.h │ │ ├── remesh_intersections.cpp │ │ ├── remesh_intersections.h │ │ ├── remesh_self_intersections.cpp │ │ ├── remesh_self_intersections.h │ │ ├── remove_unreferenced.cpp │ │ ├── resolve_intersections.cpp │ │ ├── resolve_intersections.h │ │ ├── row_to_point.cpp │ │ ├── row_to_point.h │ │ ├── segment_segment_squared_distance.cpp │ │ ├── segment_segment_squared_distance.h │ │ ├── signed_distance_isosurface.cpp │ │ ├── signed_distance_isosurface.h │ │ ├── slice.cpp │ │ ├── slice_mask.cpp │ │ ├── snap_rounding.cpp │ │ ├── snap_rounding.h │ │ ├── string_to_mesh_boolean_type.cpp │ │ ├── string_to_mesh_boolean_type.h │ │ ├── subdivide_segments.cpp │ │ ├── subdivide_segments.h │ │ ├── submesh_aabb_tree.cpp │ │ ├── submesh_aabb_tree.h │ │ ├── triangle_triangle_squared_distance.cpp │ │ ├── triangle_triangle_squared_distance.h │ │ ├── trim_with_solid.cpp │ │ ├── trim_with_solid.h │ │ ├── unique.cpp │ │ ├── unique_rows.cpp │ │ ├── wire_mesh.cpp │ │ └── wire_mesh.h │ ├── comiso │ │ ├── frame_field.cpp │ │ ├── frame_field.h │ │ ├── miq.cpp │ │ ├── miq.h │ │ ├── nrosy.cpp │ │ └── nrosy.h │ ├── cork │ │ ├── from_cork_mesh.cpp │ │ ├── from_cork_mesh.h │ │ ├── mesh_boolean.cpp │ │ ├── mesh_boolean.h │ │ ├── to_cork_mesh.cpp │ │ └── to_cork_mesh.h │ ├── marching_cubes.cpp │ ├── marching_cubes.h │ ├── marching_cubes_tables.h │ ├── offset_surface.cpp │ ├── offset_surface.h │ ├── opengl2 │ │ ├── render_to_tga.cpp │ │ ├── render_to_tga.h │ │ ├── texture_from_tga.cpp │ │ ├── texture_from_tga.h │ │ ├── tga.cpp │ │ └── tga.h │ ├── progressive_hulls.cpp │ ├── progressive_hulls.h │ ├── progressive_hulls_cost_and_placement.cpp │ ├── progressive_hulls_cost_and_placement.h │ ├── quadprog.cpp │ ├── quadprog.h │ ├── swept_volume.cpp │ ├── swept_volume.h │ └── tetgen │ │ ├── README │ │ ├── cdt.cpp │ │ ├── cdt.h │ │ ├── mesh_to_tetgenio.cpp │ │ ├── mesh_to_tetgenio.h │ │ ├── mesh_with_skeleton.cpp │ │ ├── mesh_with_skeleton.h │ │ ├── read_into_tetgenio.cpp │ │ ├── read_into_tetgenio.h │ │ ├── tetgenio_to_tetmesh.cpp │ │ ├── tetgenio_to_tetmesh.h │ │ ├── tetrahedralize.cpp │ │ └── tetrahedralize.h │ ├── cotmatrix.cpp │ ├── cotmatrix.h │ ├── cotmatrix_entries.cpp │ ├── cotmatrix_entries.h │ ├── count.cpp │ ├── count.h │ ├── covariance_scatter_matrix.cpp │ ├── covariance_scatter_matrix.h │ ├── cross.cpp │ ├── cross.h │ ├── cross_field_missmatch.cpp │ ├── cross_field_missmatch.h │ ├── crouzeix_raviart_cotmatrix.cpp │ ├── crouzeix_raviart_cotmatrix.h │ ├── crouzeix_raviart_massmatrix.cpp │ ├── crouzeix_raviart_massmatrix.h │ ├── cumsum.cpp │ ├── cumsum.h │ ├── cut_mesh.cpp │ ├── cut_mesh.h │ ├── cut_mesh_from_singularities.cpp │ ├── cut_mesh_from_singularities.h │ ├── cylinder.cpp │ ├── cylinder.h │ ├── dated_copy.cpp │ ├── dated_copy.h │ ├── decimate.cpp │ ├── decimate.h │ ├── deform_skeleton.cpp │ ├── deform_skeleton.h │ ├── delaunay_triangulation.cpp │ ├── delaunay_triangulation.h │ ├── deprecated.h │ ├── dfs.cpp │ ├── dfs.h │ ├── diag.cpp │ ├── diag.h │ ├── dihedral_angles.cpp │ ├── dihedral_angles.h │ ├── dijkstra.cpp │ ├── dijkstra.h │ ├── directed_edge_orientations.cpp │ ├── directed_edge_orientations.h │ ├── directed_edge_parents.cpp │ ├── directed_edge_parents.h │ ├── dirname.cpp │ ├── dirname.h │ ├── dot.cpp │ ├── dot.h │ ├── dot_row.cpp │ ├── dot_row.h │ ├── doublearea.cpp │ ├── doublearea.h │ ├── dqs.cpp │ ├── dqs.h │ ├── ears.cpp │ ├── ears.h │ ├── edge_collapse_is_valid.cpp │ ├── edge_collapse_is_valid.h │ ├── edge_flaps.cpp │ ├── edge_flaps.h │ ├── edge_lengths.cpp │ ├── edge_lengths.h │ ├── edge_topology.cpp │ ├── edge_topology.h │ ├── edges.cpp │ ├── edges.h │ ├── edges_to_path.cpp │ ├── edges_to_path.h │ ├── eigs.cpp │ ├── eigs.h │ ├── embree │ ├── EmbreeIntersector.h │ ├── Embree_convenience.h │ ├── ambient_occlusion.cpp │ ├── ambient_occlusion.h │ ├── bone_heat.cpp │ ├── bone_heat.h │ ├── bone_visible.cpp │ ├── bone_visible.h │ ├── line_mesh_intersection.cpp │ ├── line_mesh_intersection.h │ ├── reorient_facets_raycast.cpp │ ├── reorient_facets_raycast.h │ ├── shape_diameter_function.cpp │ ├── shape_diameter_function.h │ ├── unproject_in_mesh.cpp │ ├── unproject_in_mesh.h │ ├── unproject_onto_mesh.cpp │ └── unproject_onto_mesh.h │ ├── euler_characteristic.cpp │ ├── euler_characteristic.h │ ├── exact_geodesic.cpp │ ├── exact_geodesic.h │ ├── example_fun.cpp │ ├── example_fun.h │ ├── exterior_edges.cpp │ ├── exterior_edges.h │ ├── extract_manifold_patches.cpp │ ├── extract_manifold_patches.h │ ├── extract_non_manifold_edge_curves.cpp │ ├── extract_non_manifold_edge_curves.h │ ├── face_areas.cpp │ ├── face_areas.h │ ├── face_occurrences.cpp │ ├── face_occurrences.h │ ├── faces_first.cpp │ ├── faces_first.h │ ├── facet_components.cpp │ ├── facet_components.h │ ├── false_barycentric_subdivision.cpp │ ├── false_barycentric_subdivision.h │ ├── field_local_global_conversions.cpp │ ├── field_local_global_conversions.h │ ├── file_contents_as_string.cpp │ ├── file_contents_as_string.h │ ├── file_dialog_open.cpp │ ├── file_dialog_open.h │ ├── file_dialog_save.cpp │ ├── file_dialog_save.h │ ├── file_exists.cpp │ ├── file_exists.h │ ├── find.cpp │ ├── find.h │ ├── find_cross_field_singularities.cpp │ ├── find_cross_field_singularities.h │ ├── find_zero.cpp │ ├── find_zero.h │ ├── fit_plane.cpp │ ├── fit_plane.h │ ├── fit_rotations.cpp │ ├── fit_rotations.h │ ├── flip_avoiding_line_search.cpp │ ├── flip_avoiding_line_search.h │ ├── flip_edge.cpp │ ├── flip_edge.h │ ├── flipped_triangles.cpp │ ├── flipped_triangles.h │ ├── flood_fill.cpp │ ├── flood_fill.h │ ├── floor.cpp │ ├── floor.h │ ├── for_each.h │ ├── forward_kinematics.cpp │ ├── forward_kinematics.h │ ├── frame_field_deformer.cpp │ ├── frame_field_deformer.h │ ├── frame_to_cross_field.cpp │ ├── frame_to_cross_field.h │ ├── frustum.cpp │ ├── frustum.h │ ├── gaussian_curvature.cpp │ ├── gaussian_curvature.h │ ├── get_seconds.cpp │ ├── get_seconds.h │ ├── get_seconds_hires.cpp │ ├── get_seconds_hires.h │ ├── grad.cpp │ ├── grad.h │ ├── grid.cpp │ ├── grid.h │ ├── grid_search.cpp │ ├── grid_search.h │ ├── group_sum_matrix.cpp │ ├── group_sum_matrix.h │ ├── guess_extension.cpp │ ├── guess_extension.h │ ├── harmonic.cpp │ ├── harmonic.h │ ├── harwell_boeing.cpp │ ├── harwell_boeing.h │ ├── hausdorff.cpp │ ├── hausdorff.h │ ├── hessian.cpp │ ├── hessian.h │ ├── hessian_energy.cpp │ ├── hessian_energy.h │ ├── histc.cpp │ ├── histc.h │ ├── hsv_to_rgb.cpp │ ├── hsv_to_rgb.h │ ├── igl_inline.h │ ├── in_element.cpp │ ├── in_element.h │ ├── infinite_cost_stopping_condition.cpp │ ├── infinite_cost_stopping_condition.h │ ├── inradius.cpp │ ├── inradius.h │ ├── integrable_polyvector_fields.cpp │ ├── integrable_polyvector_fields.h │ ├── internal_angles.cpp │ ├── internal_angles.h │ ├── intersect.cpp │ ├── intersect.h │ ├── invert_diag.cpp │ ├── invert_diag.h │ ├── is_border_vertex.cpp │ ├── is_border_vertex.h │ ├── is_boundary_edge.cpp │ ├── is_boundary_edge.h │ ├── is_dir.cpp │ ├── is_dir.h │ ├── is_edge_manifold.cpp │ ├── is_edge_manifold.h │ ├── is_file.cpp │ ├── is_file.h │ ├── is_irregular_vertex.cpp │ ├── is_irregular_vertex.h │ ├── is_planar.cpp │ ├── is_planar.h │ ├── is_readable.cpp │ ├── is_readable.h │ ├── is_sparse.cpp │ ├── is_sparse.h │ ├── is_stl.cpp │ ├── is_stl.h │ ├── is_symmetric.cpp │ ├── is_symmetric.h │ ├── is_vertex_manifold.cpp │ ├── is_vertex_manifold.h │ ├── is_writable.cpp │ ├── is_writable.h │ ├── isdiag.cpp │ ├── isdiag.h │ ├── ismember.cpp │ ├── ismember.h │ ├── isolines.cpp │ ├── isolines.h │ ├── jet.cpp │ ├── jet.h │ ├── launch_medit.cpp │ ├── launch_medit.h │ ├── lbs_matrix.cpp │ ├── lbs_matrix.h │ ├── lexicographic_triangulation.cpp │ ├── lexicographic_triangulation.h │ ├── lim │ ├── lim.cpp │ └── lim.h │ ├── limit_faces.cpp │ ├── limit_faces.h │ ├── line_field_missmatch.cpp │ ├── line_field_missmatch.h │ ├── line_search.cpp │ ├── line_search.h │ ├── line_segment_in_rectangle.cpp │ ├── line_segment_in_rectangle.h │ ├── linprog.cpp │ ├── linprog.h │ ├── list_to_matrix.cpp │ ├── list_to_matrix.h │ ├── local_basis.cpp │ ├── local_basis.h │ ├── look_at.cpp │ ├── look_at.h │ ├── loop.cpp │ ├── loop.h │ ├── lscm.cpp │ ├── lscm.h │ ├── map_vertices_to_circle.cpp │ ├── map_vertices_to_circle.h │ ├── massmatrix.cpp │ ├── massmatrix.h │ ├── mat_max.cpp │ ├── mat_max.h │ ├── mat_min.cpp │ ├── mat_min.h │ ├── mat_to_quat.cpp │ ├── mat_to_quat.h │ ├── material_colors.h │ ├── matlab │ ├── MatlabWorkspace.h │ ├── MexStream.h │ ├── matlabinterface.cpp │ ├── matlabinterface.h │ ├── mexErrMsgTxt.cpp │ ├── mexErrMsgTxt.h │ ├── parse_rhs.cpp │ ├── parse_rhs.h │ ├── prepare_lhs.cpp │ ├── prepare_lhs.h │ ├── requires_arg.cpp │ ├── requires_arg.h │ ├── validate_arg.cpp │ └── validate_arg.h │ ├── matlab_format.cpp │ ├── matlab_format.h │ ├── matrix_to_list.cpp │ ├── matrix_to_list.h │ ├── max.cpp │ ├── max.h │ ├── max_faces_stopping_condition.cpp │ ├── max_faces_stopping_condition.h │ ├── max_size.cpp │ ├── max_size.h │ ├── median.cpp │ ├── median.h │ ├── min.cpp │ ├── min.h │ ├── min_quad_dense.cpp │ ├── min_quad_dense.h │ ├── min_quad_with_fixed.cpp │ ├── min_quad_with_fixed.h │ ├── min_size.cpp │ ├── min_size.h │ ├── mod.cpp │ ├── mod.h │ ├── mode.cpp │ ├── mode.h │ ├── mosek │ ├── bbw.cpp │ ├── bbw.h │ ├── mosek_guarded.cpp │ ├── mosek_guarded.h │ ├── mosek_linprog.cpp │ ├── mosek_linprog.h │ ├── mosek_quadprog.cpp │ └── mosek_quadprog.h │ ├── mvc.cpp │ ├── mvc.h │ ├── n_polyvector.cpp │ ├── n_polyvector.h │ ├── n_polyvector_general.cpp │ ├── n_polyvector_general.h │ ├── nchoosek.cpp │ ├── nchoosek.h │ ├── next_filename.cpp │ ├── next_filename.h │ ├── normal_derivative.cpp │ ├── normal_derivative.h │ ├── normalize_quat.cpp │ ├── normalize_quat.h │ ├── normalize_row_lengths.cpp │ ├── normalize_row_lengths.h │ ├── normalize_row_sums.cpp │ ├── normalize_row_sums.h │ ├── null.cpp │ ├── null.h │ ├── on_boundary.cpp │ ├── on_boundary.h │ ├── opengl │ ├── MeshGL.cpp │ ├── MeshGL.h │ ├── ViewerCore.cpp │ ├── ViewerCore.h │ ├── ViewerData.cpp │ ├── ViewerData.h │ ├── bind_vertex_attrib_array.cpp │ ├── bind_vertex_attrib_array.h │ ├── create_index_vbo.cpp │ ├── create_index_vbo.h │ ├── create_mesh_vbo.cpp │ ├── create_mesh_vbo.h │ ├── create_shader_program.cpp │ ├── create_shader_program.h │ ├── create_vector_vbo.cpp │ ├── create_vector_vbo.h │ ├── destroy_shader_program.cpp │ ├── destroy_shader_program.h │ ├── gl.h │ ├── gl_type_size.cpp │ ├── gl_type_size.h │ ├── glfw │ │ ├── TextRenderer.cpp │ │ ├── TextRenderer.h │ │ ├── TextRenderer_fonts.cpp │ │ ├── TextRenderer_fonts.h │ │ ├── Viewer.cpp │ │ ├── Viewer.h │ │ ├── ViewerPlugin.h │ │ ├── background_window.cpp │ │ ├── background_window.h │ │ ├── imgui │ │ │ ├── ImGuiHelpers.h │ │ │ ├── ImGuiMenu.cpp │ │ │ └── ImGuiMenu.h │ │ ├── map_texture.cpp │ │ └── map_texture.h │ ├── init_render_to_texture.cpp │ ├── init_render_to_texture.h │ ├── load_shader.cpp │ ├── load_shader.h │ ├── print_program_info_log.cpp │ ├── print_program_info_log.h │ ├── print_shader_info_log.cpp │ ├── print_shader_info_log.h │ ├── report_gl_error.cpp │ ├── report_gl_error.h │ ├── uniform_type_to_string.cpp │ ├── uniform_type_to_string.h │ ├── vertex_array.cpp │ └── vertex_array.h │ ├── opengl2 │ ├── MouseController.h │ ├── RotateWidget.h │ ├── TranslateWidget.h │ ├── draw_beach_ball.cpp │ ├── draw_beach_ball.h │ ├── draw_floor.cpp │ ├── draw_floor.h │ ├── draw_mesh.cpp │ ├── draw_mesh.h │ ├── draw_point.cpp │ ├── draw_point.h │ ├── draw_rectangular_marquee.cpp │ ├── draw_rectangular_marquee.h │ ├── draw_skeleton_3d.cpp │ ├── draw_skeleton_3d.h │ ├── draw_skeleton_vector_graphics.cpp │ ├── draw_skeleton_vector_graphics.h │ ├── flare_textures.h │ ├── gl.h │ ├── glext.h │ ├── glu.h │ ├── lens_flare.cpp │ ├── lens_flare.h │ ├── model_proj_viewport.cpp │ ├── model_proj_viewport.h │ ├── print_gl_get.cpp │ ├── print_gl_get.h │ ├── project.cpp │ ├── project.h │ ├── right_axis.cpp │ ├── right_axis.h │ ├── shine_textures.h │ ├── sort_triangles.cpp │ ├── sort_triangles.h │ ├── unproject.cpp │ ├── unproject.h │ ├── unproject_to_zero_plane.cpp │ ├── unproject_to_zero_plane.h │ ├── up_axis.cpp │ ├── up_axis.h │ ├── view_axis.cpp │ └── view_axis.h │ ├── orient_outward.cpp │ ├── orient_outward.h │ ├── orientable_patches.cpp │ ├── orientable_patches.h │ ├── oriented_facets.cpp │ ├── oriented_facets.h │ ├── orth.cpp │ ├── orth.h │ ├── ortho.cpp │ ├── ortho.h │ ├── outer_element.cpp │ ├── outer_element.h │ ├── parallel_for.h │ ├── parallel_transport_angles.cpp │ ├── parallel_transport_angles.h │ ├── partition.cpp │ ├── partition.h │ ├── parula.cpp │ ├── parula.h │ ├── path_to_executable.cpp │ ├── path_to_executable.h │ ├── pathinfo.cpp │ ├── pathinfo.h │ ├── per_corner_normals.cpp │ ├── per_corner_normals.h │ ├── per_edge_normals.cpp │ ├── per_edge_normals.h │ ├── per_face_normals.cpp │ ├── per_face_normals.h │ ├── per_vertex_attribute_smoothing.cpp │ ├── per_vertex_attribute_smoothing.h │ ├── per_vertex_normals.cpp │ ├── per_vertex_normals.h │ ├── per_vertex_point_to_plane_quadrics.cpp │ ├── per_vertex_point_to_plane_quadrics.h │ ├── piecewise_constant_winding_number.cpp │ ├── piecewise_constant_winding_number.h │ ├── pinv.cpp │ ├── pinv.h │ ├── planarize_quad_mesh.cpp │ ├── planarize_quad_mesh.h │ ├── ply.h │ ├── png │ ├── readPNG.cpp │ ├── readPNG.h │ ├── render_to_png.cpp │ ├── render_to_png.h │ ├── render_to_png_async.cpp │ ├── render_to_png_async.h │ ├── texture_from_file.cpp │ ├── texture_from_file.h │ ├── texture_from_png.cpp │ ├── texture_from_png.h │ ├── writePNG.cpp │ └── writePNG.h │ ├── point_in_circle.cpp │ ├── point_in_circle.h │ ├── point_in_poly.cpp │ ├── point_in_poly.h │ ├── point_mesh_squared_distance.cpp │ ├── point_mesh_squared_distance.h │ ├── point_simplex_squared_distance.cpp │ ├── point_simplex_squared_distance.h │ ├── polar_dec.cpp │ ├── polar_dec.h │ ├── polar_svd.cpp │ ├── polar_svd.h │ ├── polar_svd3x3.cpp │ ├── polar_svd3x3.h │ ├── polygon_mesh_to_triangle_mesh.cpp │ ├── polygon_mesh_to_triangle_mesh.h │ ├── polyroots.cpp │ ├── polyroots.h │ ├── polyvector_field_comb_from_matchings_and_cuts.cpp │ ├── polyvector_field_comb_from_matchings_and_cuts.h │ ├── polyvector_field_cut_mesh_with_singularities.cpp │ ├── polyvector_field_cut_mesh_with_singularities.h │ ├── polyvector_field_matchings.cpp │ ├── polyvector_field_matchings.h │ ├── polyvector_field_poisson_reconstruction.cpp │ ├── polyvector_field_poisson_reconstruction.h │ ├── polyvector_field_singularities_from_matchings.cpp │ ├── polyvector_field_singularities_from_matchings.h │ ├── principal_curvature.cpp │ ├── principal_curvature.h │ ├── print_ijv.cpp │ ├── print_ijv.h │ ├── print_vector.cpp │ ├── print_vector.h │ ├── procrustes.cpp │ ├── procrustes.h │ ├── project.cpp │ ├── project.h │ ├── project_isometrically_to_plane.cpp │ ├── project_isometrically_to_plane.h │ ├── project_to_line.cpp │ ├── project_to_line.h │ ├── project_to_line_segment.cpp │ ├── project_to_line_segment.h │ ├── pseudonormal_test.cpp │ ├── pseudonormal_test.h │ ├── pso.cpp │ ├── pso.h │ ├── qslim.cpp │ ├── qslim.h │ ├── qslim_optimal_collapse_edge_callbacks.cpp │ ├── qslim_optimal_collapse_edge_callbacks.h │ ├── quad_planarity.cpp │ ├── quad_planarity.h │ ├── quadric_binary_plus_operator.cpp │ ├── quadric_binary_plus_operator.h │ ├── quat_conjugate.cpp │ ├── quat_conjugate.h │ ├── quat_mult.cpp │ ├── quat_mult.h │ ├── quat_to_axis_angle.cpp │ ├── quat_to_axis_angle.h │ ├── quat_to_mat.cpp │ ├── quat_to_mat.h │ ├── quats_to_column.cpp │ ├── quats_to_column.h │ ├── ramer_douglas_peucker.cpp │ ├── ramer_douglas_peucker.h │ ├── random_dir.cpp │ ├── random_dir.h │ ├── random_points_on_mesh.cpp │ ├── random_points_on_mesh.h │ ├── random_quaternion.cpp │ ├── random_quaternion.h │ ├── random_search.cpp │ ├── random_search.h │ ├── randperm.cpp │ ├── randperm.h │ ├── ray_box_intersect.cpp │ ├── ray_box_intersect.h │ ├── ray_mesh_intersect.cpp │ ├── ray_mesh_intersect.h │ ├── ray_sphere_intersect.cpp │ ├── ray_sphere_intersect.h │ ├── raytri.c │ ├── readBF.cpp │ ├── readBF.h │ ├── readCSV.cpp │ ├── readCSV.h │ ├── readDMAT.cpp │ ├── readDMAT.h │ ├── readMESH.cpp │ ├── readMESH.h │ ├── readNODE.cpp │ ├── readNODE.h │ ├── readOBJ.cpp │ ├── readOBJ.h │ ├── readOFF.cpp │ ├── readOFF.h │ ├── readPLY.cpp │ ├── readPLY.h │ ├── readSTL.cpp │ ├── readSTL.h │ ├── readTGF.cpp │ ├── readTGF.h │ ├── readWRL.cpp │ ├── readWRL.h │ ├── read_triangle_mesh.cpp │ ├── read_triangle_mesh.h │ ├── redux.h │ ├── remove_duplicate_vertices.cpp │ ├── remove_duplicate_vertices.h │ ├── remove_duplicates.cpp │ ├── remove_duplicates.h │ ├── remove_unreferenced.cpp │ ├── remove_unreferenced.h │ ├── reorder.cpp │ ├── reorder.h │ ├── repdiag.cpp │ ├── repdiag.h │ ├── repmat.cpp │ ├── repmat.h │ ├── resolve_duplicated_faces.cpp │ ├── resolve_duplicated_faces.h │ ├── rgb_to_hsv.cpp │ ├── rgb_to_hsv.h │ ├── rotate_by_quat.cpp │ ├── rotate_by_quat.h │ ├── rotate_vectors.cpp │ ├── rotate_vectors.h │ ├── rotation_matrix_from_directions.cpp │ ├── rotation_matrix_from_directions.h │ ├── round.cpp │ ├── round.h │ ├── rows_to_matrix.cpp │ ├── rows_to_matrix.h │ ├── sample_edges.cpp │ ├── sample_edges.h │ ├── seam_edges.cpp │ ├── seam_edges.h │ ├── segment_segment_intersect.cpp │ ├── segment_segment_intersect.h │ ├── serialize.h │ ├── setdiff.cpp │ ├── setdiff.h │ ├── setunion.cpp │ ├── setunion.h │ ├── setxor.cpp │ ├── setxor.h │ ├── shape_diameter_function.cpp │ ├── shape_diameter_function.h │ ├── shortest_edge_and_midpoint.cpp │ ├── shortest_edge_and_midpoint.h │ ├── signed_angle.cpp │ ├── signed_angle.h │ ├── signed_distance.cpp │ ├── signed_distance.h │ ├── simplify_polyhedron.cpp │ ├── simplify_polyhedron.h │ ├── slice.cpp │ ├── slice.h │ ├── slice_cached.cpp │ ├── slice_cached.h │ ├── slice_into.cpp │ ├── slice_into.h │ ├── slice_mask.cpp │ ├── slice_mask.h │ ├── slice_tets.cpp │ ├── slice_tets.h │ ├── slim.cpp │ ├── slim.h │ ├── snap_points.cpp │ ├── snap_points.h │ ├── snap_to_canonical_view_quat.cpp │ ├── snap_to_canonical_view_quat.h │ ├── snap_to_fixed_up.cpp │ ├── snap_to_fixed_up.h │ ├── solid_angle.cpp │ ├── solid_angle.h │ ├── sort.cpp │ ├── sort.h │ ├── sort_angles.cpp │ ├── sort_angles.h │ ├── sort_triangles.cpp │ ├── sort_triangles.h │ ├── sort_vectors_ccw.cpp │ ├── sort_vectors_ccw.h │ ├── sortrows.cpp │ ├── sortrows.h │ ├── sparse.cpp │ ├── sparse.h │ ├── sparse_cached.cpp │ ├── sparse_cached.h │ ├── speye.cpp │ ├── speye.h │ ├── squared_edge_lengths.cpp │ ├── squared_edge_lengths.h │ ├── stdin_to_temp.cpp │ ├── stdin_to_temp.h │ ├── straighten_seams.cpp │ ├── straighten_seams.h │ ├── streamlines.cpp │ ├── streamlines.h │ ├── sum.cpp │ ├── sum.h │ ├── svd3x3.cpp │ ├── svd3x3.h │ ├── svd3x3_avx.cpp │ ├── svd3x3_avx.h │ ├── svd3x3_sse.cpp │ ├── svd3x3_sse.h │ ├── swept_volume_bounding_box.cpp │ ├── swept_volume_bounding_box.h │ ├── swept_volume_signed_distance.cpp │ ├── swept_volume_signed_distance.h │ ├── trackball.cpp │ ├── trackball.h │ ├── transpose_blocks.cpp │ ├── transpose_blocks.h │ ├── triangle │ ├── cdt.cpp │ ├── cdt.h │ ├── triangulate.cpp │ └── triangulate.h │ ├── triangle_fan.cpp │ ├── triangle_fan.h │ ├── triangle_triangle_adjacency.cpp │ ├── triangle_triangle_adjacency.h │ ├── triangles_from_strip.cpp │ ├── triangles_from_strip.h │ ├── two_axis_valuator_fixed_up.cpp │ ├── two_axis_valuator_fixed_up.h │ ├── uniformly_sample_two_manifold.cpp │ ├── uniformly_sample_two_manifold.h │ ├── unique.cpp │ ├── unique.h │ ├── unique_edge_map.cpp │ ├── unique_edge_map.h │ ├── unique_rows.cpp │ ├── unique_rows.h │ ├── unique_simplices.cpp │ ├── unique_simplices.h │ ├── unproject.cpp │ ├── unproject.h │ ├── unproject_in_mesh.cpp │ ├── unproject_in_mesh.h │ ├── unproject_onto_mesh.cpp │ ├── unproject_onto_mesh.h │ ├── unproject_ray.cpp │ ├── unproject_ray.h │ ├── unzip_corners.cpp │ ├── unzip_corners.h │ ├── upsample.cpp │ ├── upsample.h │ ├── vector_area_matrix.cpp │ ├── vector_area_matrix.h │ ├── verbose.h │ ├── vertex_triangle_adjacency.cpp │ ├── vertex_triangle_adjacency.h │ ├── volume.cpp │ ├── volume.h │ ├── voxel_grid.cpp │ ├── voxel_grid.h │ ├── winding_number.cpp │ ├── winding_number.h │ ├── writeBF.cpp │ ├── writeBF.h │ ├── writeDMAT.cpp │ ├── writeDMAT.h │ ├── writeMESH.cpp │ ├── writeMESH.h │ ├── writeOBJ.cpp │ ├── writeOBJ.h │ ├── writeOFF.cpp │ ├── writeOFF.h │ ├── writePLY.cpp │ ├── writePLY.h │ ├── writeSTL.cpp │ ├── writeSTL.h │ ├── writeTGF.cpp │ ├── writeTGF.h │ ├── writeWRL.cpp │ ├── writeWRL.h │ ├── write_triangle_mesh.cpp │ ├── write_triangle_mesh.h │ └── xml │ ├── ReAntTweakBarXMLSerialization.h │ ├── XMLSerializable.h │ ├── serialization_test.skip │ ├── serialize_xml.cpp │ ├── serialize_xml.h │ ├── writeDAE.cpp │ ├── writeDAE.h │ ├── write_triangle_mesh.cpp │ └── write_triangle_mesh.h └── main.cpp /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1) 2 | project(hole_fixer) 3 | 4 | include_directories(libigl/ libigl/eigen/) 5 | add_executable(hole_fixer main.cpp) 6 | 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Eric Arnebäck 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /img/bunnymontage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erkaman/hole_fixer/34869c54de69efa23a4a912ba21af8fc18a8ea5d/img/bunnymontage.png -------------------------------------------------------------------------------- /img/spheremontage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erkaman/hole_fixer/34869c54de69efa23a4a912ba21af8fc18a8ea5d/img/spheremontage.png -------------------------------------------------------------------------------- /libigl/eigen/Eigen/Array: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ARRAY_MODULE_H 2 | #define EIGEN_ARRAY_MODULE_H 3 | 4 | // include Core first to handle Eigen2 support macros 5 | #include "Core" 6 | 7 | #ifndef EIGEN2_SUPPORT 8 | #error The Eigen/Array header does no longer exist in Eigen3. All that functionality has moved to Eigen/Core. 9 | #endif 10 | 11 | #endif // EIGEN_ARRAY_MODULE_H 12 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(RegexUtils) 2 | test_escape_string_as_regex() 3 | 4 | file(GLOB Eigen_directory_files "*") 5 | 6 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 7 | 8 | foreach(f ${Eigen_directory_files}) 9 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src") 10 | list(APPEND Eigen_directory_files_to_install ${f}) 11 | endif() 12 | endforeach(f ${Eigen_directory_files}) 13 | 14 | install(FILES 15 | ${Eigen_directory_files_to_install} 16 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel 17 | ) 18 | 19 | add_subdirectory(src) 20 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CHOLESKY_MODULE_H 2 | #define EIGEN_CHOLESKY_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup Cholesky_Module Cholesky module 9 | * 10 | * 11 | * 12 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 13 | * Those decompositions are accessible via the following MatrixBase methods: 14 | * - MatrixBase::llt(), 15 | * - MatrixBase::ldlt() 16 | * 17 | * \code 18 | * #include 19 | * \endcode 20 | */ 21 | 22 | #include "src/misc/Solve.h" 23 | #include "src/Cholesky/LLT.h" 24 | #include "src/Cholesky/LDLT.h" 25 | #ifdef EIGEN_USE_LAPACKE 26 | #include "src/Cholesky/LLT_MKL.h" 27 | #endif 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_CHOLESKY_MODULE_H 32 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 33 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | //#include "Sparse" 3 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/Householder: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 2 | #define EIGEN_HOUSEHOLDER_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup Householder_Module Householder module 9 | * This module provides Householder transformations. 10 | * 11 | * \code 12 | * #include 13 | * \endcode 14 | */ 15 | 16 | #include "src/Householder/Householder.h" 17 | #include "src/Householder/HouseholderSequence.h" 18 | #include "src/Householder/BlockHouseholder.h" 19 | 20 | #include "src/Core/util/ReenableStupidWarnings.h" 21 | 22 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 23 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 24 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_JACOBI_MODULE_H 2 | #define EIGEN_JACOBI_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup Jacobi_Module Jacobi module 9 | * This module provides Jacobi and Givens rotations. 10 | * 11 | * \code 12 | * #include 13 | * \endcode 14 | * 15 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 16 | * - MatrixBase::applyOnTheLeft() 17 | * - MatrixBase::applyOnTheRight(). 18 | */ 19 | 20 | #include "src/Jacobi/Jacobi.h" 21 | 22 | #include "src/Core/util/ReenableStupidWarnings.h" 23 | 24 | #endif // EIGEN_JACOBI_MODULE_H 25 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 26 | 27 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/LeastSquares: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_REGRESSION_MODULE_H 2 | #define EIGEN_REGRESSION_MODULE_H 3 | 4 | #ifndef EIGEN2_SUPPORT 5 | #error LeastSquares is only available in Eigen2 support mode (define EIGEN2_SUPPORT) 6 | #endif 7 | 8 | // exclude from normal eigen3-only documentation 9 | #ifdef EIGEN2_SUPPORT 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "Eigenvalues" 16 | #include "Geometry" 17 | 18 | /** \defgroup LeastSquares_Module LeastSquares module 19 | * This module provides linear regression and related features. 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/Eigen2Support/LeastSquares.h" 27 | 28 | #include "src/Core/util/ReenableStupidWarnings.h" 29 | 30 | #endif // EIGEN2_SUPPORT 31 | 32 | #endif // EIGEN_REGRESSION_MODULE_H 33 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_METISSUPPORT_MODULE_H 2 | #define EIGEN_METISSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | extern "C" { 9 | #include 10 | } 11 | 12 | 13 | /** \ingroup Support_modules 14 | * \defgroup MetisSupport_Module MetisSupport module 15 | * 16 | * \code 17 | * #include 18 | * \endcode 19 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 20 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 21 | */ 22 | 23 | 24 | #include "src/MetisSupport/MetisSupport.h" 25 | 26 | #include "src/Core/util/ReenableStupidWarnings.h" 27 | 28 | #endif // EIGEN_METISSUPPORT_MODULE_H 29 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 2 | #define EIGEN_PARDISOSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include 9 | 10 | #include 11 | 12 | /** \ingroup Support_modules 13 | * \defgroup PardisoSupport_Module PardisoSupport module 14 | * 15 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 16 | * 17 | * \code 18 | * #include 19 | * \endcode 20 | * 21 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. 22 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 23 | * 24 | */ 25 | 26 | #include "src/PardisoSupport/PardisoSupport.h" 27 | 28 | #include "src/Core/util/ReenableStupidWarnings.h" 29 | 30 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 31 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/QR: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_QR_MODULE_H 2 | #define EIGEN_QR_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include "Cholesky" 9 | #include "Jacobi" 10 | #include "Householder" 11 | 12 | /** \defgroup QR_Module QR module 13 | * 14 | * 15 | * 16 | * This module provides various QR decompositions 17 | * This module also provides some MatrixBase methods, including: 18 | * - MatrixBase::qr(), 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | */ 24 | 25 | #include "src/misc/Solve.h" 26 | #include "src/QR/HouseholderQR.h" 27 | #include "src/QR/FullPivHouseholderQR.h" 28 | #include "src/QR/ColPivHouseholderQR.h" 29 | #ifdef EIGEN_USE_LAPACKE 30 | #include "src/QR/HouseholderQR_MKL.h" 31 | #include "src/QR/ColPivHouseholderQR_MKL.h" 32 | #endif 33 | 34 | #ifdef EIGEN2_SUPPORT 35 | #include "src/Eigen2Support/QR.h" 36 | #endif 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #ifdef EIGEN2_SUPPORT 41 | #include "Eigenvalues" 42 | #endif 43 | 44 | #endif // EIGEN_QR_MODULE_H 45 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 46 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EIGEN_QTMALLOC_MODULE_H 3 | #define EIGEN_QTMALLOC_MODULE_H 4 | 5 | #include "Core" 6 | 7 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 8 | 9 | #include "src/Core/util/DisableStupidWarnings.h" 10 | 11 | void *qMalloc(size_t size) 12 | { 13 | return Eigen::internal::aligned_malloc(size); 14 | } 15 | 16 | void qFree(void *ptr) 17 | { 18 | Eigen::internal::aligned_free(ptr); 19 | } 20 | 21 | void *qRealloc(void *ptr, size_t size) 22 | { 23 | void* newPtr = Eigen::internal::aligned_malloc(size); 24 | memcpy(newPtr, ptr, size); 25 | Eigen::internal::aligned_free(ptr); 26 | return newPtr; 27 | } 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif 32 | 33 | #endif // EIGEN_QTMALLOC_MODULE_H 34 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 35 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 2 | #define EIGEN_SPQRSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include "SuiteSparseQR.hpp" 9 | 10 | /** \ingroup Support_modules 11 | * \defgroup SPQRSupport_Module SuiteSparseQR module 12 | * 13 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 14 | * 15 | * \code 16 | * #include 17 | * \endcode 18 | * 19 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). 20 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 21 | * 22 | */ 23 | 24 | #include "src/misc/Solve.h" 25 | #include "src/misc/SparseSolve.h" 26 | #include "src/CholmodSupport/CholmodSupport.h" 27 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/SVD: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SVD_MODULE_H 2 | #define EIGEN_SVD_MODULE_H 3 | 4 | #include "QR" 5 | #include "Householder" 6 | #include "Jacobi" 7 | 8 | #include "src/Core/util/DisableStupidWarnings.h" 9 | 10 | /** \defgroup SVD_Module SVD module 11 | * 12 | * 13 | * 14 | * This module provides SVD decomposition for matrices (both real and complex). 15 | * This decomposition is accessible via the following MatrixBase method: 16 | * - MatrixBase::jacobiSvd() 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/misc/Solve.h" 24 | #include "src/SVD/JacobiSVD.h" 25 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 26 | #include "src/SVD/JacobiSVD_MKL.h" 27 | #endif 28 | #include "src/SVD/UpperBidiagonalization.h" 29 | 30 | #ifdef EIGEN2_SUPPORT 31 | #include "src/Eigen2Support/SVD.h" 32 | #endif 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif // EIGEN_SVD_MODULE_H 37 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 38 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSE_MODULE_H 2 | #define EIGEN_SPARSE_MODULE_H 3 | 4 | /** \defgroup Sparse_Module Sparse meta-module 5 | * 6 | * Meta-module including all related modules: 7 | * - \ref SparseCore_Module 8 | * - \ref OrderingMethods_Module 9 | * - \ref SparseCholesky_Module 10 | * - \ref SparseLU_Module 11 | * - \ref SparseQR_Module 12 | * - \ref IterativeLinearSolvers_Module 13 | * 14 | * \code 15 | * #include 16 | * \endcode 17 | */ 18 | 19 | #include "SparseCore" 20 | #include "OrderingMethods" 21 | #include "SparseCholesky" 22 | #include "SparseLU" 23 | #include "SparseQR" 24 | #include "IterativeLinearSolvers" 25 | 26 | #endif // EIGEN_SPARSE_MODULE_H 27 | 28 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSEQR_MODULE_H 2 | #define EIGEN_SPARSEQR_MODULE_H 3 | 4 | #include "SparseCore" 5 | #include "OrderingMethods" 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup SparseQR_Module SparseQR module 9 | * \brief Provides QR decomposition for sparse matrices 10 | * 11 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 12 | * The columns of the input matrix should be reordered to limit the fill-in during the 13 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 14 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 15 | * of built-in and external ordering methods. 16 | * 17 | * \code 18 | * #include 19 | * \endcode 20 | * 21 | * 22 | */ 23 | 24 | #include "src/misc/Solve.h" 25 | #include "src/misc/SparseSolve.h" 26 | 27 | #include "OrderingMethods" 28 | #include "src/SparseCore/SparseColEtree.h" 29 | #include "src/SparseQR/SparseQR.h" 30 | 31 | #include "src/Core/util/ReenableStupidWarnings.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/StdDeque: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_MODULE_H 12 | #define EIGEN_STDDEQUE_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdDeque.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDDEQUE_MODULE_H 28 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ 17 | 18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) 19 | 20 | #else 21 | 22 | #include "src/StlSupport/StdList.h" 23 | 24 | #endif 25 | 26 | #endif // EIGEN_STDLIST_MODULE_H 27 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/StdVector: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_MODULE_H 12 | #define EIGEN_STDVECTOR_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdVector.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDVECTOR_MODULE_H 28 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB Eigen_src_subdirectories "*") 2 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 3 | foreach(f ${Eigen_src_subdirectories}) 4 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" ) 5 | add_subdirectory(${f}) 6 | endif() 7 | endforeach() 8 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Cholesky/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Cholesky_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Cholesky_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Cholesky COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/CholmodSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_CholmodSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_CholmodSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/CholmodSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(products) 9 | ADD_SUBDIRECTORY(util) 10 | ADD_SUBDIRECTORY(arch) 11 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Core/arch/AltiVec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_AltiVec_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_AltiVec_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/AltiVec COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Core/arch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY(SSE) 2 | ADD_SUBDIRECTORY(AltiVec) 3 | ADD_SUBDIRECTORY(NEON) 4 | ADD_SUBDIRECTORY(Default) 5 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Core/arch/Default/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_Default_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_Default_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/Default COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Core/arch/NEON/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_NEON_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_NEON_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/NEON COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Core/arch/SSE/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_SSE_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_SSE_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/SSE COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Core/products/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_Product_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_Product_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/products COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Core/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_util_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_util_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/util COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED 2 | #undef EIGEN_WARNINGS_DISABLED 3 | 4 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 5 | #ifdef _MSC_VER 6 | #pragma warning( pop ) 7 | #elif defined __INTEL_COMPILER 8 | #pragma warning pop 9 | #elif defined __clang__ 10 | #pragma clang diagnostic pop 11 | #elif defined __GNUC__ && __GNUC__>=6 12 | #pragma GCC diagnostic pop 13 | #endif 14 | 15 | #endif 16 | 17 | #endif // EIGEN_WARNINGS_DISABLED 18 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Eigen2Support/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Eigen2Support_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Eigen2Support_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigen2Support COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(Geometry) -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Eigen2Support/Geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Eigen2Support_Geometry_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Eigen2Support_Geometry_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigen2Support/Geometry 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Eigen2Support/Macros.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN2_MACROS_H 11 | #define EIGEN2_MACROS_H 12 | 13 | #define ei_assert eigen_assert 14 | #define ei_internal_assert eigen_internal_assert 15 | 16 | #define EIGEN_ALIGN_128 EIGEN_ALIGN16 17 | 18 | #define EIGEN_ARCH_WANTS_ALIGNMENT EIGEN_ALIGN_STATICALLY 19 | 20 | #endif // EIGEN2_MACROS_H 21 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Eigenvalues/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_EIGENVALUES_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_EIGENVALUES_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigenvalues COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Geometry_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Geometry_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Geometry COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(arch) 9 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Geometry/arch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Geometry_arch_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Geometry_arch_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Geometry/arch COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Householder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Householder_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Householder_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Householder COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/IterativeLinearSolvers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_IterativeLinearSolvers_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_IterativeLinearSolvers_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/IterativeLinearSolvers COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/Jacobi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Jacobi_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Jacobi_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Jacobi COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/LU/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_LU_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_LU_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LU COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(arch) 9 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/LU/arch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_LU_arch_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_LU_arch_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LU/arch COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/MetisSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_MetisSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_MetisSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/MetisSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/OrderingMethods/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_OrderingMethods_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_OrderingMethods_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/OrderingMethods COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/PaStiXSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_PastixSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_PastixSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/PaStiXSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/PardisoSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_PardisoSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_PardisoSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/PardisoSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/QR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_QR_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_QR_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/QR COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/SPQRSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SPQRSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SPQRSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SPQRSupport/ COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/SVD/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SVD_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SVD_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SVD COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/SparseCholesky/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseCholesky_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseCholesky_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCholesky COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/SparseCore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseCore_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseCore_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCore COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/SparseCore/SparseFuzzy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_FUZZY_H 11 | #define EIGEN_SPARSE_FUZZY_H 12 | 13 | // template 14 | // template 15 | // bool SparseMatrixBase::isApprox( 16 | // const OtherDerived& other, 17 | // typename NumTraits::Real prec 18 | // ) const 19 | // { 20 | // const typename internal::nested::type nested(derived()); 21 | // const typename internal::nested::type otherNested(other.derived()); 22 | // return (nested - otherNested).cwise().abs2().sum() 23 | // <= prec * prec * (std::min)(nested.cwise().abs2().sum(), otherNested.cwise().abs2().sum()); 24 | // } 25 | 26 | #endif // EIGEN_SPARSE_FUZZY_H 27 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/SparseLU/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseLU_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseLU_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseLU COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/SparseQR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseQR_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseQR_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseQR/ COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/StlSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_StlSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_StlSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/StlSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/SuperLUSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SuperLUSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SuperLUSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SuperLUSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/UmfPackSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_UmfPackSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_UmfPackSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/UmfPackSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/misc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_misc_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_misc_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/misc COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/Eigen/src/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_plugins_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_plugins_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/plugins COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Eigen) 2 | add_subdirectory(doc EXCLUDE_FROM_ALL) 3 | if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) 4 | add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest 5 | else() 6 | add_subdirectory(test EXCLUDE_FROM_ALL) 7 | endif() 8 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/ArpackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_ARPACKSUPPORT_MODULE_H 10 | #define EIGEN_ARPACKSUPPORT_MODULE_H 11 | 12 | #include 13 | 14 | #include 15 | 16 | /** \defgroup ArpackSupport_Module Arpack support module 17 | * 18 | * This module provides a wrapper to Arpack, a library for sparse eigenvalue decomposition. 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | */ 24 | 25 | #include 26 | #include "src/Eigenvalues/ArpackSelfAdjointEigenSolver.h" 27 | 28 | #include 29 | 30 | #endif // EIGEN_ARPACKSUPPORT_MODULE_H 31 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 32 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Eigen_HEADERS AdolcForward AlignedVector3 ArpackSupport AutoDiff BVH FFT IterativeSolvers KroneckerProduct LevenbergMarquardt 2 | MatrixFunctions MoreVectorization MPRealSupport NonLinearOptimization NumericalDiff OpenGLSupport Polynomials 3 | Skyline SparseExtra Splines 4 | ) 5 | 6 | install(FILES 7 | ${Eigen_HEADERS} 8 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen COMPONENT Devel 9 | ) 10 | 11 | add_subdirectory(src) 12 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/KroneckerProduct: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_KRONECKER_PRODUCT_MODULE_H 10 | #define EIGEN_KRONECKER_PRODUCT_MODULE_H 11 | 12 | #include "../../Eigen/Core" 13 | 14 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 15 | 16 | namespace Eigen { 17 | 18 | /** 19 | * \defgroup KroneckerProduct_Module KroneckerProduct module 20 | * 21 | * This module contains an experimental Kronecker product implementation. 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | */ 27 | 28 | } // namespace Eigen 29 | 30 | #include "src/KroneckerProduct/KroneckerTensorProduct.h" 31 | 32 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 33 | 34 | #endif // EIGEN_KRONECKER_PRODUCT_MODULE_H 35 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/MoreVectorization: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_MOREVECTORIZATION_MODULE_H 10 | #define EIGEN_MOREVECTORIZATION_MODULE_H 11 | 12 | #include 13 | 14 | namespace Eigen { 15 | 16 | /** 17 | * \defgroup MoreVectorization More vectorization module 18 | */ 19 | 20 | } 21 | 22 | #include "src/MoreVectorization/MathFunctions.h" 23 | 24 | #endif // EIGEN_MOREVECTORIZATION_MODULE_H 25 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/Skyline: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_SKYLINE_MODULE_H 10 | #define EIGEN_SKYLINE_MODULE_H 11 | 12 | 13 | #include "Eigen/Core" 14 | 15 | #include "Eigen/src/Core/util/DisableStupidWarnings.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | /** 23 | * \defgroup Skyline_Module Skyline module 24 | * 25 | * 26 | * 27 | * 28 | */ 29 | 30 | #include "src/Skyline/SkylineUtil.h" 31 | #include "src/Skyline/SkylineMatrixBase.h" 32 | #include "src/Skyline/SkylineStorage.h" 33 | #include "src/Skyline/SkylineMatrix.h" 34 | #include "src/Skyline/SkylineInplaceLU.h" 35 | #include "src/Skyline/SkylineProduct.h" 36 | 37 | #include "Eigen/src/Core/util/ReenableStupidWarnings.h" 38 | 39 | #endif // EIGEN_SKYLINE_MODULE_H 40 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/Splines: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 20010-2011 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPLINES_MODULE_H 11 | #define EIGEN_SPLINES_MODULE_H 12 | 13 | namespace Eigen 14 | { 15 | /** 16 | * \defgroup Splines_Module Spline and spline fitting module 17 | * 18 | * This module provides a simple multi-dimensional spline class while 19 | * offering most basic functionality to fit a spline to point sets. 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | } 26 | 27 | #include "src/Splines/SplineFwd.h" 28 | #include "src/Splines/Spline.h" 29 | #include "src/Splines/SplineFitting.h" 30 | 31 | #endif // EIGEN_SPLINES_MODULE_H 32 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/AutoDiff/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_AutoDiff_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_AutoDiff_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/AutoDiff COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/BVH/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_BVH_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_BVH_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/BVH COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY(AutoDiff) 2 | ADD_SUBDIRECTORY(BVH) 3 | ADD_SUBDIRECTORY(Eigenvalues) 4 | ADD_SUBDIRECTORY(FFT) 5 | ADD_SUBDIRECTORY(IterativeSolvers) 6 | ADD_SUBDIRECTORY(KroneckerProduct) 7 | ADD_SUBDIRECTORY(LevenbergMarquardt) 8 | ADD_SUBDIRECTORY(MatrixFunctions) 9 | ADD_SUBDIRECTORY(MoreVectorization) 10 | ADD_SUBDIRECTORY(NonLinearOptimization) 11 | ADD_SUBDIRECTORY(NumericalDiff) 12 | ADD_SUBDIRECTORY(Polynomials) 13 | ADD_SUBDIRECTORY(Skyline) 14 | ADD_SUBDIRECTORY(SparseExtra) 15 | ADD_SUBDIRECTORY(Splines) 16 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/Eigenvalues/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Eigenvalues_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Eigenvalues_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/Eigenvalues COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/FFT/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_FFT_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_FFT_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/FFT COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/IterativeSolvers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_IterativeSolvers_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_IterativeSolvers_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/IterativeSolvers COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/KroneckerProduct/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_KroneckerProduct_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_KroneckerProduct_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/KroneckerProduct COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/LevenbergMarquardt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_LevenbergMarquardt_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_LevenbergMarquardt_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/LevenbergMarquardt COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/MatrixFunctions/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_MatrixFunctions_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_MatrixFunctions_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/MatrixFunctions COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/MoreVectorization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_MoreVectorization_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_MoreVectorization_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/MoreVectorization COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/NonLinearOptimization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_NonLinearOptimization_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_NonLinearOptimization_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/NonLinearOptimization COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/NumericalDiff/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_NumericalDiff_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_NumericalDiff_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/NumericalDiff COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/Polynomials/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Polynomials_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Polynomials_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/Polynomials COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/SVD/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SVD_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SVD_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}unsupported/Eigen/src/SVD COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/Skyline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Skyline_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Skyline_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/Skyline COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/SparseExtra/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseExtra_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseExtra_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/SparseExtra COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/Eigen/src/Splines/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Splines_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Splines_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/Splines COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE) 2 | 3 | add_subdirectory(examples) 4 | add_subdirectory(snippets) 5 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/Overview.dox: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | /** \mainpage Eigen's unsupported modules 4 | 5 | This is the API documentation for Eigen's unsupported modules. 6 | 7 | These modules are contributions from various users. They are provided "as is", without any support. 8 | 9 | Click on the \e Modules tab at the top of this page to get a list of all unsupported modules. 10 | 11 | Don't miss the official Eigen documentation. 12 | 13 | */ 14 | 15 | /* 16 | 17 | \defgroup Unsupported_modules Unsupported modules 18 | 19 | The unsupported modules are contributions from various users. They are 20 | provided "as is", without any support. Nevertheless, some of them are 21 | subject to be included in Eigen in the future. 22 | 23 | */ 24 | 25 | } 26 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB examples_SRCS "*.cpp") 2 | 3 | ADD_CUSTOM_TARGET(unsupported_examples) 4 | 5 | INCLUDE_DIRECTORIES(../../../unsupported ../../../unsupported/test) 6 | 7 | FOREACH(example_src ${examples_SRCS}) 8 | GET_FILENAME_COMPONENT(example ${example_src} NAME_WE) 9 | ADD_EXECUTABLE(example_${example} ${example_src}) 10 | if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) 11 | target_link_libraries(example_${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) 12 | endif() 13 | ADD_CUSTOM_COMMAND( 14 | TARGET example_${example} 15 | POST_BUILD 16 | COMMAND example_${example} 17 | ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out 18 | ) 19 | ADD_DEPENDENCIES(unsupported_examples example_${example}) 20 | ENDFOREACH(example_src) 21 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/examples/MatrixExponential.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | 10 | MatrixXd A(3,3); 11 | A << 0, -pi/4, 0, 12 | pi/4, 0, 0, 13 | 0, 0, 0; 14 | std::cout << "The matrix A is:\n" << A << "\n\n"; 15 | std::cout << "The matrix exponential of A is:\n" << A.exp() << "\n\n"; 16 | } 17 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/examples/MatrixFunction.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | std::complex expfn(std::complex x, int) 7 | { 8 | return std::exp(x); 9 | } 10 | 11 | int main() 12 | { 13 | const double pi = std::acos(-1.0); 14 | 15 | MatrixXd A(3,3); 16 | A << 0, -pi/4, 0, 17 | pi/4, 0, 0, 18 | 0, 0, 0; 19 | 20 | std::cout << "The matrix A is:\n" << A << "\n\n"; 21 | std::cout << "The matrix exponential of A is:\n" 22 | << A.matrixFunction(expfn) << "\n\n"; 23 | } 24 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/examples/MatrixLogarithm.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | using std::sqrt; 9 | MatrixXd A(3,3); 10 | A << 0.5*sqrt(2), -0.5*sqrt(2), 0, 11 | 0.5*sqrt(2), 0.5*sqrt(2), 0, 12 | 0, 0, 1; 13 | std::cout << "The matrix A is:\n" << A << "\n\n"; 14 | std::cout << "The matrix logarithm of A is:\n" << A.log() << "\n"; 15 | } 16 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/examples/MatrixPower.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | Matrix3d A; 10 | A << cos(1), -sin(1), 0, 11 | sin(1), cos(1), 0, 12 | 0 , 0 , 1; 13 | std::cout << "The matrix A is:\n" << A << "\n\n" 14 | "The matrix power A^(pi/4) is:\n" << A.pow(pi/4) << std::endl; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/examples/MatrixPower_optimal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | Matrix4cd A = Matrix4cd::Random(); 9 | MatrixPower Apow(A); 10 | 11 | std::cout << "The matrix A is:\n" << A << "\n\n" 12 | "A^3.1 is:\n" << Apow(3.1) << "\n\n" 13 | "A^3.3 is:\n" << Apow(3.3) << "\n\n" 14 | "A^3.7 is:\n" << Apow(3.7) << "\n\n" 15 | "A^3.9 is:\n" << Apow(3.9) << std::endl; 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/examples/MatrixSine.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | MatrixXd A = MatrixXd::Random(3,3); 9 | std::cout << "A = \n" << A << "\n\n"; 10 | 11 | MatrixXd sinA = A.sin(); 12 | std::cout << "sin(A) = \n" << sinA << "\n\n"; 13 | 14 | MatrixXd cosA = A.cos(); 15 | std::cout << "cos(A) = \n" << cosA << "\n\n"; 16 | 17 | // The matrix functions satisfy sin^2(A) + cos^2(A) = I, 18 | // like the scalar functions. 19 | std::cout << "sin^2(A) + cos^2(A) = \n" << sinA*sinA + cosA*cosA << "\n\n"; 20 | } 21 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/examples/MatrixSinh.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | MatrixXf A = MatrixXf::Random(3,3); 9 | std::cout << "A = \n" << A << "\n\n"; 10 | 11 | MatrixXf sinhA = A.sinh(); 12 | std::cout << "sinh(A) = \n" << sinhA << "\n\n"; 13 | 14 | MatrixXf coshA = A.cosh(); 15 | std::cout << "cosh(A) = \n" << coshA << "\n\n"; 16 | 17 | // The matrix functions satisfy cosh^2(A) - sinh^2(A) = I, 18 | // like the scalar functions. 19 | std::cout << "cosh^2(A) - sinh^2(A) = \n" << coshA*coshA - sinhA*sinhA << "\n\n"; 20 | } 21 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/examples/MatrixSquareRoot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | 10 | MatrixXd A(2,2); 11 | A << cos(pi/3), -sin(pi/3), 12 | sin(pi/3), cos(pi/3); 13 | std::cout << "The matrix A is:\n" << A << "\n\n"; 14 | std::cout << "The matrix square root of A is:\n" << A.sqrt() << "\n\n"; 15 | std::cout << "The square of the last matrix is:\n" << A.sqrt() * A.sqrt() << "\n"; 16 | } 17 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/doc/examples/PolynomialUtils1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | Vector4d roots = Vector4d::Random(); 10 | cout << "Roots: " << roots.transpose() << endl; 11 | Eigen::Matrix polynomial; 12 | roots_to_monicPolynomial( roots, polynomial ); 13 | cout << "Polynomial: "; 14 | for( int i=0; i<4; ++i ){ cout << polynomial[i] << ".x^" << i << "+ "; } 15 | cout << polynomial[4] << ".x^4" << endl; 16 | Vector4d evaluation; 17 | for( int i=0; i<4; ++i ){ 18 | evaluation[i] = poly_eval( polynomial, roots[i] ); } 19 | cout << "Evaluation of the polynomial at the roots: " << evaluation.transpose(); 20 | } 21 | -------------------------------------------------------------------------------- /libigl/eigen/unsupported/test/FFT.cpp: -------------------------------------------------------------------------------- 1 | #define test_FFTW test_FFT 2 | #include "FFTW.cpp" 3 | -------------------------------------------------------------------------------- /libigl/igl/Attribute.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2018 Jérémie Dumas 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ATTRIBUTE_H 9 | #define IGL_ATTRIBUTE_H 10 | 11 | #include 12 | 13 | namespace igl 14 | { 15 | 16 | struct AttributeBase 17 | { 18 | private: 19 | std::type_index derived_type_; 20 | public: 21 | AttributeBase(std::type_index t) : derived_type_(t) { } 22 | virtual ~AttributeBase() = default; 23 | std::type_index type() const { return derived_type_; } 24 | }; 25 | 26 | // ----------------------------------------------------------------------------- 27 | 28 | template 29 | struct Attribute : public AttributeBase 30 | { 31 | // Constructor 32 | Attribute() : AttributeBase(typeid(T)) { } 33 | 34 | // Data 35 | T content_; 36 | }; 37 | 38 | } // namespace igl 39 | 40 | #endif // IGL_ATTRIBUTE_H 41 | -------------------------------------------------------------------------------- /libigl/igl/C_STR.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_C_STR_H 9 | #define IGL_C_STR_H 10 | // http://stackoverflow.com/a/2433143/148668 11 | // Suppose you have a function: 12 | // void func(const char * c); 13 | // Then you can write: 14 | // func(C_STR("foo"<<1<<"bar")); 15 | #include 16 | #include 17 | #define C_STR(X) static_cast(std::ostringstream().flush() << X).str().c_str() 18 | #endif 19 | -------------------------------------------------------------------------------- /libigl/igl/EPS.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "EPS.h" 9 | 10 | template <> IGL_INLINE float igl::EPS() 11 | { 12 | return igl::FLOAT_EPS; 13 | } 14 | template <> IGL_INLINE double igl::EPS() 15 | { 16 | return igl::DOUBLE_EPS; 17 | } 18 | 19 | template <> IGL_INLINE float igl::EPS_SQ() 20 | { 21 | return igl::FLOAT_EPS_SQ; 22 | } 23 | template <> IGL_INLINE double igl::EPS_SQ() 24 | { 25 | return igl::DOUBLE_EPS_SQ; 26 | } 27 | 28 | #ifdef IGL_STATIC_LIBRARY 29 | // Explicit template instantiation 30 | #endif 31 | -------------------------------------------------------------------------------- /libigl/igl/Hit.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 2014 Christian Schüller 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla Public License 7 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 8 | // obtain one at http://mozilla.org/MPL/2.0/. 9 | #ifndef IGL_HIT_H 10 | #define IGL_HIT_H 11 | 12 | namespace igl 13 | { 14 | // Reimplementation of the embree::Hit struct from embree1.0 15 | // 16 | // TODO: template on floating point type 17 | struct Hit 18 | { 19 | int id; // primitive id 20 | int gid; // geometry id 21 | float u,v; // barycentric coordinates 22 | float t; // distance = direction*t to intersection 23 | }; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /libigl/igl/IO: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IO 9 | #define IGL_IO 10 | // Input and output functions 11 | #include "read_triangle_mesh.h" 12 | #include "readDMAT.h" 13 | #include "readMESH.h" 14 | #include "readNODE.h" 15 | #include "readOBJ.h" 16 | #include "readOFF.h" 17 | #include "readTGF.h" 18 | #include "readWRL.h" 19 | #include "readCSV.h" 20 | #include "file_contents_as_string.h" 21 | #include "write_triangle_mesh.h" 22 | #include "writeDMAT.h" 23 | #include "writeMESH.h" 24 | #include "writeOBJ.h" 25 | #include "writeOFF.h" 26 | #include "writeTGF.h" 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/MeshBooleanType.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MESH_BOOLEAN_TYPE_H 9 | #define IGL_MESH_BOOLEAN_TYPE_H 10 | namespace igl 11 | { 12 | enum MeshBooleanType 13 | { 14 | MESH_BOOLEAN_TYPE_UNION = 0, 15 | MESH_BOOLEAN_TYPE_INTERSECT = 1, 16 | MESH_BOOLEAN_TYPE_MINUS = 2, 17 | MESH_BOOLEAN_TYPE_XOR = 3, 18 | MESH_BOOLEAN_TYPE_RESOLVE = 4, 19 | NUM_MESH_BOOLEAN_TYPES = 5 20 | }; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /libigl/igl/NormalType.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_NORMALTYPE_H 9 | #define IGL_NORMALTYPE_H 10 | 11 | namespace igl 12 | { 13 | // PER_VERTEX_NORMALS Normals computed per vertex based on incident faces 14 | // PER_FACE_NORMALS Normals computed per face 15 | // PER_CORNER_NORMALS Normals computed per corner (aka wedge) based on 16 | // incident faces without sharp edge 17 | enum NormalType 18 | { 19 | PER_VERTEX_NORMALS, 20 | PER_FACE_NORMALS, 21 | PER_CORNER_NORMALS 22 | }; 23 | # define NUM_NORMAL_TYPE 3 24 | } 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /libigl/igl/ONE.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ONE_H 9 | #define IGL_ONE_H 10 | namespace igl 11 | { 12 | // Often one needs a reference to a dummy variable containing one as its 13 | // value, for example when using AntTweakBar's 14 | // TwSetParam( "3D View", "opened", TW_PARAM_INT32, 1, &INT_ONE); 15 | const char CHAR_ONE = 1; 16 | const int INT_ONE = 1; 17 | const unsigned int UNSIGNED_INT_ONE = 1; 18 | const double DOUBLE_ONE = 1; 19 | const float FLOAT_ONE = 1; 20 | } 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /libigl/igl/PI.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_PI_H 9 | #define IGL_PI_H 10 | namespace igl 11 | { 12 | // Use standard mathematical constants' M_PI if available 13 | #ifdef M_PI 14 | const double PI = M_PI; 15 | #else 16 | const double PI = 3.1415926535897932384626433832795; 17 | #endif 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /libigl/igl/STR.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_STR_H 9 | #define IGL_STR_H 10 | // http://stackoverflow.com/a/2433143/148668 11 | #include 12 | #include 13 | // Suppose you have a function: 14 | // void func(std::string c); 15 | // Then you can write: 16 | // func(STR("foo"<<1<<"bar")); 17 | #define STR(X) static_cast(std::ostringstream().flush() << X).str() 18 | #endif 19 | -------------------------------------------------------------------------------- /libigl/igl/SolverStatus.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_SOLVER_STATUS_H 9 | #define IGL_SOLVER_STATUS_H 10 | namespace igl 11 | { 12 | enum SolverStatus 13 | { 14 | // Good 15 | SOLVER_STATUS_CONVERGED = 0, 16 | // OK 17 | SOLVER_STATUS_MAX_ITER = 1, 18 | // Bad 19 | SOLVER_STATUS_ERROR = 2, 20 | NUM_SOLVER_STATUSES = 3, 21 | }; 22 | }; 23 | #endif 24 | -------------------------------------------------------------------------------- /libigl/igl/WindingNumberMethod.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_WINDINGNUMBERMETHOD_H 9 | #define IGL_WINDINGNUMBERMETHOD_H 10 | namespace igl 11 | { 12 | // EXACT_WINDING_NUMBER_METHOD exact hierarchical evaluation 13 | // APPROX_SIMPLE_WINDING_NUMBER_METHOD poor approximation 14 | // APPROX_CACHE_WINDING_NUMBER_METHOD another poor approximation 15 | enum WindingNumberMethod 16 | { 17 | EXACT_WINDING_NUMBER_METHOD = 0, 18 | APPROX_SIMPLE_WINDING_NUMBER_METHOD = 1, 19 | APPROX_CACHE_WINDING_NUMBER_METHOD = 2, 20 | NUM_WINDING_NUMBER_METHODS = 3 21 | }; 22 | } 23 | #endif 24 | -------------------------------------------------------------------------------- /libigl/igl/ZERO.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ZERO_H 9 | #define IGL_ZERO_H 10 | namespace igl 11 | { 12 | // Often one needs a reference to a dummy variable containing zero as its 13 | // value, for example when using AntTweakBar's 14 | // TwSetParam( "3D View", "opened", TW_PARAM_INT32, 1, &INT_ZERO); 15 | const char CHAR_ZERO = 0; 16 | const int INT_ZERO = 0; 17 | const unsigned int UNSIGNED_INT_ZERO = 0; 18 | const double DOUBLE_ZERO = 0; 19 | const float FLOAT_ZERO = 0; 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /libigl/igl/all.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "all.h" 9 | #include "redux.h" 10 | 11 | 12 | template 13 | IGL_INLINE void igl::all( 14 | const Eigen::SparseMatrix & A, 15 | const int dim, 16 | Eigen::PlainObjectBase& B) 17 | { 18 | typedef typename DerivedB::Scalar Scalar; 19 | igl::redux(A,dim,[](Scalar a, Scalar b){ return a && b!=0;},B); 20 | } 21 | 22 | #ifdef IGL_STATIC_LIBRARY 23 | // Explicit template instantiation 24 | #endif 25 | 26 | 27 | -------------------------------------------------------------------------------- /libigl/igl/all.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ALL_H 9 | #define IGL_ALL_H 10 | #include "igl_inline.h" 11 | #include 12 | #include 13 | namespace igl 14 | { 15 | // For Dense matrices use: A.rowwise().all() or A.colwise().all() 16 | // 17 | // Inputs: 18 | // A m by n sparse matrix 19 | // dim dimension along which to check for all (1 or 2) 20 | // Output: 21 | // B n-long vector (if dim == 1) 22 | // or 23 | // B m-long vector (if dim == 2) 24 | // 25 | template 26 | IGL_INLINE void all( 27 | const Eigen::SparseMatrix & A, 28 | const int dim, 29 | Eigen::PlainObjectBase& B); 30 | } 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "all.cpp" 33 | #endif 34 | #endif 35 | 36 | 37 | -------------------------------------------------------------------------------- /libigl/igl/angular_distance.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "angular_distance.h" 9 | #include 10 | #include 11 | IGL_INLINE double igl::angular_distance( 12 | const Eigen::Quaterniond & A, 13 | const Eigen::Quaterniond & B) 14 | { 15 | assert(fabs(A.norm()-1) 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ANGULAR_DISTANCE_H 9 | #define IGL_ANGULAR_DISTANCE_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // The "angular distance" between two unit quaternions is the angle of the 15 | // smallest rotation (treated as an Axis and Angle) that takes A to B. 16 | // 17 | // Inputs: 18 | // A unit quaternion 19 | // B unit quaternion 20 | // Returns angular distance 21 | IGL_INLINE double angular_distance( 22 | const Eigen::Quaterniond & A, 23 | const Eigen::Quaterniond & B); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | #include "angular_distance.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libigl/igl/anttweakbar/cocoa_key_to_anttweakbar_key.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ANTTWEAKBAR_COCOA_KEY_TO_ANTTWEAKBAR_KEY_H 9 | #define IGL_ANTTWEAKBAR_COCOA_KEY_TO_ANTTWEAKBAR_KEY_H 10 | #include "../igl_inline.h" 11 | 12 | 13 | namespace igl 14 | { 15 | namespace anttweakbar 16 | { 17 | // Convert an unsigned char (like that from Cocoa apps) to AntTweakBar key 18 | // code. 19 | // See also: TranslateKey() in TwMgr.cpp in AntTweakBar source 20 | // Inputs: 21 | // key unsigned char key from keyboard 22 | // Returns int of new key code 23 | IGL_INLINE int cocoa_key_to_anttweakbar_key(int key); 24 | } 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "cocoa_key_to_anttweakbar_key.cpp" 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libigl/igl/any.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "any.h" 9 | #include "redux.h" 10 | 11 | 12 | template 13 | IGL_INLINE void igl::any( 14 | const Eigen::SparseMatrix & A, 15 | const int dim, 16 | Eigen::PlainObjectBase& B) 17 | { 18 | typedef typename DerivedB::Scalar Scalar; 19 | igl::redux(A,dim,[](Scalar a, Scalar b){ return a || b!=0;},B); 20 | } 21 | 22 | #ifdef IGL_STATIC_LIBRARY 23 | // Explicit template instantiation 24 | // generated by autoexplicit.sh 25 | template void igl::any >(Eigen::SparseMatrix const&, int, Eigen::PlainObjectBase >&); 26 | #endif 27 | -------------------------------------------------------------------------------- /libigl/igl/any.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ANY_H 9 | #define IGL_ANY_H 10 | #include "igl_inline.h" 11 | #include 12 | #include 13 | namespace igl 14 | { 15 | // For Dense matrices use: A.rowwise().any() or A.colwise().any() 16 | // 17 | // Inputs: 18 | // A m by n sparse matrix 19 | // dim dimension along which to check for any (1 or 2) 20 | // Output: 21 | // B n-long vector (if dim == 1) 22 | // or 23 | // B m-long vector (if dim == 2) 24 | // 25 | template 26 | IGL_INLINE void any( 27 | const Eigen::SparseMatrix & A, 28 | const int dim, 29 | Eigen::PlainObjectBase& B); 30 | } 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "any.cpp" 33 | #endif 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /libigl/igl/any_of.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "any_of.h" 9 | #include 10 | template 11 | IGL_INLINE bool igl::any_of(const Mat & S) 12 | { 13 | return std::any_of(S.data(),S.data()+S.size(),[](bool s){return s;}); 14 | } 15 | 16 | #ifdef IGL_STATIC_LIBRARY 17 | // Explicit template instantiation 18 | template bool igl::any_of >(Eigen::Matrix const&); 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /libigl/igl/any_of.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ANY_OF_H 9 | #define IGL_ANY_OF_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Wrapper for STL `any_of` for matrix types 14 | // 15 | // Inputs: 16 | // S matrix 17 | // Returns whether any entries are true 18 | // 19 | // Seems that Eigen (now) implements this for `Eigen::Array` 20 | template 21 | IGL_INLINE bool any_of(const Mat & S); 22 | } 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "any_of.cpp" 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /libigl/igl/average_onto_faces.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "average_onto_faces.h" 9 | 10 | template 11 | IGL_INLINE void igl::average_onto_faces(const Eigen::Matrix &V, 12 | const Eigen::Matrix &F, 13 | const Eigen::Matrix &S, 14 | Eigen::Matrix &SF) 15 | { 16 | 17 | SF = Eigen::Matrix::Zero(F.rows(),S.cols()); 18 | 19 | for (int i = 0; i 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_AXIS_ANGLE_TO_QUAT_H 9 | #define IGL_AXIS_ANGLE_TO_QUAT_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Convert axis angle representation of a rotation to a quaternion 15 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 16 | // such that q = x*i + y*j + z*k + w 17 | // Inputs: 18 | // axis 3d vector 19 | // angle scalar 20 | // Outputs: 21 | // quaternion 22 | template 23 | IGL_INLINE void axis_angle_to_quat( 24 | const Q_type *axis, 25 | const Q_type angle, 26 | Q_type *out); 27 | } 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "axis_angle_to_quat.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libigl/igl/basename.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_BASENAME_H 9 | #define IGL_BASENAME_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Function like PHP's basename: /etc/sudoers.d --> sudoers.d 17 | // Input: 18 | // path string containing input path 19 | // Returns string containing basename (see php's basename) 20 | // 21 | // See also: dirname, pathinfo 22 | IGL_INLINE std::string basename(const std::string & path); 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "basename.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libigl/igl/bone_parents.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_BONE_PARENTS_H 9 | #define IGL_BONE_PARENTS_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // BONE_PARENTS Recover "parent" bones from directed graph representation. 15 | // 16 | // Inputs: 17 | // BE #BE by 2 list of directed bone edges 18 | // Outputs: 19 | // P #BE by 1 list of parent indices into BE, -1 means root. 20 | // 21 | template 22 | IGL_INLINE void bone_parents( 23 | const Eigen::PlainObjectBase& BE, 24 | Eigen::PlainObjectBase& P); 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "bone_parents.cpp" 29 | #endif 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /libigl/igl/bounding_box_diagonal.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "bounding_box_diagonal.h" 9 | #include "mat_max.h" 10 | #include "mat_min.h" 11 | #include 12 | 13 | IGL_INLINE double igl::bounding_box_diagonal( 14 | const Eigen::MatrixXd & V) 15 | { 16 | using namespace Eigen; 17 | VectorXd maxV,minV; 18 | VectorXi maxVI,minVI; 19 | mat_max(V,1,maxV,maxVI); 20 | mat_min(V,1,minV,minVI); 21 | return sqrt((maxV-minV).array().square().sum()); 22 | } 23 | 24 | #ifdef IGL_STATIC_LIBRARY 25 | // Explicit template instantiation 26 | #endif 27 | -------------------------------------------------------------------------------- /libigl/igl/bounding_box_diagonal.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_BOUNDING_BOX_DIAGONAL_H 9 | #define IGL_BOUNDING_BOX_DIAGONAL_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Compute the length of the diagonal of a given meshes axis-aligned bounding 15 | // box 16 | // 17 | // Inputs: 18 | // V #V by 3 list of vertex positions 19 | // F #F by 3 list of triangle indices into V 20 | // Returns length of bounding box diagonal 21 | IGL_INLINE double bounding_box_diagonal( const Eigen::MatrixXd & V); 22 | } 23 | 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "bounding_box_diagonal.cpp" 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/canonical_quaternions.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "canonical_quaternions.h" 9 | 10 | template <> IGL_INLINE float igl::CANONICAL_VIEW_QUAT(int i, int j) 11 | { 12 | return (float)igl::CANONICAL_VIEW_QUAT_F[i][j]; 13 | } 14 | template <> IGL_INLINE double igl::CANONICAL_VIEW_QUAT(int i, int j) 15 | { 16 | return (double)igl::CANONICAL_VIEW_QUAT_D[i][j]; 17 | } 18 | 19 | #ifdef IGL_STATIC_LIBRARY 20 | // Explicit template instantiation 21 | #endif 22 | -------------------------------------------------------------------------------- /libigl/igl/ceil.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_CEIL_H 9 | #define IGL_CEIL_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Ceil a given matrix to nearest integers 15 | // 16 | // Inputs: 17 | // X m by n matrix of scalars 18 | // Outputs: 19 | // Y m by n matrix of ceiled integers 20 | template < typename DerivedX, typename DerivedY> 21 | IGL_INLINE void ceil( 22 | const Eigen::PlainObjectBase& X, 23 | Eigen::PlainObjectBase& Y); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "ceil.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libigl/igl/circumradius.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "circumradius.h" 9 | #include "edge_lengths.h" 10 | #include "doublearea.h" 11 | template < 12 | typename DerivedV, 13 | typename DerivedF, 14 | typename DerivedR> 15 | IGL_INLINE void igl::circumradius( 16 | const Eigen::PlainObjectBase & V, 17 | const Eigen::PlainObjectBase & F, 18 | Eigen::PlainObjectBase & R) 19 | { 20 | Eigen::Matrix l; 21 | igl::edge_lengths(V,F,l); 22 | DerivedR A; 23 | igl::doublearea(l,0.,A); 24 | // use formula: R=abc/(4*area) to compute the circum radius 25 | R = l.col(0).array() * l.col(1).array() * l.col(2).array() / (2.0*A.array()); 26 | } 27 | -------------------------------------------------------------------------------- /libigl/igl/column_to_quats.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "column_to_quats.h" 9 | IGL_INLINE bool igl::column_to_quats( 10 | const Eigen::VectorXd & Q, 11 | std::vector< 12 | Eigen::Quaterniond,Eigen::aligned_allocator > & vQ) 13 | { 14 | using namespace Eigen; 15 | if(Q.size() % 4 != 0) 16 | { 17 | return false; 18 | } 19 | const int nQ = Q.size()/4; 20 | vQ.resize(nQ); 21 | for(int q=0;q 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_COLUMN_TO_QUATS_H 9 | #define IGL_COLUMN_TO_QUATS_H 10 | #include "igl_inline.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | namespace igl 16 | { 17 | // "Columnize" a list of quaternions (q1x,q1y,q1z,q1w,q2x,q2y,q2z,q2w,...) 18 | // 19 | // Inputs: 20 | // Q n*4-long list of coefficients 21 | // Outputs: 22 | // vQ n-long list of quaternions 23 | // Returns false if n%4!=0 24 | IGL_INLINE bool column_to_quats( 25 | const Eigen::VectorXd & Q, 26 | std::vector< 27 | Eigen::Quaterniond,Eigen::aligned_allocator > & vQ); 28 | } 29 | 30 | #ifndef IGL_STATIC_LIBRARY 31 | # include "column_to_quats.cpp" 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/README.md: -------------------------------------------------------------------------------- 1 | ## IGL copyleft subdirectory 2 | 3 | Functions in the `include/igl/copyleft/` subdirectory are in the 4 | `igl::copyleft::` namespace to indicate that they are under a more aggressive 5 | [copyleft](https://en.wikipedia.org/wiki/Copyleft) than 6 | [MPL2](https://en.wikipedia.org/wiki/Mozilla_Public_License) used for the main 7 | `include/igl` directory and `igl::` namespace. Most notably, this subdirectory 8 | includes code that is under 9 | [GPL](https://en.wikipedia.org/wiki/GNU_General_Public_License). 10 | 11 | Typically a company planning on developing software without releasing its 12 | source code will avoid or purchase licenses for such dependencies. If you do 13 | obtain such a license for the dependencies employed here, you are free to use 14 | the libigl functions here as per their MPL2 license. 15 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/barycenter.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "../../barycenter.h" 9 | #include 10 | #include 11 | #ifdef IGL_STATIC_LIBRARY 12 | #undef IGL_STATIC_LIBRARY 13 | #include "../../barycenter.cpp" 14 | template void igl::barycenter, -1, -1, 0, -1, -1>, Eigen::Matrix, Eigen::Matrix, -1, -1, 0, -1, -1> >(Eigen::MatrixBase, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 0, -1, -1> >&); 15 | #endif 16 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/delaunay_triangulation.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Qingnan Zhou 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #include "delaunay_triangulation.h" 10 | #include "../../delaunay_triangulation.h" 11 | #include "orient2D.h" 12 | #include "incircle.h" 13 | 14 | template< 15 | typename DerivedV, 16 | typename DerivedF> 17 | IGL_INLINE void igl::copyleft::cgal::delaunay_triangulation( 18 | const Eigen::PlainObjectBase& V, 19 | Eigen::PlainObjectBase& F) 20 | { 21 | typedef typename DerivedV::Scalar Scalar; 22 | igl::delaunay_triangulation(V, orient2D, incircle, F); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/lexicographic_triangulation.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // Qingan Zhou 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla Public License 7 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 8 | // obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "lexicographic_triangulation.h" 11 | #include "../../lexicographic_triangulation.h" 12 | #include "orient2D.h" 13 | 14 | template< 15 | typename DerivedP, 16 | typename DerivedF 17 | > 18 | IGL_INLINE void igl::copyleft::cgal::lexicographic_triangulation( 19 | const Eigen::PlainObjectBase& P, 20 | Eigen::PlainObjectBase& F) 21 | { 22 | typedef typename DerivedP::Scalar Scalar; 23 | igl::lexicographic_triangulation(P, orient2D, F); 24 | } 25 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/list_to_matrix.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "../../list_to_matrix.h" 9 | #include 10 | #include 11 | #ifdef IGL_STATIC_LIBRARY 12 | #undef IGL_STATIC_LIBRARY 13 | #include "../../list_to_matrix.cpp" 14 | template bool igl::list_to_matrix, Eigen::Matrix, -1, 3, 0, -1, 3> >(std::vector, std::allocator > >, std::allocator, std::allocator > > > > const&, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); 15 | #endif 16 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/orient2D.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Qingan Zhou 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef IGL_COPYLEFT_CGAL_ORIENT_2D_H 10 | #define IGL_COPYLEFT_CGAL_ORIENT_2D_H 11 | 12 | #include "../../igl_inline.h" 13 | 14 | namespace igl 15 | { 16 | namespace copyleft 17 | { 18 | namespace cgal 19 | { 20 | // Inputs: 21 | // pa,pb,pc 2D points. 22 | // Output: 23 | // 1 if pa,pb,pc are counterclockwise oriented. 24 | // 0 if pa,pb,pc are counterclockwise oriented. 25 | // -1 if pa,pb,pc are clockwise oriented. 26 | template 27 | IGL_INLINE short orient2D( 28 | const Scalar pa[2], 29 | const Scalar pb[2], 30 | const Scalar pc[2]); 31 | } 32 | } 33 | } 34 | 35 | #ifndef IGL_STATIC_LIBRARY 36 | # include "orient2D.cpp" 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/peel_winding_number_layers.cpp: -------------------------------------------------------------------------------- 1 | #include "peel_winding_number_layers.h" 2 | 3 | #include 4 | 5 | #include "propagate_winding_numbers.h" 6 | 7 | template< 8 | typename DerivedV, 9 | typename DerivedF, 10 | typename DerivedW > 11 | IGL_INLINE size_t igl::copyleft::cgal::peel_winding_number_layers( 12 | const Eigen::PlainObjectBase & V, 13 | const Eigen::PlainObjectBase & F, 14 | Eigen::PlainObjectBase& W) { 15 | const size_t num_faces = F.rows(); 16 | Eigen::VectorXi labels(num_faces); 17 | labels.setZero(); 18 | 19 | Eigen::MatrixXi winding_numbers; 20 | igl::copyleft::cgal::propagate_winding_numbers(V, F, labels, winding_numbers); 21 | assert(winding_numbers.rows() == num_faces); 22 | assert(winding_numbers.cols() == 2); 23 | 24 | int min_w = winding_numbers.minCoeff(); 25 | int max_w = winding_numbers.maxCoeff(); 26 | assert(max_w > min_w); 27 | 28 | W.resize(num_faces, 1); 29 | for (size_t i=0; i 5 | 6 | namespace igl { 7 | namespace copyleft { 8 | namespace cgal { 9 | template< 10 | typename DerivedV, 11 | typename DerivedF, 12 | typename DerivedW > 13 | IGL_INLINE size_t peel_winding_number_layers( 14 | const Eigen::PlainObjectBase & V, 15 | const Eigen::PlainObjectBase & F, 16 | Eigen::PlainObjectBase& W); 17 | } 18 | } 19 | } 20 | 21 | #ifndef IGL_STATIC_LIBRARY 22 | # include "peel_winding_number_layers.cpp" 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/read_triangle_mesh.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #include "read_triangle_mesh.h" 10 | #include "assign.h" 11 | #include "../../read_triangle_mesh.h" 12 | 13 | template 14 | IGL_INLINE bool igl::copyleft::cgal::read_triangle_mesh( 15 | const std::string str, 16 | Eigen::PlainObjectBase& V, 17 | Eigen::PlainObjectBase& F) 18 | { 19 | Eigen::MatrixXd Vd; 20 | bool ret = igl::read_triangle_mesh(str,Vd,F); 21 | if(ret) 22 | { 23 | assign(Vd,V); 24 | } 25 | return ret; 26 | } 27 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/row_to_point.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "row_to_point.h" 9 | 10 | template < 11 | typename Kernel, 12 | typename DerivedV> 13 | IGL_INLINE CGAL::Point_2 igl::copyleft::cgal::row_to_point( 14 | const Eigen::PlainObjectBase & V, 15 | const typename DerivedV::Index & i) 16 | { 17 | return CGAL::Point_2(V(i,0),V(i,1)); 18 | } 19 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/slice.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "../../slice.h" 9 | #ifdef IGL_STATIC_LIBRARY 10 | #undef IGL_STATIC_LIBRARY 11 | #include "../../slice.cpp" 12 | #endif 13 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/slice_mask.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "../../slice_mask.h" 9 | #include 10 | #include 11 | #ifdef IGL_STATIC_LIBRARY 12 | #undef IGL_STATIC_LIBRARY 13 | #include "../../slice_mask.cpp" 14 | template void igl::slice_mask, -1, 3, 0, -1, 3>, Eigen::Matrix, -1, 3, 0, -1, 3> >(Eigen::DenseBase, -1, 3, 0, -1, 3> > const&, Eigen::Array const&, int, Eigen::PlainObjectBase, -1, 3, 0, -1, 3> >&); 15 | #endif 16 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/cgal/unique.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "../../unique.h" 9 | #include 10 | #include 11 | #ifdef IGL_STATIC_LIBRARY 12 | #undef IGL_STATIC_LIBRARY 13 | #include "../../unique.cpp" 14 | #endif 15 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/opengl2/texture_from_tga.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_TEXTURE_FROM_TGA_H 9 | #define IGL_OPENGL_TEXTURE_FROM_TGA_H 10 | #include "../../igl_inline.h" 11 | #include "../../opengl2/gl.h" 12 | #include 13 | 14 | namespace igl 15 | { 16 | namespace opengl 17 | { 18 | // Read an image from a .tga file and use it as a texture 19 | // 20 | // Input: 21 | // tga_file path to .tga file 22 | // Output: 23 | // id of generated openGL texture 24 | // Returns true on success, false on failure 25 | IGL_INLINE bool texture_from_tga(const std::string tga_file, GLuint & id); 26 | } 27 | } 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "texture_from_tga.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/progressive_hulls.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "progressive_hulls.h" 9 | #include "progressive_hulls_cost_and_placement.h" 10 | #include "../decimate.h" 11 | #include "../max_faces_stopping_condition.h" 12 | IGL_INLINE bool igl::copyleft::progressive_hulls( 13 | const Eigen::MatrixXd & V, 14 | const Eigen::MatrixXi & F, 15 | const size_t max_m, 16 | Eigen::MatrixXd & U, 17 | Eigen::MatrixXi & G, 18 | Eigen::VectorXi & J) 19 | { 20 | int m = F.rows(); 21 | Eigen::VectorXi I; 22 | return decimate( 23 | V, 24 | F, 25 | progressive_hulls_cost_and_placement, 26 | max_faces_stopping_condition(m,(const int)m,max_m), 27 | U, 28 | G, 29 | J, 30 | I); 31 | } 32 | -------------------------------------------------------------------------------- /libigl/igl/copyleft/tetgen/README: -------------------------------------------------------------------------------- 1 | IGL interface to tetgen library 2 | 3 | Dependencies: 4 | tetgen 5 | 6 | Travel to $IGL/external/tetgen and issue: 7 | make -f Makefile.igl tetlib 8 | -------------------------------------------------------------------------------- /libigl/igl/deprecated.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_DEPRECATED_H 9 | #define IGL_DEPRECATED_H 10 | // Macro for marking a function as deprecated. 11 | // 12 | // http://stackoverflow.com/a/295229/148668 13 | #ifdef __GNUC__ 14 | #define IGL_DEPRECATED(func) func __attribute__ ((deprecated)) 15 | #elif defined(_MSC_VER) 16 | #define IGL_DEPRECATED(func) __declspec(deprecated) func 17 | #else 18 | #pragma message("WARNING: You need to implement IGL_DEPRECATED for this compiler") 19 | #define IGL_DEPRECATED(func) func 20 | #endif 21 | // Usage: 22 | // 23 | // template IGL_INLINE void my_func(Arg1 a); 24 | // 25 | // becomes 26 | // 27 | // template IGL_INLINE IGL_DEPRECATED(void my_func(Arg1 a)); 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/directed_edge_parents.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_DIRECTED_EDGE_PARENTS_H 9 | #define IGL_DIRECTED_EDGE_PARENTS_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Recover "parents" (preceding edges) in a tree given just directed edges. 17 | // 18 | // Inputs: 19 | // E #E by 2 list of directed edges 20 | // Outputs: 21 | // P #E list of parent indices into E (-1) means root 22 | // 23 | template 24 | IGL_INLINE void directed_edge_parents( 25 | const Eigen::PlainObjectBase & E, 26 | Eigen::PlainObjectBase & P); 27 | } 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "directed_edge_parents.cpp" 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /libigl/igl/dirname.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_DIRNAME_H 9 | #define IGL_DIRNAME_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Function like PHP's dirname: /etc/passwd --> /etc, 17 | // Input: 18 | // path string containing input path 19 | // Returns string containing dirname (see php's dirname) 20 | // 21 | // See also: basename, pathinfo 22 | IGL_INLINE std::string dirname(const std::string & path); 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "dirname.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libigl/igl/dot.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "dot.h" 9 | 10 | // http://www.antisphere.com/Wiki/tools:anttweakbar 11 | IGL_INLINE double igl::dot( 12 | const double *a, 13 | const double *b) 14 | { 15 | return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; 16 | } 17 | -------------------------------------------------------------------------------- /libigl/igl/dot.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_DOT_H 9 | #define IGL_DOT_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Computes out = dot(a,b) 14 | // Inputs: 15 | // a left 3d vector 16 | // b right 3d vector 17 | // Returns scalar dot product 18 | IGL_INLINE double dot( 19 | const double *a, 20 | const double *b); 21 | } 22 | 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "dot.cpp" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /libigl/igl/dot_row.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Daniele Panozzo 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "igl/dot_row.h" 9 | 10 | template 11 | IGL_INLINE DerivedV igl::dot_row( 12 | const Eigen::PlainObjectBase& A, 13 | const Eigen::PlainObjectBase& B 14 | ) 15 | { 16 | assert(A.rows() == B.rows()); 17 | assert(A.cols() == B.cols()); 18 | 19 | return (A.array() * B.array()).rowwise().sum(); 20 | } 21 | 22 | #ifdef IGL_STATIC_LIBRARY 23 | // Explicit template instantiation 24 | // generated by autoexplicit.sh 25 | template Eigen::Matrix igl::dot_row >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); 26 | #endif 27 | -------------------------------------------------------------------------------- /libigl/igl/ears.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_EARS_H 2 | #define IGL_EARS_H 3 | #include "igl_inline.h" 4 | #include 5 | namespace igl 6 | { 7 | // FIND_EARS Find all ears (faces with two boundary edges) in a given mesh 8 | // 9 | // [ears,ear_opp] = find_ears(F) 10 | // 11 | // Inputs: 12 | // F #F by 3 list of triangle mesh indices 13 | // Outputs: 14 | // ears #ears list of indices into F of ears 15 | // ear_opp #ears list of indices indicating which edge is non-boundary 16 | // (connecting to flops) 17 | // 18 | template < 19 | typename DerivedF, 20 | typename Derivedear, 21 | typename Derivedear_opp> 22 | IGL_INLINE void ears( 23 | const Eigen::MatrixBase & F, 24 | Eigen::PlainObjectBase & ear, 25 | Eigen::PlainObjectBase & ear_opp); 26 | } 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "ears.cpp" 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /libigl/igl/example_fun.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "example_fun.h" 9 | #include 10 | 11 | template 12 | IGL_INLINE bool igl::example_fun(const Printable & input) 13 | { 14 | using namespace std; 15 | cout<<"example_fun: "<(const double& input); 22 | template bool igl::example_fun(const int& input); 23 | #endif 24 | -------------------------------------------------------------------------------- /libigl/igl/example_fun.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_EXAMPLE_FUN_H 9 | #define IGL_EXAMPLE_FUN_H 10 | 11 | #include "igl_inline.h" 12 | 13 | namespace igl 14 | { 15 | // This is an example of a function, it takes a templated parameter and 16 | // shovels it into cout 17 | // 18 | // Templates: 19 | // T type that supports 20 | // Input: 21 | // input some input of a Printable type 22 | // Returns true for the sake of returning something 23 | template 24 | IGL_INLINE bool example_fun(const Printable & input); 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "example_fun.cpp" 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libigl/igl/face_occurrences.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FACE_OCCURRENCES 9 | #define IGL_FACE_OCCURRENCES 10 | #include "igl_inline.h" 11 | 12 | #include 13 | namespace igl 14 | { 15 | // Count the occruances of each face (row) in a list of face indices 16 | // (irrespecitive of order) 17 | // Inputs: 18 | // F #F by simplex-size 19 | // Outputs 20 | // C #F list of counts 21 | // Known bug: triangles/tets only (where ignoring order still gives simplex) 22 | template 23 | IGL_INLINE void face_occurrences( 24 | const std::vector > & F, 25 | std::vector & C); 26 | } 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "face_occurrences.cpp" 30 | #endif 31 | 32 | #endif 33 | 34 | 35 | -------------------------------------------------------------------------------- /libigl/igl/file_contents_as_string.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FILE_CONTENTS_AS_STRING_H 9 | #define IGL_FILE_CONTENTS_AS_STRING_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | namespace igl 14 | { 15 | // Read a files contents as plain text into a given string 16 | // Inputs: 17 | // file_name path to file to be read 18 | // Outputs: 19 | // content output string containing contents of the given file 20 | // Returns true on succes, false on error 21 | IGL_INLINE bool file_contents_as_string( 22 | const std::string file_name, 23 | std::string & content); 24 | IGL_INLINE std::string file_contents_as_string( 25 | const std::string file_name); 26 | } 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "file_contents_as_string.cpp" 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libigl/igl/file_dialog_open.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Daniele Panozzo 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FILE_DIALOG_OPEN_H 9 | #define IGL_FILE_DIALOG_OPEN_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Returns a string with a path to an existing file 17 | // The string is returned empty if no file is selected 18 | // (on Linux machines, it assumes that Zenity is installed) 19 | // 20 | // Usage: 21 | // std::string str = get_open_file_path(); 22 | IGL_INLINE std::string file_dialog_open(); 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "file_dialog_open.cpp" 27 | #endif 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /libigl/igl/file_dialog_save.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Daniele Panozzo 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FILE_DIALOG_SAVE_H 9 | #define IGL_FILE_DIALOG_SAVE_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Returns a string with a path to a new/existing file 17 | // The string is returned empty if no file is selected 18 | // (on Linux machines, it assumes that Zenity is installed) 19 | // 20 | // Usage: 21 | // char buffer[FILE_DIALOG_MAX_BUFFER]; 22 | // get_save_file_path(buffer); 23 | IGL_INLINE std::string file_dialog_save(); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "file_dialog_save.cpp" 28 | #endif 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /libigl/igl/file_exists.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "file_exists.h" 9 | 10 | #include 11 | 12 | IGL_INLINE bool igl::file_exists(const std::string filename) 13 | { 14 | struct stat status; 15 | return (stat(filename.c_str(),&status)==0); 16 | } 17 | -------------------------------------------------------------------------------- /libigl/igl/file_exists.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FILE_EXISTS_H 9 | #define IGL_FILE_EXISTS_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Check if a file or directory exists like PHP's file_exists function: 15 | // http://php.net/manual/en/function.file-exists.php 16 | // Input: 17 | // filename path to file 18 | // Returns true if file exists and is readable and false if file doesn't 19 | // exist or *is not readable* 20 | IGL_INLINE bool file_exists(const std::string filename); 21 | } 22 | 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "file_exists.cpp" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /libigl/igl/find_zero.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_FIND_ZERO_H 2 | #define IGL_FIND_ZERO_H 3 | #include "igl_inline.h" 4 | #include 5 | #include 6 | namespace igl 7 | { 8 | // Find the first zero (whether implicit or explicitly stored) in the 9 | // rows/columns of a matrix. 10 | // Inputs: 11 | // A m by n sparse matrix 12 | // dim dimension along which to check for any (1 or 2) 13 | // Output: 14 | // I n-long vector (if dim == 1) {m means no zeros found} 15 | // or 16 | // I m-long vector (if dim == 2) {n means no zeros found} 17 | // 18 | template 19 | IGL_INLINE void find_zero( 20 | const Eigen::SparseMatrix & A, 21 | const int dim, 22 | Eigen::PlainObjectBase & I); 23 | } 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "find_zero.cpp" 26 | #endif 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /libigl/igl/fit_plane.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Daniele Panozzo 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FIT_PLANE_H 9 | #define IGL_FIT_PLANE_H 10 | 11 | #include "igl_inline.h" 12 | #include 13 | 14 | namespace igl 15 | { 16 | // This function fits a plane to a point cloud. 17 | // 18 | // Input: 19 | // V #Vx3 matrix. The 3D point cloud, one row for each vertex. 20 | // Output: 21 | // N 1x3 Vector. The normal of the fitted plane. 22 | // C 1x3 Vector. A point that lies in the fitted plane. 23 | // From http://missingbytes.blogspot.com/2012/06/fitting-plane-to-point-cloud.html 24 | 25 | IGL_INLINE void fit_plane( 26 | const Eigen::MatrixXd & V, 27 | Eigen::RowVector3d & N, 28 | Eigen::RowVector3d & C); 29 | } 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "fit_plane.cpp" 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libigl/igl/floor.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_FLOOR_H 9 | #define IGL_FLOOR_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Floor a given matrix to nearest integers 15 | // 16 | // Inputs: 17 | // X m by n matrix of scalars 18 | // Outputs: 19 | // Y m by n matrix of floored integers 20 | template < typename DerivedX, typename DerivedY> 21 | IGL_INLINE void floor( 22 | const Eigen::PlainObjectBase& X, 23 | Eigen::PlainObjectBase& Y); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "floor.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libigl/igl/get_seconds.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "get_seconds.h" 9 | #include 10 | IGL_INLINE double igl::get_seconds() 11 | { 12 | return 13 | std::chrono::duration( 14 | std::chrono::system_clock::now().time_since_epoch()).count(); 15 | } 16 | -------------------------------------------------------------------------------- /libigl/igl/get_seconds_hires.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "get_seconds_hires.h" 9 | 10 | #if _WIN32 11 | # include 12 | # include 13 | IGL_INLINE double igl::get_seconds_hires() 14 | { 15 | LARGE_INTEGER li_freq, li_current; 16 | const bool ret = QueryPerformanceFrequency(&li_freq); 17 | const bool ret2 = QueryPerformanceCounter(&li_current); 18 | assert(ret && ret2); 19 | assert(li_freq.QuadPart > 0); 20 | return double(li_current.QuadPart) / double(li_freq.QuadPart); 21 | } 22 | #else 23 | # include "get_seconds.h" 24 | IGL_INLINE double igl::get_seconds_hires() 25 | { 26 | // Sorry I've no idea how performance counters work on Mac... 27 | return igl::get_seconds(); 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /libigl/igl/get_seconds_hires.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_GET_SECONDS_HIRES_H 9 | #define IGL_GET_SECONDS_HIRES_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Return the current time in seconds using performance counters 15 | IGL_INLINE double get_seconds_hires(); 16 | } 17 | 18 | #ifndef IGL_STATIC_LIBRARY 19 | # include "get_seconds_hires.cpp" 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /libigl/igl/grid.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_GRID_H 9 | #define IGL_GRID_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Construct vertices of a regular grid, suitable for input to 15 | // `igl::marching_cubes` 16 | // 17 | // Inputs: 18 | // res 3-long list of number of vertices along the x y and z dimensions 19 | // Outputs: 20 | // GV res(0)*res(1)*res(2) by 3 list of mesh vertex positions. 21 | // 22 | template < 23 | typename Derivedres, 24 | typename DerivedGV> 25 | IGL_INLINE void grid( 26 | const Eigen::MatrixBase & res, 27 | Eigen::PlainObjectBase & GV); 28 | } 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "grid.cpp" 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /libigl/igl/grid_search.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_GRID_SEARCH_H 2 | #define IGL_GRID_SEARCH_H 3 | #include "igl_inline.h" 4 | #include 5 | #include 6 | namespace igl 7 | { 8 | // Solve the problem: 9 | // 10 | // minimize f(x) 11 | // subject to lb ≤ x ≤ ub 12 | // 13 | // by exhaustive grid search. 14 | // 15 | // Inputs: 16 | // f function to minimize 17 | // LB #X vector of finite lower bounds 18 | // UB #X vector of finite upper bounds 19 | // I #X vector of number of steps for each variable 20 | // Outputs: 21 | // X #X optimal parameter vector 22 | // Returns f(X) 23 | // 24 | template < 25 | typename Scalar, 26 | typename DerivedX, 27 | typename DerivedLB, 28 | typename DerivedUB, 29 | typename DerivedI> 30 | IGL_INLINE Scalar grid_search( 31 | const std::function< Scalar (DerivedX &) > f, 32 | const Eigen::MatrixBase & LB, 33 | const Eigen::MatrixBase & UB, 34 | const Eigen::MatrixBase & I, 35 | DerivedX & X); 36 | } 37 | 38 | #ifndef IGL_STATIC_LIBRARY 39 | # include "grid_search.cpp" 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /libigl/igl/guess_extension.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_GUESS_EXTENSION_H 2 | #define IGL_GUESS_EXTENSION_H 3 | #include "igl_inline.h" 4 | #include 5 | #include 6 | namespace igl 7 | { 8 | // Given a file pointer at the beginning of a "mesh" file, try to guess the 9 | // extension of the file format it comes from. The file pointer is rewound on 10 | // return. 11 | // 12 | // Inputs: 13 | // fp file pointer (see output) 14 | // Outputs: 15 | // fp file pointer rewound 16 | // guess extension as string. One of "mesh",{"obj"},"off","ply","stl", or 17 | // "wrl" 18 | // 19 | IGL_INLINE void guess_extension(FILE * fp, std::string & guess); 20 | IGL_INLINE std::string guess_extension(FILE * fp); 21 | } 22 | #ifndef IGL_STATIC_LIBRARY 23 | # include "guess_extension.cpp" 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /libigl/igl/igl_inline.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | // This should *NOT* be contained in a IGL_*_H ifdef, since it may be defined 9 | // differently based on when it is included 10 | #ifdef IGL_INLINE 11 | #undef IGL_INLINE 12 | #endif 13 | 14 | #ifndef IGL_STATIC_LIBRARY 15 | # define IGL_INLINE inline 16 | #else 17 | # define IGL_INLINE 18 | #endif 19 | -------------------------------------------------------------------------------- /libigl/igl/inradius.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_INRADIUS_H 9 | #define IGL_INRADIUS_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Compute the inradius of each triangle in a mesh (V,F) 15 | // 16 | // Inputs: 17 | // V #V by dim list of mesh vertex positions 18 | // F #F by 3 list of triangle indices into V 19 | // Outputs: 20 | // R #F list of inradii 21 | // 22 | template < 23 | typename DerivedV, 24 | typename DerivedF, 25 | typename DerivedR> 26 | IGL_INLINE void inradius( 27 | const Eigen::PlainObjectBase & V, 28 | const Eigen::PlainObjectBase & F, 29 | Eigen::PlainObjectBase & R); 30 | } 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "inradius.cpp" 33 | #endif 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /libigl/igl/is_dir.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "is_dir.h" 9 | 10 | #include 11 | 12 | #ifndef S_ISDIR 13 | #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) 14 | #endif 15 | 16 | #ifndef S_ISREG 17 | #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) 18 | #endif 19 | 20 | IGL_INLINE bool igl::is_dir(const char * filename) 21 | { 22 | struct stat status; 23 | if(stat(filename,&status)!=0) 24 | { 25 | // path does not exist 26 | return false; 27 | } 28 | // Tests whether existing path is a directory 29 | return S_ISDIR(status.st_mode); 30 | } 31 | -------------------------------------------------------------------------------- /libigl/igl/is_dir.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_DIR_H 9 | #define IGL_IS_DIR_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Act like php's is_dir function 14 | // http://php.net/manual/en/function.is-dir.php 15 | // Tells whether the given filename is a directory. 16 | // Input: 17 | // filename Path to the file. If filename is a relative filename, it will 18 | // be checked relative to the current working directory. 19 | // Returns TRUE if the filename exists and is a directory, FALSE 20 | // otherwise. 21 | IGL_INLINE bool is_dir(const char * filename); 22 | 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "is_dir.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libigl/igl/is_file.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "is_file.h" 9 | 10 | #include 11 | #ifdef _WIN32 12 | # ifndef S_ISREG 13 | # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) 14 | # endif 15 | #endif 16 | IGL_INLINE bool igl::is_file(const char * filename) 17 | { 18 | struct stat status; 19 | if(stat(filename,&status)!=0) 20 | { 21 | // path does not exist 22 | return false; 23 | } 24 | // Tests whether existing path is a regular file 25 | return S_ISREG(status.st_mode); 26 | } 27 | -------------------------------------------------------------------------------- /libigl/igl/is_file.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_FILE_H 9 | #define IGL_IS_FILE_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Act like php's is_file function 14 | // http://php.net/manual/en/function.is-file.php 15 | // Tells whether the given filename is a regular file. 16 | // Input: 17 | // filename Path to the file. If filename is a relative filename, it will 18 | // be checked relative to the current working directory. 19 | // Returns TRUE if the filename exists and is a regular file, FALSE 20 | // otherwise. 21 | IGL_INLINE bool is_file(const char * filename); 22 | 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "is_file.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libigl/igl/is_planar.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "is_planar.h" 9 | IGL_INLINE bool igl::is_planar(const Eigen::MatrixXd & V) 10 | { 11 | if(V.size() == 0) return false; 12 | if(V.cols() == 2) return true; 13 | for(int i = 0;i 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_PLANAR_H 9 | #define IGL_IS_PLANAR_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Determine if a set of points lies on the XY plane 17 | // 18 | // Inputs: 19 | // V #V by dim list of vertex positions 20 | // Return true if a mesh has constant value of 0 in z coordinate 21 | // 22 | // Known bugs: Doesn't determine if vertex is flat if it doesn't lie on the 23 | // XY plane. 24 | IGL_INLINE bool is_planar(const Eigen::MatrixXd & V); 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "is_planar.cpp" 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /libigl/igl/is_readable.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_READABLE_H 9 | #define IGL_IS_READABLE_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Check if a file is reabable like PHP's is_readable function: 14 | // http://www.php.net/manual/en/function.is-readable.php 15 | // Input: 16 | // filename path to file 17 | // Returns true if file exists and is readable and false if file doesn't 18 | // exist or *is not readable* 19 | // 20 | // Note: Windows version will not check user or group ids 21 | IGL_INLINE bool is_readable(const char * filename); 22 | } 23 | 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "is_readable.cpp" 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/is_sparse.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "is_sparse.h" 9 | template 10 | IGL_INLINE bool igl::is_sparse( 11 | const Eigen::SparseMatrix & A) 12 | { 13 | return true; 14 | } 15 | template 16 | IGL_INLINE bool igl::is_sparse( 17 | const Eigen::PlainObjectBase& A) 18 | { 19 | return false; 20 | } 21 | 22 | #ifdef IGL_STATIC_LIBRARY 23 | // Explicit template instantiation 24 | // generated by autoexplicit.sh 25 | template bool igl::is_sparse(Eigen::SparseMatrix const&); 26 | // generated by autoexplicit.sh 27 | template bool igl::is_sparse >(Eigen::PlainObjectBase > const&); 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/is_stl.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_IS_STL_H 2 | #define IGL_IS_STL_H 3 | #include "igl_inline.h" 4 | #include 5 | namespace igl 6 | { 7 | // Given a file pointer, determine if it contains an .stl file and then 8 | // rewind it. 9 | // 10 | // Inputs: 11 | // stl_file pointer to file 12 | // Outputs: 13 | // is_ascii flag whether stl is ascii 14 | // Returns whether stl_file is an .stl file 15 | IGL_INLINE bool is_stl(FILE * stl_file, bool & is_ascii); 16 | IGL_INLINE bool is_stl(FILE * stl_file); 17 | }; 18 | #ifndef IGL_STATIC_LIBRARY 19 | # include "is_stl.cpp" 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /libigl/igl/is_writable.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_IS_WRITABLE_H 9 | #define IGL_IS_WRITABLE_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Check if a file exists *and* is writable like PHP's is_writable function: 14 | // http://www.php.net/manual/en/function.is-writable.php 15 | // Input: 16 | // filename path to file 17 | // Returns true if file exists and is writable and false if file doesn't 18 | // exist or *is not writable* 19 | // 20 | // Note: Windows version will not test group and user id 21 | IGL_INLINE bool is_writable(const char * filename); 22 | } 23 | 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "is_writable.cpp" 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/isdiag.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "isdiag.h" 9 | 10 | template 11 | IGL_INLINE bool igl::isdiag(const Eigen::SparseMatrix & A) 12 | { 13 | // Iterate over outside of A 14 | for(int k=0; k::InnerIterator it (A,k); it; ++it) 18 | { 19 | if(it.row() != it.col() && it.value()!=0) 20 | { 21 | return false; 22 | } 23 | } 24 | } 25 | return true; 26 | } 27 | 28 | 29 | #ifdef IGL_STATIC_LIBRARY 30 | // Explicit template instantiation 31 | template bool igl::isdiag(class Eigen::SparseMatrix const &); 32 | #endif 33 | -------------------------------------------------------------------------------- /libigl/igl/isdiag.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ISDIAG_H 9 | #define IGL_ISDIAG_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Determine if a given matrix is diagonal: all non-zeros lie on the 15 | // main diagonal. 16 | // 17 | // Inputs: 18 | // A m by n sparse matrix 19 | // Returns true iff and only if the matrix is diagonal. 20 | template 21 | IGL_INLINE bool isdiag(const Eigen::SparseMatrix & A); 22 | }; 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "isdiag.cpp" 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /libigl/igl/mat_to_quat.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MAT_TO_QUAT_H 9 | #define IGL_MAT_TO_QUAT_H 10 | #include "igl_inline.h" 11 | namespace igl 12 | { 13 | // Convert a OpenGL (rotation) matrix to a quaternion 14 | // 15 | // Input: 16 | // m 16-element opengl rotation matrix 17 | // Output: 18 | // q 4-element quaternion (not normalized) 19 | template 20 | IGL_INLINE void mat4_to_quat(const Q_type * m, Q_type * q); 21 | // Input: 22 | // m 9-element opengl rotation matrix 23 | template 24 | IGL_INLINE void mat3_to_quat(const Q_type * m, Q_type * q); 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "mat_to_quat.cpp" 29 | #endif 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /libigl/igl/matlab/mexErrMsgTxt.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "mexErrMsgTxt.h" 9 | 10 | IGL_INLINE void igl::matlab::mexErrMsgTxt(bool assertion, const char * text) 11 | { 12 | if(!assertion) 13 | { 14 | ::mexErrMsgTxt(text); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /libigl/igl/matlab/mexErrMsgTxt.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MATLAB_MEXERRMSGTXT_H 9 | #define IGL_MATLAB_MEXERRMSGTXT_H 10 | #include "../igl_inline.h" 11 | // Overload mexErrMsgTxt to check an assertion then print text only if 12 | // assertion fails 13 | #include "mex.h" 14 | namespace igl 15 | { 16 | namespace matlab 17 | { 18 | // Wrapper for mexErrMsgTxt that only calls error if test fails 19 | IGL_INLINE void mexErrMsgTxt(bool test, const char * message); 20 | } 21 | } 22 | #ifndef IGL_STATIC_LIBRARY 23 | # include "mexErrMsgTxt.cpp" 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /libigl/igl/matlab/requires_arg.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "requires_arg.h" 9 | #include "mexErrMsgTxt.h" 10 | #include "../C_STR.h" 11 | 12 | IGL_INLINE void igl::matlab::requires_arg(const int i, const int nrhs, const char *name) 13 | { 14 | mexErrMsgTxt((i+1) 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_REQUIRES_ARG_H 9 | #define IGL_REQUIRES_ARG_H 10 | #include "../igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | namespace matlab 15 | { 16 | // Simply throw an error if (i+1) 5 | #include 6 | namespace igl 7 | { 8 | // Inputs: 9 | // X m by n matrix 10 | // dim dimension along which to take max 11 | // Outputs: 12 | // Y n-long vector (if dim == 1) 13 | // or 14 | // Y m-long vector (if dim == 2) 15 | // I vector the same size as Y containing the indices along dim of maximum 16 | // entries 17 | template 18 | IGL_INLINE void max( 19 | const Eigen::SparseMatrix & A, 20 | const int dim, 21 | Eigen::PlainObjectBase & B, 22 | Eigen::PlainObjectBase & I); 23 | } 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "max.cpp" 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /libigl/igl/max_size.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MAX_SIZE_H 9 | #define IGL_MAX_SIZE_H 10 | #include "igl_inline.h" 11 | #include 12 | 13 | namespace igl 14 | { 15 | // Determine max size of lists in a vector 16 | // Template: 17 | // T some list type object that implements .size() 18 | // Inputs: 19 | // V vector of list types T 20 | // Returns max .size() found in V, returns -1 if V is empty 21 | template 22 | IGL_INLINE int max_size(const std::vector & V); 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "max_size.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libigl/igl/median.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MEDIAN_H 9 | #define IGL_MEDIAN_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Compute the median of an eigen vector 15 | // 16 | // Inputs: 17 | // V #V list of unsorted values 18 | // Outputs: 19 | // m median of those values 20 | // Returns true on success, false on failure 21 | template 22 | IGL_INLINE bool median( 23 | const Eigen::MatrixBase & V, mType & m); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "median.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libigl/igl/min.cpp: -------------------------------------------------------------------------------- 1 | #include "min.h" 2 | #include "for_each.h" 3 | #include "find_zero.h" 4 | 5 | template 6 | IGL_INLINE void igl::min( 7 | const Eigen::SparseMatrix & A, 8 | const int dim, 9 | Eigen::PlainObjectBase & B, 10 | Eigen::PlainObjectBase & I) 11 | { 12 | const int n = A.cols(); 13 | const int m = A.rows(); 14 | B.resize(dim==1?n:m); 15 | B.setConstant(std::numeric_limits::max()); 16 | I.resize(dim==1?n:m); 17 | for_each(A,[&B,&I,&dim](int i, int j,const typename DerivedB::Scalar v) 18 | { 19 | if(dim == 2) 20 | { 21 | std::swap(i,j); 22 | } 23 | // Coded as if dim == 1, assuming swap for dim == 2 24 | if(v < B(j)) 25 | { 26 | B(j) = v; 27 | I(j) = i; 28 | } 29 | }); 30 | Eigen::VectorXi Z; 31 | find_zero(A,dim,Z); 32 | for(int j = 0;j 5 | #include 6 | namespace igl 7 | { 8 | // Inputs: 9 | // X m by n matrix 10 | // dim dimension along which to take min 11 | // Outputs: 12 | // Y n-long vector (if dim == 1) 13 | // or 14 | // Y m-long vector (if dim == 2) 15 | // I vector the same size as Y containing the indices along dim of minimum 16 | // entries 17 | template 18 | IGL_INLINE void min( 19 | const Eigen::SparseMatrix & A, 20 | const int dim, 21 | Eigen::PlainObjectBase & B, 22 | Eigen::PlainObjectBase & I); 23 | } 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "min.cpp" 26 | #endif 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /libigl/igl/min_size.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MIN_SIZE_H 9 | #define IGL_MIN_SIZE_H 10 | #include "igl_inline.h" 11 | #include 12 | 13 | namespace igl 14 | { 15 | // Determine min size of lists in a vector 16 | // Template: 17 | // T some list type object that implements .size() 18 | // Inputs: 19 | // V vector of list types T 20 | // Returns min .size() found in V, returns -1 if V is empty 21 | template 22 | IGL_INLINE int min_size(const std::vector & V); 23 | } 24 | 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "min_size.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libigl/igl/mod.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "mod.h" 9 | 10 | template 11 | IGL_INLINE void igl::mod( 12 | const Eigen::PlainObjectBase & A, 13 | const int base, 14 | Eigen::PlainObjectBase & B) 15 | { 16 | B.resizeLike(A); 17 | for(int i = 0;i 26 | IGL_INLINE DerivedA igl::mod( 27 | const Eigen::PlainObjectBase & A, const int base) 28 | { 29 | DerivedA B; 30 | mod(A,base,B); 31 | return B; 32 | } 33 | #ifdef IGL_STATIC_LIBRARY 34 | #endif 35 | -------------------------------------------------------------------------------- /libigl/igl/mod.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MOD_H 9 | #define IGL_MOD_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Compute elementwise mod: B = A % base 15 | // 16 | // Inputs: 17 | // A m by n matrix 18 | // base number to mod against 19 | // Outputs: 20 | // B m by n matrix 21 | template 22 | IGL_INLINE void mod( 23 | const Eigen::PlainObjectBase & A, 24 | const int base, 25 | Eigen::PlainObjectBase & B); 26 | template 27 | IGL_INLINE DerivedA mod( 28 | const Eigen::PlainObjectBase & A, const int base); 29 | } 30 | #ifndef IGL_STATIC_LIBRARY 31 | #include "mod.cpp" 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /libigl/igl/mosek/mosek_guarded.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "mosek_guarded.h" 9 | #include 10 | 11 | IGL_INLINE MSKrescodee igl::mosek::mosek_guarded(const MSKrescodee r) 12 | { 13 | using namespace std; 14 | if(r != MSK_RES_OK) 15 | { 16 | /* In case of an error print error code and description. */ 17 | char symname[MSK_MAX_STR_LEN]; 18 | char desc[MSK_MAX_STR_LEN]; 19 | MSK_getcodedesc(r,symname,desc); 20 | cerr<<"MOSEK ERROR ("< 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_MOSEK_MOSEK_GUARDED_H 9 | #define IGL_MOSEK_MOSEK_GUARDED_H 10 | #include "../igl_inline.h" 11 | 12 | #include "mosek.h" 13 | namespace igl 14 | { 15 | namespace mosek 16 | { 17 | // Little function to wrap around mosek call to handle errors 18 | // 19 | // Inputs: 20 | // r mosek error code returned from mosek call 21 | // Returns r untouched 22 | IGL_INLINE MSKrescodee mosek_guarded(const MSKrescodee r); 23 | } 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "mosek_guarded.cpp" 28 | #endif 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /libigl/igl/next_filename.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "next_filename.h" 9 | #include "STR.h" 10 | #include "file_exists.h" 11 | #include 12 | #include 13 | 14 | bool igl::next_filename( 15 | const std::string & prefix, 16 | const int zeros, 17 | const std::string & suffix, 18 | std::string & next) 19 | { 20 | using namespace std; 21 | // O(n), for huge lists could at least find bounds with exponential search 22 | // and then narrow with binary search O(log(n)) 23 | int i = 0; 24 | while(true) 25 | { 26 | next = STR(prefix << setfill('0') << setw(zeros)< 0 && i >= pow(10,zeros)) 33 | { 34 | return false; 35 | } 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /libigl/igl/normalize_quat.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_NORMALIZE_QUAT_H 9 | #define IGL_NORMALIZE_QUAT_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Normalize a quaternion 15 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 16 | // such that q = x*i + y*j + z*k + w 17 | // Inputs: 18 | // q input quaternion 19 | // Outputs: 20 | // out result of normalization, allowed to be same as q 21 | // Returns true on success, false if len(q) < EPS 22 | template 23 | IGL_INLINE bool normalize_quat( 24 | const Q_type *q, 25 | Q_type *out); 26 | }; 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "normalize_quat.cpp" 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libigl/igl/normalize_row_sums.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_NORMALIZE_ROW_SUMS_H 9 | #define IGL_NORMALIZE_ROW_SUMS_H 10 | #include "igl_inline.h" 11 | #include 12 | 13 | namespace igl 14 | { 15 | // Normalize the rows in A so that their sums are each 1 and place the new 16 | // entries in B 17 | // Inputs: 18 | // A #rows by k input matrix 19 | // Outputs: 20 | // B #rows by k input matrix, can be the same as A 21 | // 22 | // Note: This is just calling an Eigen one-liner. 23 | template 24 | IGL_INLINE void normalize_row_sums( 25 | const Eigen::MatrixBase& A, 26 | Eigen::MatrixBase & B); 27 | } 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "normalize_row_sums.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libigl/igl/null.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "null.h" 9 | #include "EPS.h" 10 | 11 | template 12 | IGL_INLINE void igl::null( 13 | const Eigen::PlainObjectBase & A, 14 | Eigen::PlainObjectBase & N) 15 | { 16 | using namespace Eigen; 17 | typedef typename DerivedA::Scalar Scalar; 18 | JacobiSVD svd(A, ComputeFullV); 19 | svd.setThreshold(A.cols() * svd.singularValues().maxCoeff() * EPS()); 20 | N = svd.matrixV().rightCols(A.cols()-svd.rank()); 21 | } 22 | -------------------------------------------------------------------------------- /libigl/igl/null.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_NULL_H 9 | #define IGL_NULL_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Like MATLAB's null 17 | // 18 | // Compute a basis for the null space for the given matrix A: the columns of 19 | // the output N form a basis for the space orthogonal to that spanned by the 20 | // rows of A. 21 | // 22 | // Inputs: 23 | // A m by n matrix 24 | // Outputs: 25 | // N n by r matrix, where r is the row rank of A 26 | template 27 | IGL_INLINE void null( 28 | const Eigen::PlainObjectBase & A, 29 | Eigen::PlainObjectBase & N); 30 | } 31 | 32 | #ifndef IGL_STATIC_LIBRARY 33 | # include "null.cpp" 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /libigl/igl/opengl/bind_vertex_attrib_array.cpp: -------------------------------------------------------------------------------- 1 | #include "bind_vertex_attrib_array.h" 2 | 3 | IGL_INLINE GLint igl::opengl::bind_vertex_attrib_array( 4 | const GLuint program_shader, 5 | const std::string &name, 6 | GLuint bufferID, 7 | const Eigen::Matrix &M, 8 | bool refresh) 9 | { 10 | GLint id = glGetAttribLocation(program_shader, name.c_str()); 11 | if (id < 0) 12 | return id; 13 | if (M.size() == 0) 14 | { 15 | glDisableVertexAttribArray(id); 16 | return id; 17 | } 18 | glBindBuffer(GL_ARRAY_BUFFER, bufferID); 19 | if (refresh) 20 | glBufferData(GL_ARRAY_BUFFER, sizeof(float)*M.size(), M.data(), GL_DYNAMIC_DRAW); 21 | glVertexAttribPointer(id, M.cols(), GL_FLOAT, GL_FALSE, 0, 0); 22 | glEnableVertexAttribArray(id); 23 | return id; 24 | } 25 | -------------------------------------------------------------------------------- /libigl/igl/opengl/bind_vertex_attrib_array.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_OPENGL_BIND_VERTEX_ATTRIB_ARRAY_H 2 | #define IGL_OPENGL_BIND_VERTEX_ATTRIB_ARRAY_H 3 | #include "gl.h" 4 | #include "../igl_inline.h" 5 | #include 6 | #include 7 | namespace igl 8 | { 9 | namespace opengl 10 | { 11 | // Bind a per-vertex array attribute and refresh its contents from an Eigen 12 | // matrix 13 | // 14 | // Inputs: 15 | // program_shader id of shader program 16 | // name name of attribute in vertex shader 17 | // bufferID id of buffer to bind to 18 | // M #V by dim matrix of per-vertex data 19 | // refresh whether to actually call glBufferData or just bind the buffer 20 | // Returns id of named attribute in shader 21 | IGL_INLINE GLint bind_vertex_attrib_array( 22 | const GLuint program_shader, 23 | const std::string &name, 24 | GLuint bufferID, 25 | const Eigen::Matrix &M, 26 | bool refresh); 27 | } 28 | } 29 | #ifndef IGL_STATIC_LIBRARY 30 | #include "bind_vertex_attrib_array.cpp" 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /libigl/igl/opengl/create_index_vbo.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_CREATE_INDEX_VBO_H 9 | #define IGL_OPENGL_CREATE_INDEX_VBO_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | #include 13 | 14 | // Create a VBO (Vertex Buffer Object) for a list of indices: 15 | // GL_ELEMENT_ARRAY_BUFFER_ARB for the triangle indices (F) 16 | namespace igl 17 | { 18 | namespace opengl 19 | { 20 | // Inputs: 21 | // F #F by 3 eigen Matrix of face (triangle) indices 22 | // Outputs: 23 | // F_vbo_id buffer id for face indices 24 | // 25 | IGL_INLINE void create_index_vbo( 26 | const Eigen::MatrixXi & F, 27 | GLuint & F_vbo_id); 28 | } 29 | } 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "create_index_vbo.cpp" 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libigl/igl/opengl/gl.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013, 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_GL_H 9 | #define IGL_OPENGL_GL_H 10 | 11 | #ifdef IGL_OPENGL2_GL_H 12 | # error "igl/opengl2/gl.h already included" 13 | #endif 14 | 15 | // Always use this: 16 | // #include "gl.h" 17 | // Instead of: 18 | // #include 19 | // or 20 | // #include 21 | // 22 | 23 | #include 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /libigl/igl/opengl/gl_type_size.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "gl_type_size.h" 9 | #include 10 | 11 | IGL_INLINE int igl::opengl::gl_type_size(const GLenum type) 12 | { 13 | switch(type) 14 | { 15 | case GL_DOUBLE: 16 | return 8; 17 | break; 18 | case GL_FLOAT: 19 | return 4; 20 | break; 21 | case GL_INT: 22 | return 4; 23 | break; 24 | default: 25 | // should handle all other GL_[types] 26 | assert(false && "Implementation incomplete."); 27 | break; 28 | } 29 | return -1; 30 | } 31 | -------------------------------------------------------------------------------- /libigl/igl/opengl/gl_type_size.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_GL_TYPE_SIZE_H 9 | #define IGL_OPENGL_GL_TYPE_SIZE_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | 13 | namespace igl 14 | { 15 | namespace opengl 16 | { 17 | // Return the number of bytes for a given OpenGL type // Inputs: 18 | // type enum value of opengl type 19 | // Returns size in bytes of type 20 | IGL_INLINE int gl_type_size(const GLenum type); 21 | } 22 | } 23 | 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "gl_type_size.cpp" 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/opengl/glfw/TextRenderer_fonts.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Wenzel Jacob 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef IGL_OPENGL_GLFW_TEXT_RENDERER_FONTS_H 10 | #define IGL_OPENGL_GLFW_TEXT_RENDERER_FONTS_H 11 | 12 | #include 13 | 14 | #ifndef IGL_STATIC_LIBRARY 15 | namespace 16 | { 17 | #endif 18 | extern uint8_t igl_entypo_ttf[]; 19 | extern uint32_t igl_entypo_ttf_size; 20 | 21 | extern uint8_t igl_roboto_bold_ttf[]; 22 | extern uint32_t igl_roboto_bold_ttf_size; 23 | 24 | extern uint8_t igl_roboto_regular_ttf[]; 25 | extern uint32_t igl_roboto_regular_ttf_size; 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | } 29 | #endif 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | namespace 33 | { 34 | #include "TextRenderer_fonts.cpp" 35 | } 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /libigl/igl/opengl/glfw/background_window.cpp: -------------------------------------------------------------------------------- 1 | #include "background_window.h" 2 | 3 | #include 4 | 5 | IGL_INLINE bool igl::opengl::glfw::background_window(GLFWwindow* & window) 6 | { 7 | if(!glfwInit()) return false; 8 | glfwSetErrorCallback([](int id,const char* m){std::cerr< 7 | 8 | namespace igl 9 | { 10 | namespace opengl 11 | { 12 | namespace glfw 13 | { 14 | // Create a background window with a valid core profile opengl context 15 | // set to current. 16 | // 17 | // After you're finished with this window you may call 18 | // `glfwDestroyWindow(window)` 19 | // 20 | // After you're finished with glfw you should call `glfwTerminate()` 21 | // 22 | // Outputs: 23 | // window pointer to glfw window 24 | // Returns true iff success 25 | IGL_INLINE bool background_window(GLFWwindow* & window); 26 | } 27 | } 28 | } 29 | 30 | #ifndef IGL_STATIC_LIBRARY 31 | # include "background_window.cpp" 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libigl/igl/opengl/load_shader.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "load_shader.h" 9 | 10 | // Copyright Denis Kovacs 4/10/08 11 | #include "print_shader_info_log.h" 12 | #include 13 | IGL_INLINE GLuint igl::opengl::load_shader( 14 | const std::string & src,const GLenum type) 15 | { 16 | if(src.empty()) 17 | { 18 | return (GLuint) 0; 19 | } 20 | 21 | GLuint s = glCreateShader(type); 22 | if(s == 0) 23 | { 24 | fprintf(stderr,"Error: load_shader() failed to create shader.\n"); 25 | return 0; 26 | } 27 | // Pass shader source string 28 | const char *c = src.c_str(); 29 | glShaderSource(s, 1, &c, NULL); 30 | glCompileShader(s); 31 | // Print info log (if any) 32 | igl::opengl::print_shader_info_log(s); 33 | return s; 34 | } 35 | -------------------------------------------------------------------------------- /libigl/igl/opengl/print_program_info_log.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "print_program_info_log.h" 9 | 10 | #include 11 | #include 12 | // Copyright Denis Kovacs 4/10/08 13 | IGL_INLINE void igl::opengl::print_program_info_log(const GLuint obj) 14 | { 15 | GLint infologLength = 0; 16 | GLint charsWritten = 0; 17 | char *infoLog; 18 | 19 | glGetProgramiv(obj, GL_INFO_LOG_LENGTH,&infologLength); 20 | 21 | if (infologLength > 0) 22 | { 23 | infoLog = (char *)malloc(infologLength); 24 | glGetProgramInfoLog(obj, infologLength, &charsWritten, infoLog); 25 | printf("%s\n",infoLog); 26 | free(infoLog); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /libigl/igl/opengl/print_program_info_log.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_PRINT_PROGRAM_INFO_LOG_H 9 | #define IGL_OPENGL_PRINT_PROGRAM_INFO_LOG_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | 13 | namespace igl 14 | { 15 | namespace opengl 16 | { 17 | // Inputs: 18 | // obj OpenGL index of program to print info log about 19 | IGL_INLINE void print_program_info_log(const GLuint obj); 20 | } 21 | } 22 | 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "print_program_info_log.cpp" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /libigl/igl/opengl/print_shader_info_log.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "print_shader_info_log.h" 9 | 10 | #include 11 | #include 12 | // Copyright Denis Kovacs 4/10/08 13 | IGL_INLINE void igl::opengl::print_shader_info_log(const GLuint obj) 14 | { 15 | GLint infologLength = 0; 16 | GLint charsWritten = 0; 17 | char *infoLog; 18 | 19 | // Get shader info log from opengl 20 | glGetShaderiv(obj, GL_INFO_LOG_LENGTH,&infologLength); 21 | // Only print if there is something in the log 22 | if (infologLength > 0) 23 | { 24 | infoLog = (char *)malloc(infologLength); 25 | glGetShaderInfoLog(obj, infologLength, &charsWritten, infoLog); 26 | printf("%s\n",infoLog); 27 | free(infoLog); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /libigl/igl/opengl/print_shader_info_log.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_PRINT_SHADER_INFO_LOG_H 9 | #define IGL_OPENGL_PRINT_SHADER_INFO_LOG_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | 13 | namespace igl 14 | { 15 | namespace opengl 16 | { 17 | // Inputs: 18 | // obj OpenGL index of shader to print info log about 19 | IGL_INLINE void print_shader_info_log(const GLuint obj); 20 | } 21 | } 22 | 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "print_shader_info_log.cpp" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /libigl/igl/opengl/uniform_type_to_string.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_UNIFORM_TYPE_TO_STRING_H 9 | #define IGL_OPENGL_UNIFORM_TYPE_TO_STRING_H 10 | #include "../igl_inline.h" 11 | #include "gl.h" 12 | #include 13 | 14 | namespace igl 15 | { 16 | namespace opengl 17 | { 18 | // Convert a GL uniform variable type (say, returned from 19 | // glGetActiveUniform) and output a string naming that type 20 | // Inputs: 21 | // type enum for given type 22 | // Returns string name of that type 23 | IGL_INLINE std::string uniform_type_to_string(const GLenum type); 24 | } 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "uniform_type_to_string.cpp" 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libigl/igl/opengl2/draw_beach_ball.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL2_DRAW_BEACH_BALL_H 9 | #define IGL_OPENGL2_DRAW_BEACH_BALL_H 10 | #include "../igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | namespace opengl2 15 | { 16 | // Draw a beach ball icon/glyph (from AntTweakBar) at the current origin 17 | // according to the current orientation: ball has radius 0.75 and axis have 18 | // length 1.15 19 | IGL_INLINE void draw_beach_ball(); 20 | } 21 | } 22 | 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "draw_beach_ball.cpp" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /libigl/igl/opengl2/glext.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL_GLEXT_H 9 | #define IGL_OPENGL_GLEXT_H 10 | 11 | #ifdef IGL_OPENGL2_GLEXT_H 12 | # error "igl/opengl2/glext.h already included" 13 | #endif 14 | 15 | // Always use this: 16 | // #include "gl.h" 17 | // Instead of: 18 | // #include 19 | // or 20 | // #include 21 | // 22 | 23 | #ifdef __APPLE__ 24 | # include 25 | #elif _WIN32 26 | // do nothing(?) 27 | #else 28 | # include 29 | #endif 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /libigl/igl/opengl2/glu.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2017 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL2_GLU_H 9 | #define IGL_OPENGL2_GLU_H 10 | 11 | #ifdef IGL_OPENGL_GLU_H 12 | # error "igl/opengl/glu.h already included" 13 | #endif 14 | 15 | // Always use this: 16 | // #include "glu.h" 17 | // Instead of: 18 | // #include 19 | // or 20 | // #include 21 | // 22 | 23 | #ifdef __APPLE__ 24 | # include 25 | #else 26 | # include 27 | #endif 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /libigl/igl/opengl2/print_gl_get.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "print_gl_get.h" 9 | 10 | #include 11 | IGL_INLINE void igl::opengl2::print_gl_get(GLenum pname) 12 | { 13 | double dM[16]; 14 | 15 | int rows = 4; 16 | int cols = 4; 17 | switch(pname) 18 | { 19 | case GL_MODELVIEW_MATRIX: 20 | case GL_PROJECTION_MATRIX: 21 | { 22 | rows = 4; 23 | cols = 4; 24 | glGetDoublev(pname,dM); 25 | for(int i = 0;i 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_OPENGL2_PRINT_GL_GET_H 9 | #define IGL_OPENGL2_PRINT_GL_GET_H 10 | #include "gl.h" 11 | #include "../igl_inline.h" 12 | 13 | namespace igl 14 | { 15 | namespace opengl2 16 | { 17 | // Prints the value of pname found by issuing glGet*(pname,*) 18 | // Inputs: 19 | // pname enum key to gl parameter 20 | IGL_INLINE void print_gl_get(GLenum pname); 21 | } 22 | } 23 | 24 | #ifndef IGL_STATIC_LIBRARY 25 | # include "print_gl_get.cpp" 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/opengl2/right_axis.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "right_axis.h" 9 | #include "gl.h" 10 | 11 | IGL_INLINE void igl::opengl2::right_axis(double * x, double * y, double * z) 12 | { 13 | double mv[16]; 14 | glGetDoublev(GL_MODELVIEW_MATRIX, mv); 15 | igl::opengl2::right_axis(mv,x,y,z); 16 | } 17 | 18 | IGL_INLINE void igl::opengl2::right_axis(const double * mv,double * x, double * y, double * z) 19 | { 20 | *x = -mv[0*4+0]; 21 | *y = -mv[1*4+0]; 22 | *z = -mv[2*4+0]; 23 | } 24 | 25 | 26 | #ifdef IGL_STATIC_LIBRARY 27 | // Explicit template instantiation 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/opengl2/up_axis.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "up_axis.h" 9 | #include "gl.h" 10 | 11 | IGL_INLINE void igl::opengl2::up_axis(double * x, double * y, double * z) 12 | { 13 | double mv[16]; 14 | glGetDoublev(GL_MODELVIEW_MATRIX, mv); 15 | igl::opengl2::up_axis(mv,x,y,z); 16 | } 17 | 18 | IGL_INLINE void igl::opengl2::up_axis(const double *mv, double * x, double * y, double * z) 19 | { 20 | *x = -mv[0*4+1]; 21 | *y = -mv[1*4+1]; 22 | *z = -mv[2*4+1]; 23 | } 24 | 25 | #ifdef IGL_STATIC_LIBRARY 26 | // Explicit template instantiation 27 | // generated by autoexplicit.sh 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/orth.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "orth.h" 9 | 10 | // Broken Implementation 11 | IGL_INLINE void igl::orth(const Eigen::MatrixXd &A, Eigen::MatrixXd &Q) 12 | { 13 | 14 | //perform svd on A = U*S*V' (V is not computed and only the thin U is computed) 15 | Eigen::JacobiSVD svd(A, Eigen::ComputeThinU ); 16 | Eigen::MatrixXd U = svd.matrixU(); 17 | const Eigen::VectorXd S = svd.singularValues(); 18 | 19 | //get rank of A 20 | int m = A.rows(); 21 | int n = A.cols(); 22 | double tol = std::max(m,n) * S.maxCoeff() * 2.2204e-16; 23 | int r = 0; 24 | for (int i = 0; i < S.rows(); ++r,++i) 25 | { 26 | if (S[i] < tol) 27 | break; 28 | } 29 | 30 | //keep r first columns of U 31 | Q = U.block(0,0,U.rows(),r); 32 | } 33 | -------------------------------------------------------------------------------- /libigl/igl/path_to_executable.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_PATH_TO_EXECUTABLE_H 9 | #define IGL_PATH_TO_EXECUTABLE_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Return the path of the current executable. 15 | // Note: Tested for Mac OS X 16 | IGL_INLINE std::string path_to_executable(); 17 | } 18 | #ifndef IGL_STATIC_LIBRARY 19 | # include "path_to_executable.cpp" 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /libigl/igl/pinv.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_PINV_H 2 | #define IGL_PINV_H 3 | #include "igl_inline.h" 4 | #include 5 | namespace igl 6 | { 7 | // Compute the Moore-Penrose pseudoinverse 8 | // 9 | // Inputs: 10 | // A m by n matrix 11 | // tol tolerance (if negative then default is used) 12 | // Outputs: 13 | // X n by m matrix so that A*X*A = A and X*A*X = X and A*X = (A*X)' and 14 | // (X*A) = (X*A)' 15 | template 16 | void pinv( 17 | const Eigen::MatrixBase & A, 18 | typename DerivedA::Scalar tol, 19 | Eigen::PlainObjectBase & X); 20 | // Wrapper using default tol 21 | template 22 | void pinv( 23 | const Eigen::MatrixBase & A, 24 | Eigen::PlainObjectBase & X); 25 | } 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "pinv.cpp" 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /libigl/igl/point_in_circle.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "point_in_circle.h" 9 | 10 | IGL_INLINE bool igl::point_in_circle( 11 | const double qx, 12 | const double qy, 13 | const double cx, 14 | const double cy, 15 | const double r) 16 | { 17 | return (qx-cx)*(qx-cx) + (qy-cy)*(qy-cy) - r*r < 0; 18 | } 19 | -------------------------------------------------------------------------------- /libigl/igl/point_in_circle.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_POINT_IN_CIRCLE_H 9 | #define IGL_POINT_IN_CIRCLE_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Determine if 2d point is in a circle 15 | // Inputs: 16 | // qx x-coordinate of query point 17 | // qy y-coordinate of query point 18 | // cx x-coordinate of circle center 19 | // cy y-coordinate of circle center 20 | // r radius of circle 21 | // Returns true if query point is in circle, false otherwise 22 | IGL_INLINE bool point_in_circle( 23 | const double qx, 24 | const double qy, 25 | const double cx, 26 | const double cy, 27 | const double r); 28 | } 29 | 30 | #ifndef IGL_STATIC_LIBRARY 31 | # include "point_in_circle.cpp" 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libigl/igl/print_vector.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_PRINT_VECTOR_H 9 | #define IGL_PRINT_VECTOR_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | namespace igl 14 | { 15 | // Not clear what these are supposed to be doing. Currently they print 16 | // vectors to standard error... 17 | template 18 | IGL_INLINE void print_vector( std::vector& v); 19 | template 20 | IGL_INLINE void print_vector( std::vector< std::vector >& v); 21 | template 22 | IGL_INLINE void print_vector(std::vector< std::vector< std::vector > >& v); 23 | } 24 | 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "print_vector.cpp" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libigl/igl/quadric_binary_plus_operator.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "quadric_binary_plus_operator.h" 9 | 10 | IGL_INLINE std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double> 11 | igl::operator+( 12 | const std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double> & a, 13 | const std::tuple< Eigen::MatrixXd, Eigen::RowVectorXd, double> & b) 14 | { 15 | std::tuple< 16 | Eigen::MatrixXd, 17 | Eigen::RowVectorXd, 18 | double> c; 19 | std::get<0>(c) = (std::get<0>(a) + std::get<0>(b)).eval(); 20 | std::get<1>(c) = (std::get<1>(a) + std::get<1>(b)).eval(); 21 | std::get<2>(c) = (std::get<2>(a) + std::get<2>(b)); 22 | return c; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /libigl/igl/quat_conjugate.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "quat_conjugate.h" 9 | 10 | template 11 | IGL_INLINE void igl::quat_conjugate( 12 | const Q_type *q1, 13 | Q_type *out) 14 | { 15 | out[0] = -q1[0]; 16 | out[1] = -q1[1]; 17 | out[2] = -q1[2]; 18 | out[3] = q1[3]; 19 | } 20 | 21 | #ifdef IGL_STATIC_LIBRARY 22 | // Explicit template instantiation 23 | // generated by autoexplicit.sh 24 | template void igl::quat_conjugate(double const*, double*); 25 | // generated by autoexplicit.sh 26 | template void igl::quat_conjugate(float const*, float*); 27 | #endif 28 | -------------------------------------------------------------------------------- /libigl/igl/quat_conjugate.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_QUAT_CONJUGATE_H 9 | #define IGL_QUAT_CONJUGATE_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Compute conjugate of given quaternion 15 | // http://en.wikipedia.org/wiki/Quaternion#Conjugation.2C_the_norm.2C_and_reciprocal 16 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 17 | // such that q = x*i + y*j + z*k + w 18 | // Inputs: 19 | // q1 input quaternion 20 | // Outputs: 21 | // out result of conjugation, allowed to be same as input 22 | template 23 | IGL_INLINE void quat_conjugate( 24 | const Q_type *q1, 25 | Q_type *out); 26 | }; 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "quat_conjugate.cpp" 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libigl/igl/quat_mult.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_QUAT_MULT_H 9 | #define IGL_QUAT_MULT_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Computes out = q1 * q2 with quaternion multiplication 15 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 16 | // such that q = x*i + y*j + z*k + w 17 | // Inputs: 18 | // q1 left quaternion 19 | // q2 right quaternion 20 | // Outputs: 21 | // out result of multiplication 22 | template 23 | IGL_INLINE void quat_mult( 24 | const Q_type *q1, 25 | const Q_type *q2, 26 | Q_type *out); 27 | }; 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "quat_mult.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libigl/igl/quat_to_mat.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_QUAT_TO_MAT_H 9 | #define IGL_QUAT_TO_MAT_H 10 | #include "igl_inline.h" 11 | // Name history: 12 | // quat2mat until 16 Sept 2011 13 | namespace igl 14 | { 15 | // Convert a quaternion to a 4x4 matrix 16 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 17 | // such that q = x*i + y*j + z*k + w 18 | // Input: 19 | // quat pointer to four elements of quaternion (x,y,z,w) 20 | // Output: 21 | // mat pointer to 16 elements of matrix 22 | template 23 | IGL_INLINE void quat_to_mat(const Q_type * quat, Q_type * mat); 24 | } 25 | 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "quat_to_mat.cpp" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libigl/igl/quats_to_column.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "quats_to_column.h" 9 | 10 | IGL_INLINE void igl::quats_to_column( 11 | const std::vector< 12 | Eigen::Quaterniond,Eigen::aligned_allocator > vQ, 13 | Eigen::VectorXd & Q) 14 | { 15 | Q.resize(vQ.size()*4); 16 | for(int q = 0;q<(int)vQ.size();q++) 17 | { 18 | auto & xyzw = vQ[q].coeffs(); 19 | for(int c = 0;c<4;c++) 20 | { 21 | Q(q*4+c) = xyzw(c); 22 | } 23 | } 24 | } 25 | 26 | IGL_INLINE Eigen::VectorXd igl::quats_to_column( 27 | const std::vector< 28 | Eigen::Quaterniond,Eigen::aligned_allocator > vQ) 29 | { 30 | Eigen::VectorXd Q; 31 | quats_to_column(vQ,Q); 32 | return Q; 33 | } 34 | -------------------------------------------------------------------------------- /libigl/igl/random_dir.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_RANDOM_DIR_H 9 | #define IGL_RANDOM_DIR_H 10 | #include "igl_inline.h" 11 | 12 | #include 13 | 14 | namespace igl 15 | { 16 | // Generate a uniformly random unit direction in 3D, return as vector 17 | IGL_INLINE Eigen::Vector3d random_dir(); 18 | // Generate n stratified uniformly random unit directions in 3d, return as rows 19 | // of an n by 3 matrix 20 | // 21 | // Inputs: 22 | // n number of directions 23 | // Return n by 3 matrix of random directions 24 | IGL_INLINE Eigen::MatrixXd random_dir_stratified(const int n); 25 | } 26 | 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "random_dir.cpp" 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libigl/igl/random_quaternion.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_RANDOM_QUATERNION_H 9 | #define IGL_RANDOM_QUATERNION_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Return a random quaternion via uniform sampling of the 4-sphere 15 | template 16 | IGL_INLINE Eigen::Quaternion random_quaternion(); 17 | } 18 | #ifndef IGL_STATIC_LIBRARY 19 | #include "random_quaternion.cpp" 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /libigl/igl/random_search.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_RANDOM_SEARCH_H 2 | #define IGL_RANDOM_SEARCH_H 3 | #include "igl_inline.h" 4 | #include 5 | #include 6 | namespace igl 7 | { 8 | // Solve the problem: 9 | // 10 | // minimize f(x) 11 | // subject to lb ≤ x ≤ ub 12 | // 13 | // by uniform random search. 14 | // 15 | // Inputs: 16 | // f function to minimize 17 | // LB #X vector of finite lower bounds 18 | // UB #X vector of finite upper bounds 19 | // iters number of iterations 20 | // Outputs: 21 | // X #X optimal parameter vector 22 | // Returns f(X) 23 | // 24 | template < 25 | typename Scalar, 26 | typename DerivedX, 27 | typename DerivedLB, 28 | typename DerivedUB> 29 | IGL_INLINE Scalar random_search( 30 | const std::function< Scalar (DerivedX &) > f, 31 | const Eigen::MatrixBase & LB, 32 | const Eigen::MatrixBase & UB, 33 | const int iters, 34 | DerivedX & X); 35 | } 36 | 37 | #ifndef IGL_STATIC_LIBRARY 38 | # include "random_search.cpp" 39 | #endif 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /libigl/igl/randperm.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "randperm.h" 9 | #include "colon.h" 10 | #include 11 | 12 | template 13 | IGL_INLINE void igl::randperm( 14 | const int n, 15 | Eigen::PlainObjectBase & I) 16 | { 17 | Eigen::VectorXi II; 18 | igl::colon(0,1,n-1,II); 19 | I = II; 20 | std::random_shuffle(I.data(),I.data()+n); 21 | } 22 | 23 | #ifdef IGL_STATIC_LIBRARY 24 | // Explicit template instantiation 25 | template void igl::randperm >(int, Eigen::PlainObjectBase >&); 26 | template void igl::randperm >(int, Eigen::PlainObjectBase >&); 27 | #endif 28 | -------------------------------------------------------------------------------- /libigl/igl/randperm.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_RANDPERM_H 9 | #define IGL_RANDPERM_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Like matlab's randperm(n) but minus 1 15 | // 16 | // Inputs: 17 | // n number of elements 18 | // Outputs: 19 | // I n list of rand permutation of 0:n-1 20 | template 21 | IGL_INLINE void randperm( 22 | const int n, 23 | Eigen::PlainObjectBase & I); 24 | } 25 | #ifndef IGL_STATIC_LIBRARY 26 | # include "randperm.cpp" 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /libigl/igl/readCSV.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_READ_CSV_H 9 | #define IGL_READ_CSV_H 10 | 11 | #include "igl/igl_inline.h" 12 | #include 13 | #include 14 | #include 15 | 16 | namespace igl 17 | { 18 | // read a matrix from a csv file into a Eigen matrix 19 | // Templates: 20 | // Scalar type for the matrix 21 | // Inputs: 22 | // str path to .csv file 23 | // Outputs: 24 | // M eigen matrix 25 | template 26 | IGL_INLINE bool readCSV( 27 | const std::string str, 28 | Eigen::Matrix& M); 29 | } 30 | 31 | #ifndef IGL_STATIC_LIBRARY 32 | # include "readCSV.cpp" 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libigl/igl/reorder.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_REORDER_H 9 | #define IGL_REORDER_H 10 | #include "igl_inline.h" 11 | #include 12 | // For size_t 13 | #include 14 | #include 15 | 16 | namespace igl 17 | { 18 | // Act like matlab's Y = X(I) for std vectors 19 | // where I contains a vector of indices so that after, 20 | // Y[j] = X[I[j]] for index j 21 | // this implies that Y.size() == I.size() 22 | // X and Y are allowed to be the same reference 23 | template< class T > 24 | IGL_INLINE void reorder( 25 | const std::vector & unordered, 26 | std::vector const & index_map, 27 | std::vector & ordered); 28 | } 29 | 30 | #ifndef IGL_STATIC_LIBRARY 31 | # include "reorder.cpp" 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libigl/igl/rotate_by_quat.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ROTATE_BY_QUAT_H 9 | #define IGL_ROTATE_BY_QUAT_H 10 | #include "igl_inline.h" 11 | 12 | namespace igl 13 | { 14 | // Compute rotation of a given vector/point by a quaternion 15 | // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w), 16 | // such that q = x*i + y*j + z*k + w 17 | // Inputs: 18 | // v input 3d point/vector 19 | // q input quaternion 20 | // Outputs: 21 | // out result of rotation, allowed to be same as v 22 | template 23 | IGL_INLINE void rotate_by_quat( 24 | const Q_type *v, 25 | const Q_type *q, 26 | Q_type *out); 27 | }; 28 | 29 | #ifndef IGL_STATIC_LIBRARY 30 | # include "rotate_by_quat.cpp" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libigl/igl/round.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_ROUND_H 9 | #define IGL_ROUND_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Round a scalar value 15 | // 16 | // Inputs: 17 | // x number 18 | // Returns x rounded to integer 19 | template 20 | DerivedX round(const DerivedX r); 21 | // Round a given matrix to nearest integers 22 | // 23 | // Inputs: 24 | // X m by n matrix of scalars 25 | // Outputs: 26 | // Y m by n matrix of rounded integers 27 | template < typename DerivedX, typename DerivedY> 28 | IGL_INLINE void round( 29 | const Eigen::PlainObjectBase& X, 30 | Eigen::PlainObjectBase& Y); 31 | } 32 | 33 | #ifndef IGL_STATIC_LIBRARY 34 | # include "round.cpp" 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /libigl/igl/sample_edges.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2013 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "sample_edges.h" 9 | 10 | IGL_INLINE void igl::sample_edges( 11 | const Eigen::MatrixXd & V, 12 | const Eigen::MatrixXi & E, 13 | const int k, 14 | Eigen::MatrixXd & S) 15 | { 16 | using namespace Eigen; 17 | // Resize output 18 | S.resize(V.rows() + k * E.rows(),V.cols()); 19 | // Copy V at front of S 20 | S.block(0,0,V.rows(),V.cols()) = V; 21 | 22 | // loop over edges 23 | for(int i = 0;i 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "shortest_edge_and_midpoint.h" 9 | 10 | IGL_INLINE void igl::shortest_edge_and_midpoint( 11 | const int e, 12 | const Eigen::MatrixXd & V, 13 | const Eigen::MatrixXi & /*F*/, 14 | const Eigen::MatrixXi & E, 15 | const Eigen::VectorXi & /*EMAP*/, 16 | const Eigen::MatrixXi & /*EF*/, 17 | const Eigen::MatrixXi & /*EI*/, 18 | double & cost, 19 | Eigen::RowVectorXd & p) 20 | { 21 | cost = (V.row(E(e,0))-V.row(E(e,1))).norm(); 22 | p = 0.5*(V.row(E(e,0))+V.row(E(e,1))); 23 | } 24 | -------------------------------------------------------------------------------- /libigl/igl/signed_angle.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_SIGNED_ANGLE_H 2 | #define IGL_SIGNED_ANGLE_H 3 | #include "igl_inline.h" 4 | #include 5 | namespace igl 6 | { 7 | // Compute the signed angle subtended by the oriented 3d triangle (A,B,C) at some point P 8 | // 9 | // Inputs: 10 | // A 2D position of corner 11 | // B 2D position of corner 12 | // P 2D position of query point 13 | // returns signed angle 14 | template < 15 | typename DerivedA, 16 | typename DerivedB, 17 | typename DerivedP> 18 | IGL_INLINE typename DerivedA::Scalar signed_angle( 19 | const Eigen::MatrixBase & A, 20 | const Eigen::MatrixBase & B, 21 | const Eigen::MatrixBase & P); 22 | } 23 | #ifndef IGL_STATIC_LIBRARY 24 | # include "signed_angle.cpp" 25 | #endif 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /libigl/igl/solid_angle.h: -------------------------------------------------------------------------------- 1 | #ifndef IGL_SOLID_ANGLE_H 2 | #define IGL_SOLID_ANGLE_H 3 | #include "igl_inline.h" 4 | #include 5 | namespace igl 6 | { 7 | // Compute the signed solid angle subtended by the oriented 3d triangle (A,B,C) at some point P 8 | // 9 | // Inputs: 10 | // A 3D position of corner 11 | // B 3D position of corner 12 | // C 3D position of corner 13 | // P 3D position of query point 14 | // Returns signed solid angle 15 | template < 16 | typename DerivedA, 17 | typename DerivedB, 18 | typename DerivedC, 19 | typename DerivedP> 20 | IGL_INLINE typename DerivedA::Scalar solid_angle( 21 | const Eigen::MatrixBase & A, 22 | const Eigen::MatrixBase & B, 23 | const Eigen::MatrixBase & C, 24 | const Eigen::MatrixBase & P); 25 | } 26 | #ifndef IGL_STATIC_LIBRARY 27 | # include "solid_angle.cpp" 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /libigl/igl/swept_volume_bounding_box.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2016 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "swept_volume_bounding_box.h" 9 | #include "LinSpaced.h" 10 | 11 | IGL_INLINE void igl::swept_volume_bounding_box( 12 | const size_t & n, 13 | const std::function & V, 14 | const size_t & steps, 15 | Eigen::AlignedBox3d & box) 16 | { 17 | using namespace Eigen; 18 | box.setEmpty(); 19 | const VectorXd t = igl::LinSpaced(steps,0,1); 20 | // Find extent over all time steps 21 | for(int ti = 0;ti 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_TRIANGLE_FAN_H 9 | #define IGL_TRIANGLE_FAN_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // Given a list of faces tessellate all of the "exterior" edges forming another 15 | // list of 16 | // 17 | // Inputs: 18 | // E #E by simplex_size-1 list of exterior edges (see exterior_edges.h) 19 | // Outputs: 20 | // cap #cap by simplex_size list of "faces" tessellating the boundary edges 21 | IGL_INLINE void triangle_fan( 22 | const Eigen::MatrixXi & E, 23 | Eigen::MatrixXi & cap); 24 | // In-line version 25 | IGL_INLINE Eigen::MatrixXi triangle_fan( const Eigen::MatrixXi & E); 26 | } 27 | #ifndef IGL_STATIC_LIBRARY 28 | # include "triangle_fan.cpp" 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /libigl/igl/triangles_from_strip.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2015 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #include "triangles_from_strip.h" 9 | #include 10 | 11 | template 12 | IGL_INLINE void igl::triangles_from_strip( 13 | const Eigen::MatrixBase& S, 14 | Eigen::PlainObjectBase& F) 15 | { 16 | using namespace std; 17 | F.resize(S.size()-2,3); 18 | for(int s = 0;s < S.size()-2;s++) 19 | { 20 | if(s%2 == 0) 21 | { 22 | F(s,0) = S(s+2); 23 | F(s,1) = S(s+1); 24 | F(s,2) = S(s+0); 25 | }else 26 | { 27 | F(s,0) = S(s+0); 28 | F(s,1) = S(s+1); 29 | F(s,2) = S(s+2); 30 | } 31 | } 32 | } 33 | 34 | #ifdef IGL_STATIC_LIBRARY 35 | // Explicit template instantiation 36 | #endif 37 | -------------------------------------------------------------------------------- /libigl/igl/triangles_from_strip.h: -------------------------------------------------------------------------------- 1 | // This file is part of libigl, a simple c++ geometry processing library. 2 | // 3 | // Copyright (C) 2014 Alec Jacobson 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public License 6 | // v. 2.0. If a copy of the MPL was not distributed with this file, You can 7 | // obtain one at http://mozilla.org/MPL/2.0/. 8 | #ifndef IGL_TRIANGLES_FROM_STRIP_H 9 | #define IGL_TRIANGLES_FROM_STRIP_H 10 | #include "igl_inline.h" 11 | #include 12 | namespace igl 13 | { 14 | // TRIANGLES_FROM_STRIP Create a list of triangles from a stream of indices 15 | // along a strip. 16 | // 17 | // Inputs: 18 | // S #S list of indices 19 | // Outputs: 20 | // F #S-2 by 3 list of triangle indices 21 | // 22 | template 23 | IGL_INLINE void triangles_from_strip( 24 | const Eigen::MatrixBase& S, 25 | Eigen::PlainObjectBase& F); 26 | } 27 | 28 | #ifndef IGL_STATIC_LIBRARY 29 | # include "triangles_from_strip.cpp" 30 | #endif 31 | 32 | #endif 33 | 34 | --------------------------------------------------------------------------------