Browse Source

variadic boolean ops

Former-commit-id: dbe6a4aeb286d70d01e9efb361b7a230f7aa1fe1
Alec Jacobson 9 years ago
parent
commit
4f99fc5ddd

+ 4 - 0
include/igl/copyleft/cgal/BinaryWindingNumberOperations.h

@@ -14,6 +14,10 @@
 #include "../../MeshBooleanType.h"
 #include <Eigen/Core>
 
+// TODO: This is not written according to libigl style. These should be
+// function handles.
+//
+// Why is this templated on DerivedW
 namespace igl
 {
   namespace copyleft

+ 8 - 0
include/igl/copyleft/cgal/extract_cells.cpp

@@ -83,6 +83,13 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells(
   const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
   Eigen::PlainObjectBase<DerivedC>& cells) 
 {
+  // Trivial base case
+  if(P.size() == 0)
+  {
+    assert(F.size() == 0);
+    cells.resize(0,2);
+    return 0;
+  }
 
   typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
   typedef Kernel::Point_3 Point_3;
@@ -113,6 +120,7 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells(
 #endif
   const size_t num_faces = F.rows();
   typedef typename DerivedF::Scalar Index;
+  assert(P.size() > 0);
   const size_t num_patches = P.maxCoeff()+1;
 
   // Extract all cells...

+ 1 - 0
include/igl/copyleft/cgal/extract_cells.h

@@ -29,6 +29,7 @@ namespace igl {
       //          cell index on the positive side of face i, and cells(i,1)
       //          represents cell index of the negqtive side.
       //          By convension cell with index 0 is the infinite cell.
+      // Returns the number of cells
       template<
         typename DerivedV,
         typename DerivedF,

+ 158 - 167
include/igl/copyleft/cgal/mesh_boolean.cpp

@@ -10,6 +10,7 @@
 #include "mesh_boolean.h"
 #include "BinaryWindingNumberOperations.h"
 #include "assign_scalar.h"
+#include "string_to_mesh_boolean_type.h"
 #include "propagate_winding_numbers.h"
 #include "remesh_self_intersections.h"
 #include "relabel_small_immersed_cells.h"
@@ -35,9 +36,74 @@ template <
   typename DerivedFA,
   typename DerivedVB,
   typename DerivedFB,
-  typename WindingNumberOp,
-  typename KeepFunc,
-  typename ResolveFunc,
+  typename DerivedVC,
+  typename DerivedFC,
+  typename DerivedJ>
+IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
+    const Eigen::PlainObjectBase<DerivedVA > & VA,
+    const Eigen::PlainObjectBase<DerivedFA > & FA,
+    const Eigen::PlainObjectBase<DerivedVB > & VB,
+    const Eigen::PlainObjectBase<DerivedFB > & FB,
+    const MeshBooleanType & type,
+    Eigen::PlainObjectBase<DerivedVC > & VC,
+    Eigen::PlainObjectBase<DerivedFC > & FC,
+    Eigen::PlainObjectBase<DerivedJ > & J)
+{
+  switch (type) 
+  {
+    case MESH_BOOLEAN_TYPE_UNION:
+      return igl::copyleft::cgal::mesh_boolean(
+          VA, FA, VB, FB, igl::copyleft::cgal::BinaryUnion(),
+          igl::copyleft::cgal::KeepInside(), VC, FC, J);
+    case MESH_BOOLEAN_TYPE_INTERSECT:
+      return igl::copyleft::cgal::mesh_boolean(
+          VA, FA, VB, FB, igl::copyleft::cgal::BinaryIntersect(),
+          igl::copyleft::cgal::KeepInside(), VC, FC, J);
+    case MESH_BOOLEAN_TYPE_MINUS:
+      return igl::copyleft::cgal::mesh_boolean(
+          VA, FA, VB, FB, igl::copyleft::cgal::BinaryMinus(),
+          igl::copyleft::cgal::KeepInside(), VC, FC, J);
+    case MESH_BOOLEAN_TYPE_XOR:
+      return igl::copyleft::cgal::mesh_boolean(
+          VA, FA, VB, FB, igl::copyleft::cgal::BinaryXor(),
+          igl::copyleft::cgal::KeepInside(), VC, FC, J);
+    case MESH_BOOLEAN_TYPE_RESOLVE:
+      //op = binary_resolve();
+      return igl::copyleft::cgal::mesh_boolean(
+          VA, FA, VB, FB, igl::copyleft::cgal::BinaryResolve(),
+          igl::copyleft::cgal::KeepAll(), VC, FC, J);
+    default:
+      assert(false && "Unsupported boolean type.");
+      return false;
+  }
+}
+template <
+  typename DerivedVA,
+  typename DerivedFA,
+  typename DerivedVB,
+  typename DerivedFB,
+  typename DerivedVC,
+  typename DerivedFC,
+  typename DerivedJ>
+IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
+  const Eigen::PlainObjectBase<DerivedVA > & VA,
+  const Eigen::PlainObjectBase<DerivedFA > & FA,
+  const Eigen::PlainObjectBase<DerivedVB > & VB,
+  const Eigen::PlainObjectBase<DerivedFB > & FB,
+  const std::string & type_str,
+  Eigen::PlainObjectBase<DerivedVC > & VC,
+  Eigen::PlainObjectBase<DerivedFC > & FC,
+  Eigen::PlainObjectBase<DerivedJ > & J)
+{
+  return mesh_boolean(
+    VA,FA,VB,FB,string_to_mesh_boolean_type(type_str),VC,FC,J);
+}
+
+template <
+  typename DerivedVA,
+  typename DerivedFA,
+  typename DerivedVB,
+  typename DerivedFB,
   typename DerivedVC,
   typename DerivedFC,
   typename DerivedJ>
@@ -46,78 +112,86 @@ IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
     const Eigen::PlainObjectBase<DerivedFA> & FA,
     const Eigen::PlainObjectBase<DerivedVB> & VB,
     const Eigen::PlainObjectBase<DerivedFB> & FB,
-    const WindingNumberOp& wind_num_op,
-    const KeepFunc& keep,
-    const ResolveFunc& resolve_fun,
+    const std::function<int(const Eigen::Matrix<int,1,Eigen::Dynamic>) >& wind_num_op,
+    const std::function<int(const int, const int)> & keep,
     Eigen::PlainObjectBase<DerivedVC > & VC,
     Eigen::PlainObjectBase<DerivedFC > & FC,
     Eigen::PlainObjectBase<DerivedJ > & J) 
 {
-
-#ifdef MESH_BOOLEAN_TIMING
-  const auto & tictoc = []() -> double
+  // Generate combined mesh (VA,FA,VB,FB) -> (V,F)
+  Eigen::Matrix<size_t,2,1> sizes(FA.rows(),FB.rows());
+  DerivedVA VV(VA.rows() + VB.rows(), 3);
+  DerivedFC FF(FA.rows() + FB.rows(), 3);
+  // Can't use comma initializer
+  for(int a = 0;a<VA.rows();a++)
   {
-    static double t_start = igl::get_seconds();
-    double diff = igl::get_seconds()-t_start;
-    t_start += diff;
-    return diff;
-  };
-  const auto log_time = [&](const std::string& label) -> void {
-    std::cout << "mesh_boolean." << label << ": "
-      << tictoc() << std::endl;
-  };
-  tictoc();
-#endif
-  typedef typename DerivedVC::Scalar Scalar;
-  typedef CGAL::Epeck Kernel;
-  typedef Kernel::FT ExactScalar;
-  typedef Eigen::Matrix<Scalar,Eigen::Dynamic,3> MatrixX3S;
-  typedef Eigen::Matrix<typename DerivedJ::Scalar,Eigen::Dynamic,1> VectorXJ;
-  // Generate combined mesh (VA,FA,VB,FB) -> (V,F,CJ)
-  typedef Eigen::Matrix<
-    ExactScalar,
-    Eigen::Dynamic,
-    Eigen::Dynamic,
-    DerivedVC::IsRowMajor> MatrixXES;
+    for(int d = 0;d<3;d++) VV(a,d) = VA(a,d);
+  }
+  for(int b = 0;b<VB.rows();b++)
+  {
+    for(int d = 0;d<3;d++) VV(VA.rows()+b,d) = VB(b,d);
+  }
+  FF << FA, FB.array() + VA.rows();
+  return mesh_boolean(VV,FF,sizes,wind_num_op,keep,VC,FC,J);
+}
 
