ソースを参照

Merge branch 'master' of https://github.com/olkido/libigl

Conflicts:
	include/igl/barycenter.cpp
	include/igl/n_polyvector_general.cpp
	include/igl/slice.cpp

Former-commit-id: eafd126a5c3c93bb1e6c45f8ee1e501167d01f2f
Olga Diamanti 10 年 前
コミット
3fb6d13c05

+ 5 - 2
build/Makefile

@@ -29,6 +29,9 @@ endif
 ifeq ($(IGL_WITH_EMBREE),1)
 	EXTRAS += embree
 endif
+ifeq ($(IGL_WITH_COMISO),1)
+	EXTRAS += comiso
+endif
 ifeq ($(IGL_WITH_MATLAB),1)
 	EXTRAS += matlab
 endif
@@ -66,7 +69,7 @@ extras:
 
 
 #############################################################################
-# SOURCE 
+# SOURCE
 #############################################################################
 CPP_FILES=$(wildcard ../include/igl/*.cpp)
 H_FILES=$(wildcard ../include/igl/*.h)
@@ -97,7 +100,7 @@ INC+=$(ANTTWEAKBAR_INC)
 #LIB+=-framework AppKit
 
 .PHONY: obj
-obj: 
+obj:
 	mkdir -p obj
 
 ../lib/libigl.a: obj $(OBJ_FILES)

+ 2 - 0
build/Makefile.conf

@@ -112,6 +112,8 @@ endif
 
 ifeq ($(IGL_USERNAME),olkido)
     IGL_WITH_MATLAB=0
+		IGL_WITH_COMISO=1
+		COMISO=/Users/olkido/Documents/igl/MIQ/src/CoMISo
 	  IGL_WITH_XML=1
     AFLAGS= -m64
     IGL_WITH_EMBREE=1

+ 44 - 0
build/Makefile_comiso

@@ -0,0 +1,44 @@
+include Makefile.conf
+
+.PHONY: all
+all: libiglcomiso
+debug: libiglcomiso
+
+include Makefile.conf
+all: CFLAGS += -O3 -DNDEBUG -std=c++11
+debug: CFLAGS += -g -Wall -std=c++11
+CFLAGS += -DINCLUDE_TEMPLATES
+
+.PHONY: libiglcomiso
+libiglcomiso: obj ../lib/libiglcomiso.a
+
+SRC_DIR=../include/igl/comiso/
+CPP_FILES=$(wildcard $(SRC_DIR)*.cpp)
+OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
+
+# include igl headers
+INC+=-I../include/
+
+# EXPECTS THAT CFLAGS IS ALREADY SET APPROPRIATELY
+
+# Eigen dependency
+EIGEN3_INC=-I$(DEFAULT_PREFIX)/include/eigen3 -I$(DEFAULT_PREFIX)/include/eigen3/unsupported
+INC+=$(EIGEN3_INC)
+
+# comiso dependency
+COMISO_INC=-I$(COMISO)/ -I$(COMISO)/gmm/include -I$(COMISO)/../
+INC+=$(COMISO_INC)
+
+obj:
+	mkdir -p obj
+
+../lib/libiglcomiso.a: $(OBJ_FILES)
+	rm -f $@
+	ar cqs $@ $(OBJ_FILES)
+
+obj/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
+	g++ $(AFLAGS) $(OPENMP) $(CFLAGS) -c -o $@ $< $(INC)
+
+clean:
+	rm -f $(OBJ_FILES)
+	rm -f ../lib/libiglcomiso.a

+ 5 - 4
include/igl/barycenter.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
-// 
-// 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/.
 #include "barycenter.h"
 
@@ -38,4 +38,5 @@ template void igl::barycenter<Eigen::Matrix<double, -1, 4, 0, -1, 4>, Eigen::Mat
 template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(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, 3, 0, -1, 3> >&);
 template void igl::barycenter<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, -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> >&);
 template void igl::barycenter<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
+template void igl::barycenter<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif

+ 2 - 0
include/igl/comb_cross_field.cpp

@@ -10,6 +10,7 @@
 
 #include <vector>
 #include <deque>
+#include <Eigen/Geometry>
 #include "per_face_normals.h"
 #include "is_border_vertex.h"
 #include "rotation_matrix_from_directions.h"
@@ -142,4 +143,5 @@ IGL_INLINE void igl::comb_cross_field(const Eigen::PlainObjectBase<DerivedV> &V,
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
+template void igl::comb_cross_field<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
 #endif

+ 12 - 13
include/igl/comb_frame_field.cpp

@@ -24,7 +24,7 @@ IGL_INLINE void igl::comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
 
   PD1_combed.resize(BIS1_combed.rows(),3);
   PD2_combed.resize(BIS2_combed.rows(),3);
-  
+
   for (unsigned i=0; i<PD1.rows();++i)
   {
     Eigen::Matrix<typename DerivedP::Scalar,4,3> DIRs;
@@ -33,12 +33,12 @@ IGL_INLINE void igl::comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
     -PD1.row(i),
     PD2.row(i),
     -PD2.row(i);
-    
+
     std::vector<double> a(4);
-    
-    
+
+
     double a_combed = atan2(B2.row(i).dot(BIS1_combed.row(i)),B1.row(i).dot(BIS1_combed.row(i)));
-    
+
     // center on the combed sector center
     for (unsigned j=0;j<4;++j)
     {
@@ -49,28 +49,27 @@ IGL_INLINE void igl::comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
       a[j] = fmod(a[j], (M_PI*2.));
     }
     // now the max is u and the min is v
-    
+
     int m = std::min_element(a.begin(),a.end())-a.begin();
     int M = std::max_element(a.begin(),a.end())-a.begin();
-    
+
     assert(
            ((m>=0 && m<=1) && (M>=2 && M<=3))
            ||
            ((m>=2 && m<=3) && (M>=0 && M<=1))
            );
-    
+
     PD1_combed.row(i) = DIRs.row(m);
     PD2_combed.row(i) = DIRs.row(M);
-    
+
   }
-  
-  
+
+
   //    PD1_combed = BIS1_combed;
   //    PD2_combed = BIS2_combed;
 }
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
+template void igl::comb_frame_field<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
 #endif
-
-

+ 4 - 4
include/igl/comb_frame_field.h

@@ -8,7 +8,7 @@
 
 #ifndef IGL_COMB_FRAME_FIELD_H
 #define IGL_COMB_FRAME_FIELD_H
-#include "igl_inline.h"
+#include <igl/igl_inline.h>
 #include <Eigen/Core>
 namespace igl
 {
@@ -16,7 +16,7 @@ namespace igl
   // and generates a combed frame field defined on the mesh faces. This makes use of a
   // combed cross field generated by combing the field created by the bisectors of the
   // frame field.
-  
+
   // Inputs:
   //   V            #V by 3 eigen Matrix of mesh vertex 3D positions
   //   F            #F by 4 eigen Matrix of face (quad) indices
@@ -28,8 +28,8 @@ namespace igl
   //   PD1_combed  #F by 3 eigen Matrix of the first combed cross field vector
   //   PD2_combed  #F by 3 eigen Matrix of the second combed cross field vector
   //
-  
-  
+
+
   template <typename DerivedV, typename DerivedF, typename DerivedP>
   IGL_INLINE void comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
                                         const Eigen::PlainObjectBase<DerivedF> &F,

+ 23 - 6
include/igl/comiso/frame_field.cpp

@@ -199,15 +199,32 @@ void FrameInterpolator::interpolateCross()
   using namespace std;
   using namespace Eigen;
 
-  NRosyField nrosy(V,F);
-
+  //olga: was
+  // NRosyField nrosy(V,F);
+  // for (unsigned i=0; i<F.rows(); ++i)
+    // if(thetas_c[i])
+      // nrosy.setConstraintHard(i,theta2vector(TPs[i],thetas(i)));
+  // nrosy.solve(4);
+  // MatrixXd R = nrosy.getFieldPerFace();
+
+  //olga: is
+  Eigen::MatrixXd R;
+  Eigen::VectorXd S;
+  Eigen::VectorXi b; b.resize(F.rows(),1);
+  Eigen::MatrixXd bc; bc.resize(F.rows(),3);
+  int num = 0;
   for (unsigned i=0; i<F.rows(); ++i)
     if(thetas_c[i])
-      nrosy.setConstraintHard(i,theta2vector(TPs[i],thetas(i)));
-
-  nrosy.solve(4);
+      {
+        b[num] = i;
+        bc.row(num) = theta2vector(TPs[i],thetas(i));
+        num++;
+      }
+  b.conservativeResize(num,Eigen::NoChange);
+  bc.conservativeResize(num,Eigen::NoChange);
 
-  MatrixXd R = nrosy.getFieldPerFace();
+  igl::nrosy(V, F, b, bc, 4, R, S);
+  //olga:end
   assert(R.rows() == F.rows());
 
   for (unsigned i=0; i<F.rows(); ++i)

+ 1 - 0
include/igl/comiso/frame_field.h

@@ -8,6 +8,7 @@
 #ifndef IGL_FRAMEFIELD_H
 #define IGL_FRAMEFIELD_H
 
+#include <igl/igl_inline.h>
 #include <Eigen/Dense>
 #include <vector>
 

+ 9 - 8
include/igl/comiso/miq.cpp

@@ -27,6 +27,7 @@
 //
 #include <igl/cross_field_missmatch.h>
 #include <igl/comb_frame_field.h>
+#include <igl/comb_cross_field.h>
 #include <igl/cut_mesh_from_singularities.h>
 #include <igl/find_cross_field_singularities.h>
 #include <igl/compute_frame_field_bisectors.h>
@@ -2228,13 +2229,13 @@ IGL_INLINE void igl::miq(const Eigen::PlainObjectBase<DerivedV> &V,
                          std::vector<int> roundVertices,
                          std::vector<std::vector<int> > hardFeatures)
 {
-  Eigen::MatrixXd PD2i = PD2;
-  if (PD2i.size() == 0)
-  {
-    Eigen::MatrixXd B1, B2, B3;
-    igl::local_basis(V,F,B1,B2,B3);
-    PD2i = igl::rotate_vectors(V,Eigen::VectorXd::Constant(1,M_PI/2),B1,B2);
-  }
+  // Eigen::MatrixXd PD2i = PD2;
+  // if (PD2i.size() == 0)
+  // {
+    // Eigen::MatrixXd B1, B2, B3;
+    // igl::local_basis(V,F,B1,B2,B3);
+    // PD2i = igl::rotate_vectors(V,Eigen::VectorXd::Constant(1,M_PI/2),B1,B2);
+  // }
 
   Eigen::PlainObjectBase<DerivedV> BIS1, BIS2;
   igl::compute_frame_field_bisectors(V, F, PD1, PD2, BIS1, BIS2);
@@ -2277,5 +2278,5 @@ IGL_INLINE void igl::miq(const Eigen::PlainObjectBase<DerivedV> &V,
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
-template void igl::mixed_integer_quadrangulate<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 2, 0, -1, 2> >(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<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, double, double, bool, int, int, bool, std::__1::vector<int, std::__1::allocator<int> >, std::__1::vector<std::__1::vector<int, std::__1::allocator<int> >, std::__1::allocator<std::__1::vector<int, std::__1::allocator<int> > > >);
+template void igl::miq<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 2, 0, -1, 2> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&, double, double, bool, int, int, bool, std::__1::vector<int, std::__1::allocator<int> >, std::__1::vector<std::__1::vector<int, std::__1::allocator<int> >, std::__1::allocator<std::__1::vector<int, std::__1::allocator<int> > > >);
 #endif

+ 28 - 0
include/igl/comiso/nrosy.cpp

@@ -901,3 +901,31 @@ IGL_INLINE void igl::nrosy(
   // Extract singularity indices
   S = solver.getSingularityIndexPerVertex();
 }
+
+
+IGL_INLINE void igl::nrosy(
+                           const Eigen::MatrixXd& V,
+                           const Eigen::MatrixXi& F,
+                           const Eigen::VectorXi& b,
+                           const Eigen::MatrixXd& bc,
+                           const int N,
+                           Eigen::MatrixXd& R,
+                           Eigen::VectorXd& S
+                           )
+{
+  // Init solver
+  igl::NRosyField solver(V,F);
+
+  // Add hard constraints
+  for (unsigned i=0; i<b.size();++i)
+    solver.setConstraintHard(b(i),bc.row(i));
+
+  // Interpolate
+  solver.solve(N);
+
+  // Copy the result back
+  R = solver.getFieldPerFace();
+
+  // Extract singularity indices
+  S = solver.getSingularityIndexPerVertex();
+}

+ 13 - 0
include/igl/comiso/nrosy.h

@@ -12,6 +12,7 @@
 #include <Eigen/Core>
 #include <Eigen/Sparse>
 #include <vector>
+#include <igl/igl_inline.h>
 
 namespace igl
 {
@@ -46,6 +47,18 @@ IGL_INLINE void nrosy(
   Eigen::MatrixXd& R,
   Eigen::VectorXd& S
   );
+
+//wrapper for the case without soft constraints
+IGL_INLINE void nrosy(
+ const Eigen::MatrixXd& V,
+ const Eigen::MatrixXi& F,
+ const Eigen::VectorXi& b,
+ const Eigen::MatrixXd& bc,
+ const int N,
+ Eigen::MatrixXd& R,
+ Eigen::VectorXd& S
+  );
+
 }
 
 #ifndef IGL_STATIC_LIBRARY

+ 6 - 5
include/igl/compute_frame_field_bisectors.cpp

@@ -22,7 +22,7 @@ IGL_INLINE void igl::compute_frame_field_bisectors(
 {
   BIS1.resize(PD1.rows(),3);
   BIS2.resize(PD1.rows(),3);
-  
+
   for (unsigned i=0; i<PD1.rows();++i)
   {
     // project onto the tangent plane and convert to angle
@@ -37,7 +37,7 @@ IGL_INLINE void igl::compute_frame_field_bisectors(
     a2 += ceil (std::max(0., -a2) / (M_PI*2.)) * (M_PI*2.);
     //take modulo 2pi
     a2 = fmod(a2, (M_PI*2.));
-    
+
     double b1 = (a1+a2)/2.0;
     //make it positive by adding some multiple of 2pi
     b1 += ceil (std::max(0., -b1) / (M_PI*2.)) * (M_PI*2.);
@@ -49,10 +49,10 @@ IGL_INLINE void igl::compute_frame_field_bisectors(
     b2 += ceil (std::max(0., -b2) / (M_PI*2.)) * (M_PI*2.);
     //take modulo 2pi
     b2 = fmod(b2, (M_PI*2.));
-    
+
     BIS1.row(i) = cos(b1) * B1.row(i) + sin(b1) * B2.row(i);
     BIS2.row(i) = cos(b2) * B1.row(i) + sin(b2) * B2.row(i);
-    
+
   }
 }
 
@@ -67,11 +67,12 @@ IGL_INLINE void igl::compute_frame_field_bisectors(
 {
   Eigen::PlainObjectBase<DerivedV> B1, B2, B3;
   igl::local_basis(V,F,B1,B2,B3);
-  
+
   compute_frame_field_bisectors( V, F, B1, B2, PD1, PD2, BIS1, BIS2);
 
 }
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
+template void igl::compute_frame_field_bisectors<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
 #endif

+ 1 - 0
include/igl/cross_field_missmatch.cpp

@@ -132,4 +132,5 @@ IGL_INLINE void igl::cross_field_missmatch(const Eigen::PlainObjectBase<DerivedV
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
+template void igl::cross_field_missmatch<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
 #endif

+ 3 - 0
include/igl/cut_mesh_from_singularities.cpp

@@ -8,6 +8,8 @@
 
 #include "cut_mesh_from_singularities.h"
 
+#include <igl/triangle_triangle_adjacency.h>
+
 #include <vector>
 #include <deque>
 
@@ -185,4 +187,5 @@ IGL_INLINE void igl::cut_mesh_from_singularities(const Eigen::PlainObjectBase<De
 }
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
+template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > 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, 3, 0, -1, 3> >&);
 #endif

+ 18 - 17
include/igl/doublearea.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
-// 
-// 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/.
 #include "doublearea.h"
 #include "edge_lengths.h"
@@ -12,9 +12,9 @@
 #include <iostream>
 
 template <typename DerivedV, typename DerivedF, typename DeriveddblA>
-IGL_INLINE void igl::doublearea( 
-  const Eigen::PlainObjectBase<DerivedV> & V, 
-  const Eigen::PlainObjectBase<DerivedF> & F, 
+IGL_INLINE void igl::doublearea(
+  const Eigen::PlainObjectBase<DerivedV> & V,
+  const Eigen::PlainObjectBase<DerivedF> & F,
   Eigen::PlainObjectBase<DeriveddblA> & dblA)
 {
   const int dim = V.cols();
@@ -27,7 +27,7 @@ IGL_INLINE void igl::doublearea(
   // http://www.cs.berkeley.edu/~jrs/meshpapers/robnotes.pdf
 
   // Projected area helper
-  const auto & proj_doublearea = 
+  const auto & proj_doublearea =
     [&V,&F](const int x, const int y, const int f)->double
   {
     auto rx = V(F(f,0),x)-V(F(f,2),x);
@@ -47,7 +47,7 @@ IGL_INLINE void igl::doublearea(
         for(int d = 0;d<3;d++)
         {
           double dblAd = proj_doublearea(d,(d+1)%3,f);
-          dblA[f] += dblAd*dblAd;
+          dblA(f) += dblAd*dblAd;
         }
       }
       dblA = dblA.array().sqrt().eval();
@@ -75,9 +75,9 @@ template <
   typename DerivedB,
   typename DerivedC,
   typename DerivedD>
-IGL_INLINE void doublearea( 
-  const Eigen::PlainObjectBase<DerivedA> & A, 
-  const Eigen::PlainObjectBase<DerivedB> & B, 
+IGL_INLINE void doublearea(
+  const Eigen::PlainObjectBase<DerivedA> & A,
+  const Eigen::PlainObjectBase<DerivedB> & B,
   const Eigen::PlainObjectBase<DerivedC> & C,
   Eigen::PlainObjectBase<DerivedD> & D)
 {
@@ -96,8 +96,8 @@ template <
   typename DerivedB,
   typename DerivedC>
 IGL_INLINE typename DerivedA::Scalar igl::doublearea_single(
-  const Eigen::PlainObjectBase<DerivedA> & A, 
-  const Eigen::PlainObjectBase<DerivedB> & B, 
+  const Eigen::PlainObjectBase<DerivedA> & A,
+  const Eigen::PlainObjectBase<DerivedB> & B,
   const Eigen::PlainObjectBase<DerivedC> & C)
 {
   auto r = A-C;
@@ -106,7 +106,7 @@ IGL_INLINE typename DerivedA::Scalar igl::doublearea_single(
 }
 
 template <typename Derivedl, typename DeriveddblA>
-IGL_INLINE void igl::doublearea( 
+IGL_INLINE void igl::doublearea(
   const Eigen::PlainObjectBase<Derivedl> & ul,
   Eigen::PlainObjectBase<DeriveddblA> & dblA)
 {
@@ -127,12 +127,12 @@ IGL_INLINE void igl::doublearea(
   for(int i = 0;i<m;i++)
   {
     //// Heron's formula for area
-    //const typename Derivedl::Scalar arg = 
+    //const typename Derivedl::Scalar arg =
     //  s(i)*(s(i)-l(i,0))*(s(i)-l(i,1))*(s(i)-l(i,2));
     //assert(arg>=0);
     //dblA(i) = 2.0*sqrt(arg);
     // Kahan's Heron's formula
-    const typename Derivedl::Scalar arg = 
+    const typename Derivedl::Scalar arg =
       (l(i,0)+(l(i,1)+l(i,2)))*
       (l(i,2)-(l(i,0)-l(i,1)))*
       (l(i,2)+(l(i,0)-l(i,1)))*
@@ -155,4 +155,5 @@ template void igl::doublearea<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::M
 template void igl::doublearea<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 void igl::doublearea<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 template Eigen::Matrix<double, 2, 1, 0, 2, 1>::Scalar igl::doublearea_single<Eigen::Matrix<double, 2, 1, 0, 2, 1>, Eigen::Matrix<double, 2, 1, 0, 2, 1>, Eigen::Matrix<double, 2, 1, 0, 2, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const&);
+template void igl::doublearea<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 #endif

+ 8 - 7
include/igl/false_barycentric_subdivision.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
-// 
-// 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/.
 #include "false_barycentric_subdivision.h"
 
@@ -13,9 +13,9 @@
 
 template <typename Scalar, typename Index>
 IGL_INLINE void igl::false_barycentric_subdivision(
-    const Eigen::PlainObjectBase<Scalar> & V, 
-    const Eigen::PlainObjectBase<Index> & F, 
-    Eigen::PlainObjectBase<Scalar> & VD, 
+    const Eigen::PlainObjectBase<Scalar> & V,
+    const Eigen::PlainObjectBase<Index> & F,
+    Eigen::PlainObjectBase<Scalar> & VD,
     Eigen::PlainObjectBase<Index> & FD)
 {
   using namespace Eigen;
@@ -54,4 +54,5 @@ IGL_INLINE void igl::false_barycentric_subdivision(
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
+template void igl::false_barycentric_subdivision<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
 #endif

+ 1 - 0
include/igl/find_cross_field_singularities.cpp

@@ -75,4 +75,5 @@ IGL_INLINE void igl::find_cross_field_singularities(const Eigen::PlainObjectBase
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
+template void igl::find_cross_field_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #endif

+ 0 - 1
include/igl/n_polyvector_general.cpp

@@ -14,7 +14,6 @@
 #include <igl/polyroots.h>
 #include <Eigen/Sparse>
 #include <Eigen/Geometry>
-
 #include <iostream>
 
 namespace igl {

+ 3 - 2
include/igl/principal_curvature.cpp

@@ -418,8 +418,8 @@ IGL_INLINE void CurvatureCalculator::finalEigenStuff (int i, std::vector<Eigen::
   v2global.normalize();
 
   v1global *= c_val(0);
-  v2global *= c_val(1);  
-  
+  v2global *= c_val(1);
+
   if (c_val[0] > c_val[1])
   {
     curv[i]=std::vector<double>(2);
@@ -849,4 +849,5 @@ IGL_INLINE void igl::principal_curvature(
 // Explicit template specialization
 // generated by autoexplicit.sh
 template void igl::principal_curvature<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<double, -1, -1, 0, -1, -1>, 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&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, unsigned int, bool);
+template void igl::principal_curvature<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, unsigned int, bool);
 #endif

+ 6 - 5
include/igl/rotation_matrix_from_directions.cpp

@@ -7,6 +7,7 @@
 // obtain one at http://mozilla.org/MPL/2.0/.
 
 #include "rotation_matrix_from_directions.h"
+#include <Eigen/Geometry>
 
 template <typename Scalar>
 IGL_INLINE Eigen::Matrix<Scalar, 3, 3> igl::rotation_matrix_from_directions(Eigen::Matrix<Scalar, 3, 1> v0,
@@ -27,12 +28,12 @@ IGL_INLINE Eigen::Matrix<Scalar, 3, 3> igl::rotation_matrix_from_directions(Eige
     rotM = Eigen::Matrix<Scalar, 3, 3>::Identity();
     return rotM;
   }
-  
+
   ///find the axis of rotation
   Eigen::Matrix<Scalar, 3, 1> axis;
   axis=v0.cross(v1);
   axis.normalize();
-  
+
   ///construct rotation matrix
   Scalar u=axis(0);
   Scalar v=axis(1);
@@ -40,7 +41,7 @@ IGL_INLINE Eigen::Matrix<Scalar, 3, 3> igl::rotation_matrix_from_directions(Eige
   Scalar phi=acos(dot);
   Scalar rcos = cos(phi);
   Scalar rsin = sin(phi);
-  
+
   rotM(0,0) =      rcos + u*u*(1-rcos);
   rotM(1,0) =  w * rsin + v*u*(1-rcos);
   rotM(2,0) = -v * rsin + w*u*(1-rcos);
@@ -50,11 +51,11 @@ IGL_INLINE Eigen::Matrix<Scalar, 3, 3> igl::rotation_matrix_from_directions(Eige
   rotM(0,2) =  v * rsin + u*w*(1-rcos);
   rotM(1,2) = -u * rsin + v*w*(1-rcos);
   rotM(2,2) =      rcos + w*w*(1-rcos);
-  
+
   return rotM;
 }
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
+template Eigen::Matrix<double, 3, 3, 0, 3, 3> igl::rotation_matrix_from_directions<double>(Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, bool);
 #endif
-

+ 1 - 1
include/igl/slice.cpp

@@ -201,6 +201,6 @@ template void igl::slice<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::Matri
 template void igl::slice<Eigen::SparseMatrix<double, 0, int> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int, Eigen::SparseMatrix<double, 0, int>&);
 template Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > igl::slice<Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
 template Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > igl::slice<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int);
-template void igl::slice<Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::Matrix<double, -1, 3, 0, -1, 3> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int, Eigen::Matrix<double, -1, 3, 0, -1, 3>&);
 template void igl::slice<std::__1::complex<double> >(Eigen::SparseMatrix<std::__1::complex<double>, 0, int> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, Eigen::SparseMatrix<std::__1::complex<double>, 0, int>&);
+template void igl::slice<Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::Matrix<double, -1, 3, 0, -1, 3> const&, Eigen::Matrix<int, -1, 1, 0, -1, 1> const&, int, Eigen::Matrix<double, -1, 3, 0, -1, 3>&);
 #endif

+ 1 - 0
include/igl/triangle_triangle_adjacency.cpp

@@ -104,4 +104,5 @@ template void igl::triangle_triangle_adjacency<Eigen::Matrix<double, -1, -1, 0,
 // generated by autoexplicit.sh
 template void igl::triangle_triangle_adjacency<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
 template void igl::triangle_triangle_adjacency<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<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::triangle_triangle_adjacency<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
 #endif