doublearea.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #include "doublearea.h"
  9. #include "edge_lengths.h"
  10. #include "parallel_for.h"
  11. #include "sort.h"
  12. #include <cassert>
  13. #include <iostream>
  14. #include <limits>
  15. template <typename DerivedV, typename DerivedF, typename DeriveddblA>
  16. IGL_INLINE void igl::doublearea(
  17. const Eigen::MatrixBase<DerivedV> & V,
  18. const Eigen::MatrixBase<DerivedF> & F,
  19. Eigen::PlainObjectBase<DeriveddblA> & dblA)
  20. {
  21. // quads are handled by a specialized function
  22. if (F.cols() == 4) return doublearea_quad(V,F,dblA);
  23. const int dim = V.cols();
  24. // Only support triangles
  25. assert(F.cols() == 3);
  26. const size_t m = F.rows();
  27. // Compute edge lengths
  28. Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 3> l;
  29. // Projected area helper
  30. const auto & proj_doublearea =
  31. [&V,&F](const int x, const int y, const int f)
  32. ->typename DerivedV::Scalar
  33. {
  34. auto rx = V(F(f,0),x)-V(F(f,2),x);
  35. auto sx = V(F(f,1),x)-V(F(f,2),x);
  36. auto ry = V(F(f,0),y)-V(F(f,2),y);
  37. auto sy = V(F(f,1),y)-V(F(f,2),y);
  38. return rx*sy - ry*sx;
  39. };
  40. switch(dim)
  41. {
  42. case 3:
  43. {
  44. dblA = DeriveddblA::Zero(m,1);
  45. for(size_t f = 0;f<m;f++)
  46. {
  47. for(int d = 0;d<3;d++)
  48. {
  49. const auto dblAd = proj_doublearea(d,(d+1)%3,f);
  50. dblA(f) += dblAd*dblAd;
  51. }
  52. }
  53. dblA = dblA.array().sqrt().eval();
  54. break;
  55. }
  56. case 2:
  57. {
  58. dblA.resize(m,1);
  59. for(size_t f = 0;f<m;f++)
  60. {
  61. dblA(f) = proj_doublearea(0,1,f);
  62. }
  63. break;
  64. }
  65. default:
  66. {
  67. edge_lengths(V,F,l);
  68. return doublearea(l,0.,dblA);
  69. }
  70. }
  71. }
  72. template <
  73. typename DerivedA,
  74. typename DerivedB,
  75. typename DerivedC,
  76. typename DerivedD>
  77. IGL_INLINE void igl::doublearea(
  78. const Eigen::MatrixBase<DerivedA> & A,
  79. const Eigen::MatrixBase<DerivedB> & B,
  80. const Eigen::MatrixBase<DerivedC> & C,
  81. Eigen::PlainObjectBase<DerivedD> & D)
  82. {
  83. assert((B.cols() == A.cols()) && "dimensions of A and B should match");
  84. assert((C.cols() == A.cols()) && "dimensions of A and C should match");
  85. assert(A.rows() == B.rows() && "corners should have same length");
  86. assert(A.rows() == C.rows() && "corners should have same length");
  87. switch(A.cols())
  88. {
  89. case 2:
  90. {
  91. // For 2d compute signed area
  92. const auto & R = A-C;
  93. const auto & S = B-C;
  94. D = (R.col(0).array()*S.col(1).array() -
  95. R.col(1).array()*S.col(0).array()).template cast<
  96. typename DerivedD::Scalar>();
  97. break;
  98. }
  99. default:
  100. {
  101. Eigen::Matrix<typename DerivedD::Scalar,DerivedD::RowsAtCompileTime,3>
  102. uL(A.rows(),3);
  103. uL.col(0) = ((B-C).rowwise().norm()).template cast<typename DerivedD::Scalar>();
  104. uL.col(1) = ((C-A).rowwise().norm()).template cast<typename DerivedD::Scalar>();
  105. uL.col(2) = ((A-B).rowwise().norm()).template cast<typename DerivedD::Scalar>();
  106. doublearea(uL,D);
  107. }
  108. }
  109. }
  110. template <
  111. typename DerivedA,
  112. typename DerivedB,
  113. typename DerivedC>
  114. IGL_INLINE typename DerivedA::Scalar igl::doublearea_single(
  115. const Eigen::MatrixBase<DerivedA> & A,
  116. const Eigen::MatrixBase<DerivedB> & B,
  117. const Eigen::MatrixBase<DerivedC> & C)
  118. {
  119. assert(A.size() == 2 && "Vertices should be 2D");
  120. assert(B.size() == 2 && "Vertices should be 2D");
  121. assert(C.size() == 2 && "Vertices should be 2D");
  122. auto r = A-C;
  123. auto s = B-C;
  124. return r(0)*s(1) - r(1)*s(0);
  125. }
  126. template <typename Derivedl, typename DeriveddblA>
  127. IGL_INLINE void igl::doublearea(
  128. const Eigen::MatrixBase<Derivedl> & ul,
  129. Eigen::PlainObjectBase<DeriveddblA> & dblA)
  130. {
  131. // Default is to leave NaNs and fire asserts in debug mode
  132. return doublearea(
  133. ul,std::numeric_limits<typename Derivedl::Scalar>::quiet_NaN(),dblA);
  134. }
  135. template <typename Derivedl, typename DeriveddblA>
  136. IGL_INLINE void igl::doublearea(
  137. const Eigen::MatrixBase<Derivedl> & ul,
  138. const typename Derivedl::Scalar nan_replacement,
  139. Eigen::PlainObjectBase<DeriveddblA> & dblA)
  140. {
  141. using namespace Eigen;
  142. using namespace std;
  143. typedef typename Derivedl::Index Index;
  144. // Only support triangles
  145. assert(ul.cols() == 3);
  146. // Number of triangles
  147. const Index m = ul.rows();
  148. Eigen::Matrix<typename Derivedl::Scalar, Eigen::Dynamic, 3> l;
  149. MatrixXi _;
  150. //
  151. // "Miscalculating Area and Angles of a Needle-like Triangle"
  152. // https://people.eecs.berkeley.edu/~wkahan/Triangle.pdf
  153. igl::sort(ul,2,false,l,_);
  154. // semiperimeters
  155. //Matrix<typename Derivedl::Scalar,Dynamic,1> s = l.rowwise().sum()*0.5;
  156. //assert((Index)s.rows() == m);
  157. // resize output
  158. dblA.resize(l.rows(),1);
  159. parallel_for(
  160. m,
  161. [&l,&dblA,&nan_replacement](const int i)
  162. {
  163. // Kahan's Heron's formula
  164. typedef typename Derivedl::Scalar Scalar;
  165. const Scalar arg =
  166. (l(i,0)+(l(i,1)+l(i,2)))*
  167. (l(i,2)-(l(i,0)-l(i,1)))*
  168. (l(i,2)+(l(i,0)-l(i,1)))*
  169. (l(i,0)+(l(i,1)-l(i,2)));
  170. dblA(i) = 2.0*0.25*sqrt(arg);
  171. // Alec: If the input edge lengths were computed from floating point
  172. // vertex positions then there's no guarantee that they fulfill the
  173. // triangle inequality (in their floating point approximations). For
  174. // nearly degenerate triangles the round-off error during side-length
  175. // computation may be larger than (or rather smaller) than the height of
  176. // the triangle. In "Lecture Notes on Geometric Robustness" Shewchuck 09,
  177. // Section 3.1 http://www.cs.berkeley.edu/~jrs/meshpapers/robnotes.pdf,
  178. // he recommends computing the triangle areas for 2D and 3D using 2D
  179. // signed areas computed with determinants.
  180. assert(
  181. (nan_replacement == nan_replacement ||
  182. (l(i,2) - (l(i,0)-l(i,1)))>=0)
  183. && "Side lengths do not obey the triangle inequality.");
  184. if(dblA(i) != dblA(i))
  185. {
  186. dblA(i) = nan_replacement;
  187. }
  188. assert(dblA(i) == dblA(i) && "DOUBLEAREA() PRODUCED NaN");
  189. },
  190. 1000l);
  191. }
  192. template <typename DerivedV, typename DerivedF, typename DeriveddblA>
  193. IGL_INLINE void igl::doublearea_quad(
  194. const Eigen::MatrixBase<DerivedV> & V,
  195. const Eigen::MatrixBase<DerivedF> & F,
  196. Eigen::PlainObjectBase<DeriveddblA> & dblA)
  197. {
  198. assert(V.cols() == 3); // Only supports points in 3D
  199. assert(F.cols() == 4); // Only support quads
  200. const size_t m = F.rows();
  201. // Split the quads into triangles
  202. Eigen::MatrixXi Ft(F.rows()*2,3);
  203. for(size_t i=0; i<m;++i)
  204. {
  205. Ft.row(i*2 ) << F(i,0), F(i,1), F(i,2);
  206. Ft.row(i*2 + 1) << F(i,2), F(i,3), F(i,0);
  207. }
  208. // Compute areas
  209. Eigen::VectorXd doublearea_tri;
  210. igl::doublearea(V,Ft,doublearea_tri);
  211. dblA.resize(F.rows(),1);
  212. for(unsigned i=0; i<F.rows();++i)
  213. {
  214. dblA(i) = doublearea_tri(i*2) + doublearea_tri(i*2 + 1);
  215. }
  216. }
  217. #ifdef IGL_STATIC_LIBRARY
  218. // Explicit template instantiation
  219. template void igl::doublearea<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  220. template void igl::doublearea<Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  221. template void igl::doublearea<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> > const&, Eigen::Matrix<double, -1, -1, 1, -1, -1>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  222. template void igl::doublearea<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&);
  223. template void igl::doublearea<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  224. template void igl::doublearea<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&);
  225. template void igl::doublearea<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&);
  226. template void igl::doublearea<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  227. template void igl::doublearea<Eigen::Matrix<float, 1, 3, 1, 1, 3>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 1, 0, 1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&);
  228. template void igl::doublearea<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&);
  229. template void igl::doublearea<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  230. template void igl::doublearea<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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, 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<double, -1, 1, 0, -1, 1> >&);
  231. template void igl::doublearea<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&);
  232. template void igl::doublearea<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  233. template void igl::doublearea<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  234. template void igl::doublearea<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, -1, 1, -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<unsigned int, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  235. template void igl::doublearea<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, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  236. template void igl::doublearea<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  237. 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::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> >&);
  238. 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::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  239. 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::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  240. template void igl::doublearea<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, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  241. template void igl::doublearea<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, 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, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&);
  242. template void igl::doublearea<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  243. template void igl::doublearea<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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, 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<double, -1, -1, 0, -1, -1> >&);
  244. template void igl::doublearea<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
  245. template Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar igl::doublearea_single<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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&);
  246. 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::MatrixBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const&);
  247. #endif