-  MatrixXES V;
-  DerivedFC F;
-  VectorXJ  CJ;
-  Eigen::Matrix<size_t,2,1> sizes(FA.rows(),FB.rows());
+template <
+  typename DerivedV,
+  typename DerivedF,
+  typename DerivedVC,
+  typename DerivedFC,
+  typename DerivedJ>
+IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
+    const std::vector<DerivedV > & Vlist,
+    const std::vector<DerivedF > & Flist,
+    const std::function<int(const Eigen::Matrix<int,1,Eigen::Dynamic>) >& wind_num_op,
+    const std::function<int(const int, const int)> & keep,
+    Eigen::PlainObjectBase<DerivedVC > & VC,
+    Eigen::PlainObjectBase<DerivedFC > & FC,
+    Eigen::PlainObjectBase<DerivedJ > & J)
+{
+  assert(Flist.size() == Vlist.size() && "#Vlist and #Flist should match");
+  const size_t num_inputs = Vlist.size();
+  // Gather sizes
+  Eigen::Matrix<size_t,Eigen::Dynamic,1> sizes(num_inputs);
+  int numf = 0;
+  int numv = 0;
+  for(int i = 0;i<num_inputs;i++)
   {
-    DerivedVA VV(VA.rows() + VB.rows(), 3);
-    DerivedFC FF(FA.rows() + FB.rows(), 3);
-    VV << VA, VB;
-    FF << FA, FB.array() + VA.rows();
-    resolve_fun(VV, FF, V, F, CJ);
+    sizes(i) = Flist[i].rows();
+    numf += Flist[i].rows();
+    numv += Vlist[i].rows();
   }
-#ifdef MESH_BOOLEAN_TIMING
-  log_time("resolve_self_intersection");
-#endif
-  return mesh_boolean(V,F,CJ,sizes,wind_num_op,keep,VC,FC,J);
+  // Combined mesh
+  DerivedV VV(numv,3);
+  DerivedF FF(numf,3);
+  {
+    int fk = 0;
+    int vk = 0;
+    for(int i = 0;i<num_inputs;i++)
+    {
+      FF.block(fk,0,Flist[i].rows(),3) = Flist[i].array() + vk;
+      fk += Flist[i].rows();
+      VV.block(vk,0,Vlist[i].rows(),3) = Vlist[i];
+      vk += Vlist[i].rows();
+    }
+  }
+  return mesh_boolean(VV,FF,sizes,wind_num_op,keep,VC,FC,J);
 }
 
 template <
