Browse Source

Templates and other fixes for python bindings (#1379)

* face occurences fixed

* flipped_triangles templates

* templates

* extract_manifold_patches templates

* normal_derivative templates

* orient_outward snap_points
teseoch 5 years ago
parent
commit
87bfaeeba8

+ 16 - 16
include/igl/extract_manifold_patches.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2016 Alec Jacobson <[email protected]>
 // Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "extract_manifold_patches.h"
 #include "extract_manifold_patches.h"
 #include "unique_edge_map.h"
 #include "unique_edge_map.h"
@@ -17,8 +17,8 @@ template<
   typename uE2EType,
   typename uE2EType,
   typename DerivedP>
   typename DerivedP>
 IGL_INLINE size_t igl::extract_manifold_patches(
 IGL_INLINE size_t igl::extract_manifold_patches(
-  const Eigen::PlainObjectBase<DerivedF>& F,
-  const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
+  const Eigen::MatrixBase<DerivedF>& F,
+  const Eigen::MatrixBase<DerivedEMAP>& EMAP,
   const std::vector<std::vector<uE2EType> >& uE2E,
   const std::vector<std::vector<uE2EType> >& uE2E,
   Eigen::PlainObjectBase<DerivedP>& P)
   Eigen::PlainObjectBase<DerivedP>& P)
 {
 {
@@ -76,12 +76,12 @@ IGL_INLINE size_t igl::extract_manifold_patches(
     return num_patches;
     return num_patches;
 }
 }
 
 
-template<
-  typename DerivedF,
-  typename DerivedP>
+template <
+    typename DerivedF,
+    typename DerivedP>
 IGL_INLINE size_t igl::extract_manifold_patches(
 IGL_INLINE size_t igl::extract_manifold_patches(
-  const Eigen::PlainObjectBase<DerivedF>& F,
-  Eigen::PlainObjectBase<DerivedP>& P)
+    const Eigen::MatrixBase<DerivedF> &F,
+    Eigen::PlainObjectBase<DerivedP> &P)
 {
 {
   Eigen::MatrixXi E, uE;
   Eigen::MatrixXi E, uE;
   Eigen::VectorXi EMAP;
   Eigen::VectorXi EMAP;
@@ -93,11 +93,11 @@ IGL_INLINE size_t igl::extract_manifold_patches(
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
-template unsigned long igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>,   Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template size_t igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template unsigned long igl::extract_manifold_patches<Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&); 
+template unsigned long igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>,   Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template size_t igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template unsigned long igl::extract_manifold_patches<Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #ifdef WIN32
 #ifdef WIN32
-template unsigned __int64 igl::extract_manifold_patches<class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned __int64, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> const &, class std::vector<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>, class std::allocator<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
-template unsigned __int64 igl::extract_manifold_patches<class Eigen::Matrix<int, -1, 3, 1, -1, 3>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned __int64, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 3, 1, -1, 3>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> const &, class std::vector<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>, class std::allocator<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
+template unsigned __int64 igl::extract_manifold_patches<class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned __int64, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> const &, class std::vector<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>, class std::allocator<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
+template unsigned __int64 igl::extract_manifold_patches<class Eigen::Matrix<int, -1, 3, 1, -1, 3>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned __int64, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<int, -1, 3, 1, -1, 3>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> const &, class std::vector<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>, class std::allocator<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
 #endif
 #endif
 #endif
 #endif

+ 10 - 10
include/igl/extract_manifold_patches.h

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2016 Alec Jacobson <[email protected]>
 // Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_EXTRACT_MANIFOLD_PATCHES
 #ifndef IGL_EXTRACT_MANIFOLD_PATCHES
 #define IGL_EXTRACT_MANIFOLD_PATCHES
 #define IGL_EXTRACT_MANIFOLD_PATCHES
@@ -33,16 +33,16 @@ namespace igl {
       typename uE2EType,
       typename uE2EType,
       typename DerivedP>
       typename DerivedP>
     IGL_INLINE size_t extract_manifold_patches(
     IGL_INLINE size_t extract_manifold_patches(
-      const Eigen::PlainObjectBase<DerivedF>& F,
-      const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
+      const Eigen::MatrixBase<DerivedF>& F,
+      const Eigen::MatrixBase<DerivedEMAP>& EMAP,
       const std::vector<std::vector<uE2EType> >& uE2E,
       const std::vector<std::vector<uE2EType> >& uE2E,
       Eigen::PlainObjectBase<DerivedP>& P);
       Eigen::PlainObjectBase<DerivedP>& P);
     template <
     template <
-      typename DerivedF,
-      typename DerivedP>
+        typename DerivedF,
+        typename DerivedP>
     IGL_INLINE size_t extract_manifold_patches(
     IGL_INLINE size_t extract_manifold_patches(
-      const Eigen::PlainObjectBase<DerivedF>& F,
-      Eigen::PlainObjectBase<DerivedP>& P);
+        const Eigen::MatrixBase<DerivedF> &F,
+        Eigen::PlainObjectBase<DerivedP> &P);
 }
 }
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY
 #  include "extract_manifold_patches.cpp"
 #  include "extract_manifold_patches.cpp"

+ 5 - 5
include/igl/face_occurrences.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "face_occurrences.h"
 #include "face_occurrences.h"
 #include "list_to_matrix.h"
 #include "list_to_matrix.h"
@@ -60,7 +60,7 @@ IGL_INLINE void igl::face_occurrences(
   // Should really just rewrite using Eigen+libigl ...
   // Should really just rewrite using Eigen+libigl ...
   std::vector<std::vector<typename DerivedF::Scalar> > vF;
   std::vector<std::vector<typename DerivedF::Scalar> > vF;
   matrix_to_list(F,vF);
   matrix_to_list(F,vF);
-  std::vector<std::vector<typename DerivedC::Scalar> > vC;
+  std::vector<typename DerivedC::Scalar> vC;
   igl::face_occurrences(vF,vC);
   igl::face_occurrences(vF,vC);
   list_to_matrix(vC,C);
   list_to_matrix(vC,C);
 }
 }

+ 6 - 6
include/igl/flipped_triangles.cpp

@@ -11,8 +11,8 @@
 #include <vector>
 #include <vector>
 template <typename DerivedV, typename DerivedF, typename DerivedX>
 template <typename DerivedV, typename DerivedF, typename DerivedX>
 IGL_INLINE void igl::flipped_triangles(
 IGL_INLINE void igl::flipped_triangles(
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedX> & X)
   Eigen::PlainObjectBase<DerivedX> & X)
 {
 {
   assert(V.cols() == 2 && "V should contain 2D positions");
   assert(V.cols() == 2 && "V should contain 2D positions");
@@ -40,8 +40,8 @@ IGL_INLINE void igl::flipped_triangles(
 
 
 template <typename DerivedV, typename DerivedF>
 template <typename DerivedV, typename DerivedF>
 IGL_INLINE Eigen::VectorXi igl::flipped_triangles(
 IGL_INLINE Eigen::VectorXi igl::flipped_triangles(
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::PlainObjectBase<DerivedF> & F)
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedF> & F)
 {
 {
   Eigen::VectorXi X;
   Eigen::VectorXi X;
   flipped_triangles(V,F,X);
   flipped_triangles(V,F,X);
@@ -50,6 +50,6 @@ IGL_INLINE Eigen::VectorXi igl::flipped_triangles(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::flipped_triangles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::flipped_triangles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
+template void igl::flipped_triangles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::flipped_triangles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
 #endif
 #endif

+ 4 - 4
include/igl/flipped_triangles.h

@@ -22,13 +22,13 @@ namespace igl
   // Wrapper with return type
   // Wrapper with return type
   template <typename DerivedV, typename DerivedF, typename DerivedX>
   template <typename DerivedV, typename DerivedF, typename DerivedX>
   IGL_INLINE void flipped_triangles(
   IGL_INLINE void flipped_triangles(
-    const Eigen::PlainObjectBase<DerivedV> & V,
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedF> & F,
     Eigen::PlainObjectBase<DerivedX> & X);
     Eigen::PlainObjectBase<DerivedX> & X);
   template <typename Scalar, typename Index>
   template <typename Scalar, typename Index>
   IGL_INLINE Eigen::VectorXi flipped_triangles(
   IGL_INLINE Eigen::VectorXi flipped_triangles(
-    const Eigen::PlainObjectBase<Scalar> & V,
-    const Eigen::PlainObjectBase<Index> & F);
+    const Eigen::MatrixBase<Scalar> & V,
+    const Eigen::MatrixBase<Index> & F);
 
 
 }
 }
 
 

+ 8 - 8
include/igl/inradius.cpp

@@ -1,27 +1,27 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2016 Alec Jacobson <[email protected]>
 // Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "inradius.h"
 #include "inradius.h"
 #include "edge_lengths.h"
 #include "edge_lengths.h"
 #include "doublearea.h"
 #include "doublearea.h"
 
 
 template <
 template <
-  typename DerivedV, 
+  typename DerivedV,
   typename DerivedF,
   typename DerivedF,
   typename DerivedR>
   typename DerivedR>
 IGL_INLINE void igl::inradius(
 IGL_INLINE void igl::inradius(
-  const Eigen::PlainObjectBase<DerivedV> & V, 
-  const Eigen::PlainObjectBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedF> & F,
   Eigen::PlainObjectBase<DerivedR> & r)
   Eigen::PlainObjectBase<DerivedR> & r)
 {
 {
   Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> l;
   Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> l;
   Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,1> R;
   Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,1> R;
   igl::edge_lengths(V,F,l);
   igl::edge_lengths(V,F,l);
-  // If R is the circumradius, 
+  // If R is the circumradius,
   // R*r = (abc)/(2*(a+b+c))
   // R*r = (abc)/(2*(a+b+c))
   // R = abc/(4*area)
   // R = abc/(4*area)
   // r(abc/(4*area)) = (abc)/(2*(a+b+c))
   // r(abc/(4*area)) = (abc)/(2*(a+b+c))

+ 7 - 7
include/igl/inradius.h

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2016 Alec Jacobson <[email protected]>
 // Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_INRADIUS_H
 #ifndef IGL_INRADIUS_H
 #define IGL_INRADIUS_H
 #define IGL_INRADIUS_H
@@ -20,12 +20,12 @@ namespace igl
   //   R  #F list of inradii
   //   R  #F list of inradii
   //
   //
   template <
   template <
-    typename DerivedV, 
+    typename DerivedV,
     typename DerivedF,
     typename DerivedF,
     typename DerivedR>
     typename DerivedR>
   IGL_INLINE void inradius(
   IGL_INLINE void inradius(
-    const Eigen::PlainObjectBase<DerivedV> & V, 
-    const Eigen::PlainObjectBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedF> & F,
     Eigen::PlainObjectBase<DerivedR> & R);
     Eigen::PlainObjectBase<DerivedR> & R);
 }
 }
 #ifndef IGL_STATIC_LIBRARY
 #ifndef IGL_STATIC_LIBRARY

+ 3 - 3
include/igl/normal_derivative.cpp

@@ -16,8 +16,8 @@ template <
   typename DerivedEle,
   typename DerivedEle,
   typename Scalar>
   typename Scalar>
 IGL_INLINE void igl::normal_derivative(
 IGL_INLINE void igl::normal_derivative(
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::PlainObjectBase<DerivedEle> & Ele,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedEle> & Ele,
   Eigen::SparseMatrix<Scalar>& DD)
   Eigen::SparseMatrix<Scalar>& DD)
 {
 {
   using namespace Eigen;
   using namespace Eigen;
@@ -114,5 +114,5 @@ IGL_INLINE void igl::normal_derivative(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::normal_derivative<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<double, 0, int>&);
+template void igl::normal_derivative<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<double, 0, int>&);
 #endif
 #endif

+ 9 - 9
include/igl/normal_derivative.h

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2015 Alec Jacobson <[email protected]>
 // Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_NORMAL_DERIVATIVE_H
 #ifndef IGL_NORMAL_DERIVATIVE_H
 #define IGL_NORMAL_DERIVATIVE_H
 #define IGL_NORMAL_DERIVATIVE_H
@@ -11,7 +11,7 @@
 
 
 #include <Eigen/Core>
 #include <Eigen/Core>
 #include <Eigen/Sparse>
 #include <Eigen/Sparse>
-namespace igl 
+namespace igl
 {
 {
   // NORMAL_DERIVATIVE Computes the directional derivative **normal** to
   // NORMAL_DERIVATIVE Computes the directional derivative **normal** to
   // **all** (half-)edges of a triangle mesh (not just boundary edges). These
   // **all** (half-)edges of a triangle mesh (not just boundary edges). These
@@ -27,12 +27,12 @@ namespace igl
   //     directional derivative with respect to each facet of each element.
   //     directional derivative with respect to each facet of each element.
   //
   //
   template <
   template <
-    typename DerivedV, 
-    typename DerivedEle, 
+    typename DerivedV,
+    typename DerivedEle,
     typename Scalar>
     typename Scalar>
   IGL_INLINE void normal_derivative(
   IGL_INLINE void normal_derivative(
-    const Eigen::PlainObjectBase<DerivedV> & V,
-    const Eigen::PlainObjectBase<DerivedEle> & Ele,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedEle> & Ele,
     Eigen::SparseMatrix<Scalar>& DD);
     Eigen::SparseMatrix<Scalar>& DD);
 }
 }
 
 

+ 13 - 13
include/igl/orient_outward.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "orient_outward.h"
 #include "orient_outward.h"
 #include "per_face_normals.h"
 #include "per_face_normals.h"
@@ -12,15 +12,15 @@
 #include <iostream>
 #include <iostream>
 
 
 template <
 template <
-  typename DerivedV, 
-  typename DerivedF, 
-  typename DerivedC, 
-  typename DerivedFF, 
+  typename DerivedV,
+  typename DerivedF,
+  typename DerivedC,
+  typename DerivedFF,
   typename DerivedI>
   typename DerivedI>
 IGL_INLINE void igl::orient_outward(
 IGL_INLINE void igl::orient_outward(
-  const Eigen::PlainObjectBase<DerivedV> & V,
-  const Eigen::PlainObjectBase<DerivedF> & F,
-  const Eigen::PlainObjectBase<DerivedC> & C,
+  const Eigen::MatrixBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedF> & F,
+  const Eigen::MatrixBase<DerivedC> & C,
   Eigen::PlainObjectBase<DerivedFF> & FF,
   Eigen::PlainObjectBase<DerivedFF> & FF,
   Eigen::PlainObjectBase<DerivedI> & I)
   Eigen::PlainObjectBase<DerivedI> & I)
 {
 {
@@ -90,7 +90,7 @@ IGL_INLINE void igl::orient_outward(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::orient_outward<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template void igl::orient_outward<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::orient_outward<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::orient_outward<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #endif
 #endif
 
 

+ 11 - 11
include/igl/orient_outward.h

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_ORIENT_OUTWARD_H
 #ifndef IGL_ORIENT_OUTWARD_H
 #define IGL_ORIENT_OUTWARD_H
 #define IGL_ORIENT_OUTWARD_H
@@ -23,15 +23,15 @@ namespace igl
   //     FF(I,:) = fliplr(F(I,:)) (OK if &FF = &F)
   //     FF(I,:) = fliplr(F(I,:)) (OK if &FF = &F)
   //   I  max(C)+1 list of whether face has been flipped
   //   I  max(C)+1 list of whether face has been flipped
   template <
   template <
-    typename DerivedV, 
-    typename DerivedF, 
-    typename DerivedC, 
-    typename DerivedFF, 
+    typename DerivedV,
+    typename DerivedF,
+    typename DerivedC,
+    typename DerivedFF,
     typename DerivedI>
     typename DerivedI>
   IGL_INLINE void orient_outward(
   IGL_INLINE void orient_outward(
-    const Eigen::PlainObjectBase<DerivedV> & V,
-    const Eigen::PlainObjectBase<DerivedF> & F,
-    const Eigen::PlainObjectBase<DerivedC> & C,
+    const Eigen::MatrixBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedF> & F,
+    const Eigen::MatrixBase<DerivedC> & C,
     Eigen::PlainObjectBase<DerivedFF> & FF,
     Eigen::PlainObjectBase<DerivedFF> & FF,
     Eigen::PlainObjectBase<DerivedI> & I);
     Eigen::PlainObjectBase<DerivedI> & I);
 };
 };

+ 22 - 22
include/igl/snap_points.cpp

@@ -1,23 +1,23 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "snap_points.h"
 #include "snap_points.h"
 #include <cassert>
 #include <cassert>
 #include <limits>
 #include <limits>
 
 
 template <
 template <
-  typename DerivedC, 
-  typename DerivedV, 
-  typename DerivedI, 
-  typename DerivedminD, 
+  typename DerivedC,
+  typename DerivedV,
+  typename DerivedI,
+  typename DerivedminD,
   typename DerivedVI>
   typename DerivedVI>
 IGL_INLINE void igl::snap_points(
 IGL_INLINE void igl::snap_points(
-  const Eigen::PlainObjectBase<DerivedC > & C,
-  const Eigen::PlainObjectBase<DerivedV > & V,
+  const Eigen::MatrixBase<DerivedC > & C,
+  const Eigen::MatrixBase<DerivedV > & V,
   Eigen::PlainObjectBase<DerivedI > & I,
   Eigen::PlainObjectBase<DerivedI > & I,
   Eigen::PlainObjectBase<DerivedminD > & minD,
   Eigen::PlainObjectBase<DerivedminD > & minD,
   Eigen::PlainObjectBase<DerivedVI > & VI)
   Eigen::PlainObjectBase<DerivedVI > & VI)
@@ -32,13 +32,13 @@ IGL_INLINE void igl::snap_points(
 }
 }
 
 
 template <
 template <
-  typename DerivedC, 
-  typename DerivedV, 
-  typename DerivedI, 
+  typename DerivedC,
+  typename DerivedV,
+  typename DerivedI,
   typename DerivedminD>
   typename DerivedminD>
 IGL_INLINE void igl::snap_points(
 IGL_INLINE void igl::snap_points(
-  const Eigen::PlainObjectBase<DerivedC > & C,
-  const Eigen::PlainObjectBase<DerivedV > & V,
+  const Eigen::MatrixBase<DerivedC > & C,
+  const Eigen::MatrixBase<DerivedV > & V,
   Eigen::PlainObjectBase<DerivedI > & I,
   Eigen::PlainObjectBase<DerivedI > & I,
   Eigen::PlainObjectBase<DerivedminD > & minD)
   Eigen::PlainObjectBase<DerivedminD > & minD)
 {
 {
@@ -68,12 +68,12 @@ IGL_INLINE void igl::snap_points(
 }
 }
 
 
 template <
 template <
-  typename DerivedC, 
-  typename DerivedV, 
+  typename DerivedC,
+  typename DerivedV,
   typename DerivedI>
   typename DerivedI>
 IGL_INLINE void igl::snap_points(
 IGL_INLINE void igl::snap_points(
-  const Eigen::PlainObjectBase<DerivedC > & C,
-  const Eigen::PlainObjectBase<DerivedV > & V,
+  const Eigen::MatrixBase<DerivedC > & C,
+  const Eigen::MatrixBase<DerivedV > & V,
   Eigen::PlainObjectBase<DerivedI > & I)
   Eigen::PlainObjectBase<DerivedI > & I)
 {
 {
   Eigen::Matrix<typename DerivedC::Scalar,DerivedC::RowsAtCompileTime,1> minD;
   Eigen::Matrix<typename DerivedC::Scalar,DerivedC::RowsAtCompileTime,1> minD;
@@ -83,8 +83,8 @@ IGL_INLINE void igl::snap_points(
 
 
 #ifdef IGL_STATIC_LIBRARY
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template instantiation
 // Explicit template instantiation
-template void igl::snap_points<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
-template void igl::snap_points<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template void igl::snap_points<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::snap_points<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+template void igl::snap_points<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::snap_points<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #endif
 #endif
 
 

+ 20 - 20
include/igl/snap_points.h

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_SNAP_POINTS_H
 #ifndef IGL_SNAP_POINTS_H
 #define IGL_SNAP_POINTS_H
 #define IGL_SNAP_POINTS_H
@@ -16,7 +16,7 @@ namespace igl
   // SNAP_POINTS snap list of points C to closest of another list of points V
   // SNAP_POINTS snap list of points C to closest of another list of points V
   //
   //
   // [I,minD,VI] = snap_points(C,V)
   // [I,minD,VI] = snap_points(C,V)
-  // 
+  //
   // Inputs:
   // Inputs:
   //   C  #C by dim list of query point positions
   //   C  #C by dim list of query point positions
   //   V  #V by dim list of data point positions
   //   V  #V by dim list of data point positions
@@ -25,34 +25,34 @@ namespace igl
   //   minD  #C list of squared (^p) distances to closest points
   //   minD  #C list of squared (^p) distances to closest points
   //   VI  #C by dim list of new point positions, VI = V(I,:)
   //   VI  #C by dim list of new point positions, VI = V(I,:)
   template <
   template <
-    typename DerivedC, 
-    typename DerivedV, 
-    typename DerivedI, 
-    typename DerivedminD, 
+    typename DerivedC,
+    typename DerivedV,
+    typename DerivedI,
+    typename DerivedminD,
     typename DerivedVI>
     typename DerivedVI>
   IGL_INLINE void snap_points(
   IGL_INLINE void snap_points(
-    const Eigen::PlainObjectBase<DerivedC > & C,
-    const Eigen::PlainObjectBase<DerivedV > & V,
+    const Eigen::MatrixBase<DerivedC > & C,
+    const Eigen::MatrixBase<DerivedV > & V,
     Eigen::PlainObjectBase<DerivedI > & I,
     Eigen::PlainObjectBase<DerivedI > & I,
     Eigen::PlainObjectBase<DerivedminD > & minD,
     Eigen::PlainObjectBase<DerivedminD > & minD,
     Eigen::PlainObjectBase<DerivedVI > & VI);
     Eigen::PlainObjectBase<DerivedVI > & VI);
   template <
   template <
-    typename DerivedC, 
-    typename DerivedV, 
-    typename DerivedI, 
+    typename DerivedC,
+    typename DerivedV,
+    typename DerivedI,
     typename DerivedminD>
     typename DerivedminD>
   IGL_INLINE void snap_points(
   IGL_INLINE void snap_points(
-    const Eigen::PlainObjectBase<DerivedC > & C,
-    const Eigen::PlainObjectBase<DerivedV > & V,
+    const Eigen::MatrixBase<DerivedC > & C,
+    const Eigen::MatrixBase<DerivedV > & V,
     Eigen::PlainObjectBase<DerivedI > & I,
     Eigen::PlainObjectBase<DerivedI > & I,
     Eigen::PlainObjectBase<DerivedminD > & minD);
     Eigen::PlainObjectBase<DerivedminD > & minD);
   template <
   template <
-    typename DerivedC, 
-    typename DerivedV, 
+    typename DerivedC,
+    typename DerivedV,
     typename DerivedI >
     typename DerivedI >
   IGL_INLINE void snap_points(
   IGL_INLINE void snap_points(
-    const Eigen::PlainObjectBase<DerivedC > & C,
-    const Eigen::PlainObjectBase<DerivedV > & V,
+    const Eigen::MatrixBase<DerivedC > & C,
+    const Eigen::MatrixBase<DerivedV > & V,
     Eigen::PlainObjectBase<DerivedI > & I);
     Eigen::PlainObjectBase<DerivedI > & I);
 }
 }