+  typename DerivedVV,
+  typename DerivedFF,
   typename Derivedsizes,
-  typename WindingNumberOp,
-  typename KeepFunc,
   typename DerivedVC,
   typename DerivedFC,
   typename DerivedJ>
 IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
-    const Eigen::Matrix<
-      CGAL::Epeck::FT,
-      Eigen::Dynamic,
-      Eigen::Dynamic,
-      DerivedVC::IsRowMajor> V,
-    const Eigen::PlainObjectBase<DerivedFC > & F,
-    const Eigen::Matrix<
-      typename DerivedJ::Scalar,
-      Eigen::Dynamic,
-      1> & CJ,
+    const Eigen::PlainObjectBase<DerivedVV > & VV,
+    const Eigen::PlainObjectBase<DerivedFF > & FF,
     const Eigen::PlainObjectBase<Derivedsizes> & sizes,
-    const WindingNumberOp& wind_num_op,
-    const KeepFunc& keep,
+    const std::function<int(const Eigen::Matrix<int,1,Eigen::Dynamic>) >& wind_num_op,
+    const std::function<int(const int, const int)> & keep,
     Eigen::PlainObjectBase<DerivedVC > & VC,
     Eigen::PlainObjectBase<DerivedFC > & FC,
     Eigen::PlainObjectBase<DerivedJ > & J)
@@ -141,12 +215,34 @@ IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
   typedef Kernel::FT ExactScalar;
   typedef Eigen::Matrix<Scalar,Eigen::Dynamic,3> MatrixX3S;
   typedef Eigen::Matrix<typename DerivedJ::Scalar,Eigen::Dynamic,1> VectorXJ;
-  // Generate combined mesh (VA,FA,VB,FB) -> (V,F,CJ)
   typedef Eigen::Matrix<
     ExactScalar,
     Eigen::Dynamic,
     Eigen::Dynamic,
     DerivedVC::IsRowMajor> MatrixXES;
+  MatrixXES V;
+  DerivedFC F;
+  VectorXJ  CJ;
+  {
+    Eigen::VectorXi I;
+    igl::copyleft::cgal::RemeshSelfIntersectionsParam params;
+    params.stitch_all = true;
+    MatrixXES Vr;
+    DerivedFC Fr;
+    Eigen::MatrixXi IF;
+    igl::copyleft::cgal::remesh_self_intersections(
+        VV, FF, params, Vr, Fr, IF, CJ, I);
+    assert(I.size() == Vr.rows());
+    // Merge coinciding vertices into non-manifold vertices.
+    std::for_each(Fr.data(), Fr.data()+Fr.size(),
+          [&I](typename DerivedFC::Scalar& a) { a=I[a]; });
+      // Remove unreferenced vertices.
+      Eigen::VectorXi UIM;
+      igl::remove_unreferenced(Vr, Fr, V, F, UIM);
+   }
+#ifdef MESH_BOOLEAN_TIMING
+  log_time("resolve_self_intersection");
+#endif
 
   // Compute edges of (F) --> (E,uE,EMAP,uE2E)
   Eigen::MatrixXi E, uE;
@@ -332,114 +428,6 @@ IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
   return valid;
 }
 
-template <
-  typename DerivedVA,
-  typename DerivedFA,
-  typename DerivedVB,
-  typename DerivedFB,
-  typename ResolveFunc,
-  typename DerivedVC,
-  typename DerivedFC,
-  typename DerivedJ>
-IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
-    const Eigen::PlainObjectBase<DerivedVA > & VA,
-    const Eigen::PlainObjectBase<DerivedFA > & FA,
-    const Eigen::PlainObjectBase<DerivedVB > & VB,
-    const Eigen::PlainObjectBase<DerivedFB > & FB,
-    const MeshBooleanType & type,
-    const ResolveFunc& resolve_func,
-    Eigen::PlainObjectBase<DerivedVC > & VC,
-    Eigen::PlainObjectBase<DerivedFC > & FC,
-    Eigen::PlainObjectBase<DerivedJ > & J)
-{
-  switch (type) 
-  {
-    case MESH_BOOLEAN_TYPE_UNION:
-      return igl::copyleft::cgal::mesh_boolean(
-          VA, FA, VB, FB, igl::copyleft::cgal::BinaryUnion(),
-          igl::copyleft::cgal::KeepInside(), resolve_func, VC, FC, J);
-    case MESH_BOOLEAN_TYPE_INTERSECT:
-      return igl::copyleft::cgal::mesh_boolean(
-          VA, FA, VB, FB, igl::copyleft::cgal::BinaryIntersect(),
-          igl::copyleft::cgal::KeepInside(), resolve_func, VC, FC, J);
-    case MESH_BOOLEAN_TYPE_MINUS:
-      return igl::copyleft::cgal::mesh_boolean(
-          VA, FA, VB, FB, igl::copyleft::cgal::BinaryMinus(),
-          igl::copyleft::cgal::KeepInside(), resolve_func, VC, FC, J);
-    case MESH_BOOLEAN_TYPE_XOR:
-      return igl::copyleft::cgal::mesh_boolean(
-          VA, FA, VB, FB, igl::copyleft::cgal::BinaryXor(),
-          igl::copyleft::cgal::KeepInside(), resolve_func, VC, FC, J);
-    case MESH_BOOLEAN_TYPE_RESOLVE:
-      //op = binary_resolve();
-      return igl::copyleft::cgal::mesh_boolean(
-          VA, FA, VB, FB, igl::copyleft::cgal::BinaryResolve(),
-          igl::copyleft::cgal::KeepAll(), resolve_func, VC, FC, J);
-    default:
-      assert(false && "Unsupported boolean type.");
-      return false;
-  }
-}
-
-template <
-  typename DerivedVA,
-  typename DerivedFA,
-  typename DerivedVB,
-  typename DerivedFB,
-  typename DerivedVC,
-  typename DerivedFC,
-  typename DerivedJ>
-IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
-  const Eigen::PlainObjectBase<DerivedVA > & VA,
-  const Eigen::PlainObjectBase<DerivedFA > & FA,
-  const Eigen::PlainObjectBase<DerivedVB > & VB,
-  const Eigen::PlainObjectBase<DerivedFB > & FB,
-  const MeshBooleanType & type,
-  Eigen::PlainObjectBase<DerivedVC > & VC,
-  Eigen::PlainObjectBase<DerivedFC > & FC,
-  Eigen::PlainObjectBase<DerivedJ > & J)
-{
-  typedef CGAL::Epeck Kernel;
-  typedef Kernel::FT ExactScalar;
-  typedef Eigen::Matrix<
-    ExactScalar,
-    Eigen::Dynamic,
-    Eigen::Dynamic,
-    DerivedVC::IsRowMajor> MatrixXES;
-
-  std::function<void(
-      const Eigen::PlainObjectBase<DerivedVA>&,
-      const Eigen::PlainObjectBase<DerivedFA>&,
-      Eigen::PlainObjectBase<MatrixXES>&,
-      Eigen::PlainObjectBase<DerivedFC>&,
-      Eigen::PlainObjectBase<DerivedJ>&)> resolve_func =
-    [](const Eigen::PlainObjectBase<DerivedVA>& V,
-        const Eigen::PlainObjectBase<DerivedFA>& F,
-        Eigen::PlainObjectBase<MatrixXES>& Vo,
-        Eigen::PlainObjectBase<DerivedFC>& Fo,
-        Eigen::PlainObjectBase<DerivedJ>& J) {
-      Eigen::VectorXi I;
-      igl::copyleft::cgal::RemeshSelfIntersectionsParam params;
-      params.stitch_all = true;
-      MatrixXES Vr;
-      DerivedFC Fr;
-      Eigen::MatrixXi IF;
-      igl::copyleft::cgal::remesh_self_intersections(
-          V, F, params, Vr, Fr, IF, J, I);
-      assert(I.size() == Vr.rows());
-
-      // Merge coinciding vertices into non-manifold vertices.
-      std::for_each(Fr.data(), Fr.data()+Fr.size(),
-          [&I](typename DerivedFC::Scalar& a) { a=I[a]; });
-
-      // Remove unreferenced vertices.
-      Eigen::VectorXi UIM;
-      igl::remove_unreferenced(Vr, Fr, Vo, Fo, UIM);
-    };
-
-  return mesh_boolean(VA,FA,VB,FB,type,resolve_func,VC,FC,J);
-}
-
 template <
   typename DerivedVA,
   typename DerivedFA,
@@ -465,6 +453,9 @@ IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
 template bool igl::copyleft::cgal::mesh_boolean<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::Matrix<int, -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<int, -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> > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 template bool igl::copyleft::cgal::mesh_boolean<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<long, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&);
 template bool igl::copyleft::cgal::mesh_boolean<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::Matrix<int, -1, -1, 0, -1, -1>, 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<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template bool igl::copyleft::cgal::mesh_boolean<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -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> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template bool igl::copyleft::cgal::mesh_boolean<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::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1> > > const&, std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1> > > const&, std::function<int (Eigen::Matrix<int, 1, -1, 1, 1, -1>)> const&, std::function<int (int, int)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template bool igl::copyleft::cgal::mesh_boolean<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #undef IGL_STATIC_LIBRARY
 #include "../../remove_unreferenced.cpp"
 template void igl::remove_unreferenced<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);

+ 93 - 134
include/igl/copyleft/cgal/mesh_boolean.h

@@ -13,8 +13,8 @@
 #include "../../igl_inline.h"
 #include "../../MeshBooleanType.h"
 #include <Eigen/Core>
-#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
 #include <functional>
+#include <vector>
 
 namespace igl
 {
@@ -30,18 +30,13 @@ namespace igl
       //    FA  #FA by 3 list of triangle indices into VA
       //    VB  #VB by 3 list of vertex positions of second mesh
       //    FB  #FB by 3 list of triangle indices into VB
-      //    wind_num_op  function handle for filtering winding numbers from
-      //      tuples of integer values to [0,1] outside/inside values
-      //    keep  function handle for determining if a patch should be "kept"
-      //      in the output based on the winding number on either side
-      //    resolve_fun  function handle for computing resolve of a
-      //      self-intersections of a mesh and outputting the new mesh.
+      //    type  type of boolean operation
       //  Outputs:
       //    VC  #VC by 3 list of vertex positions of boolean result mesh
       //    FC  #FC by 3 list of triangle indices into VC
       //    J  #FC list of indices into [FA;FB] revealing "birth" facet
-      //  Returns true iff inputs induce a piecewise constant winding number
-      //    field
+      //  Returns true if inputs induce a piecewise constant winding number
+      //  field and type is valid
       //
       //  See also: mesh_boolean_cork, intersect_other,
       //  remesh_self_intersections
@@ -50,120 +45,51 @@ namespace igl
         typename DerivedFA,
         typename DerivedVB,
         typename DerivedFB,
-        typename WindingNumberOp,
-        typename KeepFunc,
-        typename ResolveFunc,
         typename DerivedVC,
         typename DerivedFC,
         typename DerivedJ>
       IGL_INLINE bool mesh_boolean(
-          const Eigen::PlainObjectBase<DerivedVA> & VA,
-          const Eigen::PlainObjectBase<DerivedFA> & FA,
-          const Eigen::PlainObjectBase<DerivedVB> & VB,
-          const Eigen::PlainObjectBase<DerivedFB> & FB,
-          const WindingNumberOp& wind_num_op,
-          const KeepFunc& keep,
-          const ResolveFunc& resolve_fun,
-          Eigen::PlainObjectBase<DerivedVC > & VC,
-          Eigen::PlainObjectBase<DerivedFC > & FC,
-          Eigen::PlainObjectBase<DerivedJ > & J);
-      ////  MESH_BOOLEAN Compute boolean csg operations on "solid", consistently
-      ////  oriented meshes.
-      ////
-      ////  Inputs:
-      ////    Vlist  k-long list of lists of mesh vertex positions
-      ////    Flist  k-long list of lists of mesh face indices, so that Flist[i] indexes
-      ////      vertices in Vlist[i]
-      ////    wind_num_op  function handle for filtering winding numbers from
-      ////      n-tuples of integer values to [0,1] outside/inside values
-      ////    keep  function handle for determining if a patch should be "kept"
-      ////      in the output based on the winding number on either side
-      ////    resolve_fun  function handle for computing resolve of a
-      ////      self-intersections of a mesh and outputting the new mesh.
-      ////  Outputs:
-      ////    VC  #VC by 3 list of vertex positions of boolean result mesh
-      ////    FC  #FC by 3 list of triangle indices into VC
-      ////    J  #FC list of indices into [Flist[0];Flist[1];...;Flist[k]]
-      ////      revealing "birth" facet
-      ////  Returns true iff inputs induce a piecewise constant winding number
-      ////    field
-      ////
-      ////  See also: mesh_boolean_cork, intersect_other,
-      ////  remesh_self_intersections
-      //template <
-      //  typename DerivedV,
-      //  typename DerivedF,
-      //  typename WindingNumberOp,
-      //  typename KeepFunc,
-      //  typename ResolveFunc,
-      //  typename DerivedVC,
-      //  typename DerivedFC,
-      //  typename DerivedJ>
-      //IGL_INLINE bool mesh_boolean(
-      //    const std::vector<Eigen::PlainObjectBase<DerivedVA> > & Vlist,
-      //    const std::vector<Eigen::PlainObjectBase<DerivedFA> > & Flist,
-      //    const WindingNumberOp& wind_num_op,
-      //    const KeepFunc& keep,
-      //    const ResolveFunc& resolve_fun,
-      //    Eigen::PlainObjectBase<DerivedVC > & VC,
-      //    Eigen::PlainObjectBase<DerivedFC > & FC,
-      //    Eigen::PlainObjectBase<DerivedJ > & J);
-      // Given a resolved mesh (V,F), containing no self-intersections and a
-      // list of birth parents.
-      //
-      // Inputs:
-      //   V  #V by 3 list of resolved mesh vertex positions
-      //   F  #F by 3 list of resolve mesh face indices 
-      //   CJ #F list of birth parents 
-      //   sizes  #inputs list of sizes so that sizes(i) is the #faces in the
-      //     ith input
-      //    wind_num_op  function handle for filtering winding numbers from
-      //      tuples of integer values to [0,1] outside/inside values
-      //    keep  function handle for determining if a patch should be "kept"
-      //      in the output based on the winding number on either side
-      //  Outputs:
-      //    VC  #VC by 3 list of vertex positions of boolean result mesh
-      //    FC  #FC by 3 list of triangle indices into VC
-      //    J  #FC list of birth parent indices
-      // 
+        const Eigen::PlainObjectBase<DerivedVA > & VA,
+        const Eigen::PlainObjectBase<DerivedFA > & FA,
+        const Eigen::PlainObjectBase<DerivedVB > & VB,
+        const Eigen::PlainObjectBase<DerivedFB > & FB,
+        const MeshBooleanType & type,
+        Eigen::PlainObjectBase<DerivedVC > & VC,
+        Eigen::PlainObjectBase<DerivedFC > & FC,
+        Eigen::PlainObjectBase<DerivedJ > & J);
       template <
-        typename Derivedsizes,
-        typename WindingNumberOp,
-        typename KeepFunc,
+        typename DerivedVA,
+        typename DerivedFA,
+        typename DerivedVB,
+        typename DerivedFB,
         typename DerivedVC,
         typename DerivedFC,
         typename DerivedJ>
       IGL_INLINE bool mesh_boolean(
-          const Eigen::Matrix<
-            CGAL::Epeck::FT,
-            Eigen::Dynamic,
-            Eigen::Dynamic,
-            DerivedVC::IsRowMajor> V,
-          const Eigen::PlainObjectBase<DerivedFC > & F,
-          const Eigen::Matrix<
-            typename DerivedJ::Scalar,
-            Eigen::Dynamic,
-            1> & CJ,
-          const Eigen::PlainObjectBase<Derivedsizes> & sizes,
-          const WindingNumberOp& wind_num_op,
-          const KeepFunc& keep,
-          Eigen::PlainObjectBase<DerivedVC > & VC,
-          Eigen::PlainObjectBase<DerivedFC > & FC,
-          Eigen::PlainObjectBase<DerivedJ > & J);
+        const Eigen::PlainObjectBase<DerivedVA > & VA,
+        const Eigen::PlainObjectBase<DerivedFA > & FA,
+        const Eigen::PlainObjectBase<DerivedVB > & VB,
+        const Eigen::PlainObjectBase<DerivedFB > & FB,
+        const std::string & type_str,
+        Eigen::PlainObjectBase<DerivedVC > & VC,
+        Eigen::PlainObjectBase<DerivedFC > & FC,
+        Eigen::PlainObjectBase<DerivedJ > & J);
+      //
       //  Inputs:
       //    VA  #VA by 3 list of vertex positions of first mesh
       //    FA  #FA by 3 list of triangle indices into VA
       //    VB  #VB by 3 list of vertex positions of second mesh
       //    FB  #FB by 3 list of triangle indices into VB
-      //    type  type of boolean operation
-      //    resolve_fun  function handle for computing resolve of a
-      //      self-intersections of a mesh and outputting the new mesh.
+      //    wind_num_op  function handle for filtering winding numbers from
+      //      tuples of integer values to [0,1] outside/inside values
+      //    keep  function handle for determining if a patch should be "kept"
+      //      in the output based on the winding number on either side
       //  Outputs:
       //    VC  #VC by 3 list of vertex positions of boolean result mesh
       //    FC  #FC by 3 list of triangle indices into VC
       //    J  #FC list of indices into [FA;FB] revealing "birth" facet
-      //  Returns true if inputs induce a piecewise constant winding number
-      //    field and type is valid.
+      //  Returns true iff inputs induce a piecewise constant winding number
+      //    field
       //
       //  See also: mesh_boolean_cork, intersect_other,
       //  remesh_self_intersections
@@ -172,54 +98,87 @@ namespace igl
         typename DerivedFA,
         typename DerivedVB,
         typename DerivedFB,
-        typename ResolveFunc,
         typename DerivedVC,
         typename DerivedFC,
         typename DerivedJ>
       IGL_INLINE bool mesh_boolean(
-          const Eigen::PlainObjectBase<DerivedVA > & VA,
-          const Eigen::PlainObjectBase<DerivedFA > & FA,
-          const Eigen::PlainObjectBase<DerivedVB > & VB,
-          const Eigen::PlainObjectBase<DerivedFB > & FB,
-          const MeshBooleanType & type,
-        const ResolveFunc& resolve_func,
+          const Eigen::PlainObjectBase<DerivedVA> & VA,
+          const Eigen::PlainObjectBase<DerivedFA> & FA,
+          const Eigen::PlainObjectBase<DerivedVB> & VB,
+          const Eigen::PlainObjectBase<DerivedFB> & FB,
+          const std::function<int(const Eigen::Matrix<int,1,Eigen::Dynamic>) >& wind_num_op,
+          const std::function<int(const int, const int)> & keep,
           Eigen::PlainObjectBase<DerivedVC > & VC,
           Eigen::PlainObjectBase<DerivedFC > & FC,
           Eigen::PlainObjectBase<DerivedJ > & J);
-
+      //  MESH_BOOLEAN Variadic boolean operations
+      //
       //  Inputs:
-      //    VA  #VA by 3 list of vertex positions of first mesh
-      //    FA  #FA by 3 list of triangle indices into VA
-      //    VB  #VB by 3 list of vertex positions of second mesh
-      //    FB  #FB by 3 list of triangle indices into VB
-      //    type  type of boolean operation
+      //    Vlist  k-long list of lists of mesh vertex positions
+      //    Flist  k-long list of lists of mesh face indices, so that Flist[i] indexes
+      //      vertices in Vlist[i]
+      //    wind_num_op  function handle for filtering winding numbers from
+      //      n-tuples of integer values to [0,1] outside/inside values
+      //    keep  function handle for determining if a patch should be "kept"
+      //      in the output based on the winding number on either side
       //  Outputs:
       //    VC  #VC by 3 list of vertex positions of boolean result mesh
       //    FC  #FC by 3 list of triangle indices into VC
-      //    J  #FC list of indices into [FA;FB] revealing "birth" facet
-      //  Returns true if inputs induce a piecewise constant winding number
-      //  field and type is valid
+      //    J  #FC list of indices into [Flist[0];Flist[1];...;Flist[k]]
+      //      revealing "birth" facet
+      //  Returns true iff inputs induce a piecewise constant winding number
+      //    field
       //
       //  See also: mesh_boolean_cork, intersect_other,
       //  remesh_self_intersections
       template <
-        typename DerivedVA,
-        typename DerivedFA,
-        typename DerivedVB,
-        typename DerivedFB,
+        typename DerivedV,
+        typename DerivedF,
         typename DerivedVC,
         typename DerivedFC,
         typename DerivedJ>
       IGL_INLINE bool mesh_boolean(
-        const Eigen::PlainObjectBase<DerivedVA > & VA,
-        const Eigen::PlainObjectBase<DerivedFA > & FA,
-        const Eigen::PlainObjectBase<DerivedVB > & VB,
-        const Eigen::PlainObjectBase<DerivedFB > & FB,
-        const MeshBooleanType & type,
-        Eigen::PlainObjectBase<DerivedVC > & VC,
-        Eigen::PlainObjectBase<DerivedFC > & FC,
-        Eigen::PlainObjectBase<DerivedJ > & J);
-
+          const std::vector<DerivedV > & Vlist,
+          const std::vector<DerivedF > & Flist,
+          const std::function<int(const Eigen::Matrix<int,1,Eigen::Dynamic>) >& wind_num_op,
+          const std::function<int(const int, const int)> & keep,
+          Eigen::PlainObjectBase<DerivedVC > & VC,
+          Eigen::PlainObjectBase<DerivedFC > & FC,
+          Eigen::PlainObjectBase<DerivedJ > & J);
+      // Given a merged mesh (V,F) and list of sizes of inputs
+      //
+      // Inputs:
+      //   V  #V by 3 list of merged mesh vertex positions
+      //   F  #F by 3 list of merged mesh face indices so that first sizes(0)
+      //     faces come from the first input, and the next sizes(1) faces come
+      //     from the second input, and so on.
+      //   sizes  #inputs list of sizes so that sizes(i) is the #faces in the
+      //     ith input
+      //    wind_num_op  function handle for filtering winding numbers from
+      //      tuples of integer values to [0,1] outside/inside values
+      //    keep  function handle for determining if a patch should be "kept"
+      //      in the output based on the winding number on either side
+      //  Outputs:
+      //    VC  #VC by 3 list of vertex positions of boolean result mesh
+      //    FC  #FC by 3 list of triangle indices into VC
+      //    J  #FC list of birth parent indices
+      // 
+      template <
+        typename DerivedVV,
+        typename DerivedFF,
+        typename Derivedsizes,
+        typename DerivedVC,
+        typename DerivedFC,
+        typename DerivedJ>
+      IGL_INLINE bool mesh_boolean(
+          const Eigen::PlainObjectBase<DerivedVV > & VV,
+          const Eigen::PlainObjectBase<DerivedFF > & FF,
+          const Eigen::PlainObjectBase<Derivedsizes> & sizes,
+          const std::function<int(const Eigen::Matrix<int,1,Eigen::Dynamic>) >& wind_num_op,
+          const std::function<int(const int, const int)> & keep,
+          Eigen::PlainObjectBase<DerivedVC > & VC,
+          Eigen::PlainObjectBase<DerivedFC > & FC,
+          Eigen::PlainObjectBase<DerivedJ > & J);
       //  Inputs:
       //    VA  #VA by 3 list of vertex positions of first mesh
       //    FA  #FA by 3 list of triangle indices into VA

File diff suppressed because it is too large
+ 0 - 0
include/igl/copyleft/cgal/remesh_intersections.cpp


+ 1 - 0
include/igl/copyleft/cgal/remesh_self_intersections.cpp

@@ -92,4 +92,5 @@ template void igl::copyleft::cgal::remesh_self_intersections<Eigen::Matrix<doubl
 template void igl::copyleft::cgal::remesh_self_intersections<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 template void igl::copyleft::cgal::remesh_self_intersections<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<long, -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&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 template void igl::copyleft::cgal::remesh_self_intersections<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -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&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::copyleft::cgal::remesh_self_intersections<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -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<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #endif

+ 1 - 0
include/igl/cumsum.cpp

@@ -63,4 +63,5 @@ template void igl::cumsum<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matri
 template void igl::cumsum<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 template void igl::cumsum<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&);
 template void igl::cumsum<Eigen::Matrix<unsigned long, 2, 1, 0, 2, 1>, Eigen::Matrix<unsigned long, 2, 1, 0, 2, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<unsigned long, 2, 1, 0, 2, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<unsigned long, 2, 1, 0, 2, 1> >&);
+template void igl::cumsum<Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1>, Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1> >&);
 #endif

+ 3 - 2
include/igl/nchoosek.cpp

@@ -30,7 +30,7 @@ IGL_INLINE double igl::nchoosek(const int n, const int k)
 
 template < typename DerivedV, typename DerivedU>
 IGL_INLINE void igl::nchoosek(
-  const Eigen::PlainObjectBase<DerivedV> & V,
+  const Eigen::MatrixBase<DerivedV> & V,
   const int k,
   Eigen::PlainObjectBase<DerivedU> & U)
 {
@@ -68,5 +68,6 @@ IGL_INLINE void igl::nchoosek(
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
-template void igl::nchoosek<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&, int, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::nchoosek<Eigen::CwiseNullaryOp<Eigen::internal::linspaced_op<int, true>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::CwiseNullaryOp<Eigen::internal::linspaced_op<int, true>, Eigen::Matrix<int, -1, 1, 0, -1, 1> > > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::nchoosek<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&, int, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 #endif

+ 1 - 1
include/igl/nchoosek.h

@@ -32,7 +32,7 @@ namespace igl
   //     combination
   template < typename DerivedV, typename DerivedU>
   IGL_INLINE void nchoosek(
-    const Eigen::PlainObjectBase<DerivedV> & V,
+    const Eigen::MatrixBase<DerivedV> & V,
     const int k,
     Eigen::PlainObjectBase<DerivedU> & U);
 }

Some files were not shown because too many files changed in this diff