sort_triangles.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  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 "sort_triangles.h"
  9. #include "barycenter.h"
  10. #include "sort.h"
  11. #include "sortrows.h"
  12. #include "slice.h"
  13. #include "round.h"
  14. #include "colon.h"
  15. #include "matlab_format.h"
  16. #include <iostream>
  17. template <
  18. typename DerivedV,
  19. typename DerivedF,
  20. typename DerivedMV,
  21. typename DerivedP,
  22. typename DerivedFF,
  23. typename DerivedI>
  24. IGL_INLINE void igl::sort_triangles(
  25. const Eigen::PlainObjectBase<DerivedV> & V,
  26. const Eigen::PlainObjectBase<DerivedF> & F,
  27. const Eigen::PlainObjectBase<DerivedMV> & MV,
  28. const Eigen::PlainObjectBase<DerivedP> & P,
  29. Eigen::PlainObjectBase<DerivedFF> & FF,
  30. Eigen::PlainObjectBase<DerivedI> & I)
  31. {
  32. using namespace Eigen;
  33. using namespace std;
  34. // Barycenter, centroid
  35. Eigen::Matrix<typename DerivedV::Scalar, DerivedF::RowsAtCompileTime,1> D,sD;
  36. Eigen::Matrix<typename DerivedV::Scalar, DerivedF::RowsAtCompileTime,4> BC,PBC;
  37. barycenter(V,F,BC);
  38. D = BC*(MV.transpose()*P.transpose().eval().col(2));
  39. sort(D,1,false,sD,I);
  40. //// Closest corner
  41. //Eigen::Matrix<typename DerivedV::Scalar, DerivedF::RowsAtCompileTime,1> D,sD;
  42. //D.setConstant(F.rows(),1,-1e26);
  43. //for(int c = 0;c<3;c++)
  44. //{
  45. // Eigen::Matrix<typename DerivedV::Scalar, DerivedF::RowsAtCompileTime,4> C;
  46. // Eigen::Matrix<typename DerivedV::Scalar, DerivedF::RowsAtCompileTime,1> DC;
  47. // C.resize(F.rows(),4);
  48. // for(int f = 0;f<F.rows();f++)
  49. // {
  50. // C(f,0) = V(F(f,c),0);
  51. // C(f,1) = V(F(f,c),1);
  52. // C(f,2) = V(F(f,c),2);
  53. // C(f,3) = 1;
  54. // }
  55. // DC = C*(MV.transpose()*P.transpose().eval().col(2));
  56. // D = (DC.array()>D.array()).select(DC,D).eval();
  57. //}
  58. //sort(D,1,false,sD,I);
  59. //// Closest corner with tie breaks
  60. //Eigen::Matrix<typename DerivedV::Scalar, DerivedF::RowsAtCompileTime,3> D,sD,ssD;
  61. //D.resize(F.rows(),3);
  62. //for(int c = 0;c<3;c++)
  63. //{
  64. // Eigen::Matrix<typename DerivedV::Scalar, DerivedF::RowsAtCompileTime,4> C;
  65. // C.resize(F.rows(),4);
  66. // for(int f = 0;f<F.rows();f++)
  67. // {
  68. // C(f,0) = V(F(f,c),0);
  69. // C(f,1) = V(F(f,c),1);
  70. // C(f,2) = V(F(f,c),2);
  71. // C(f,3) = 1;
  72. // }
  73. // D.col(c) = C*(MV.transpose()*P.transpose().eval().col(2));
  74. //}
  75. //VectorXi _;
  76. //sort(D,2,false,sD,_);
  77. //sortrows(sD,false,ssD,I);
  78. slice(F,I,1,FF);
  79. }
  80. #ifndef IGL_NO_OPENGL
  81. #include "OpenGL_convenience.h"
  82. template <
  83. typename DerivedV,
  84. typename DerivedF,
  85. typename DerivedFF,
  86. typename DerivedI>
  87. void igl::sort_triangles(
  88. const Eigen::PlainObjectBase<DerivedV> & V,
  89. const Eigen::PlainObjectBase<DerivedF> & F,
  90. Eigen::PlainObjectBase<DerivedFF> & FF,
  91. Eigen::PlainObjectBase<DerivedI> & I)
  92. {
  93. using namespace Eigen;
  94. using namespace std;
  95. // Put model, projection, and viewport matrices into double arrays
  96. Matrix4d MV;
  97. Matrix4d P;
  98. glGetDoublev(GL_MODELVIEW_MATRIX, MV.data());
  99. glGetDoublev(GL_PROJECTION_MATRIX, P.data());
  100. if(V.cols() == 3)
  101. {
  102. Matrix<typename DerivedV::Scalar, DerivedV::RowsAtCompileTime,4> hV;
  103. hV.resize(V.rows(),4);
  104. hV.block(0,0,V.rows(),V.cols()) = V;
  105. hV.col(3).setConstant(1);
  106. return sort_triangles(hV,F,MV,P,FF,I);
  107. }else
  108. {
  109. return sort_triangles(V,F,MV,P,FF,I);
  110. }
  111. }
  112. #include "project.h"
  113. #include <iostream>
  114. template <
  115. typename DerivedV,
  116. typename DerivedF,
  117. typename DerivedFF,
  118. typename DerivedI>
  119. void igl::sort_triangles_slow(
  120. const Eigen::PlainObjectBase<DerivedV> & V,
  121. const Eigen::PlainObjectBase<DerivedF> & F,
  122. Eigen::PlainObjectBase<DerivedFF> & FF,
  123. Eigen::PlainObjectBase<DerivedI> & I)
  124. {
  125. using namespace Eigen;
  126. using namespace std;
  127. // Barycenter, centroid
  128. Eigen::Matrix<typename DerivedV::Scalar, DerivedF::RowsAtCompileTime,1> D,sD;
  129. Eigen::Matrix<typename DerivedV::Scalar, DerivedF::RowsAtCompileTime,3> BC;
  130. D.resize(F.rows(),3);
  131. barycenter(V,F,BC);
  132. for(int f = 0;f<F.rows();f++)
  133. {
  134. Eigen::Matrix<typename DerivedV::Scalar, 3,1> bc,pbc;
  135. bc = BC.row(f);
  136. project(bc,pbc);
  137. D(f) = pbc(2);
  138. }
  139. sort(D,1,false,sD,I);
  140. slice(F,I,1,FF);
  141. }
  142. #include "EPS.h"
  143. #include <functional>
  144. #include <algorithm>
  145. static int tough_count = 0;
  146. template <typename Vec3>
  147. class Triangle
  148. {
  149. public:
  150. static inline bool z_comp(const Vec3 & A, const Vec3 & B)
  151. {
  152. return A(2) > B(2);
  153. }
  154. static typename Vec3::Scalar ZERO()
  155. {
  156. return igl::EPS<typename Vec3::Scalar>();
  157. return 0;
  158. }
  159. public:
  160. int id;
  161. // Sorted projected coners: c[0] has smallest z value
  162. Vec3 c[3];
  163. Vec3 n;
  164. public:
  165. Triangle():id(-1) { };
  166. Triangle(int id, const Vec3 c0, const Vec3 c1, const Vec3 c2):
  167. id(id)
  168. {
  169. using namespace std;
  170. c[0] = c0;
  171. c[1] = c1;
  172. c[2] = c2;
  173. sort(c,c+3,Triangle<Vec3>::z_comp);
  174. // normal pointed toward viewpoint
  175. n = (c0-c1).cross(c2-c0);
  176. if(n(2) < 0)
  177. {
  178. n *= -1.0;
  179. }
  180. // Avoid NaNs
  181. typename Vec3::Scalar len = n.norm();
  182. if(len == 0)
  183. {
  184. cout<<"avoid NaN"<<endl;
  185. assert(false);
  186. len = 1;
  187. }
  188. n /= len;
  189. };
  190. typename Vec3::Scalar project(const Vec3 & r) const
  191. {
  192. //return n.dot(r-c[2]);
  193. int closest = -1;
  194. typename Vec3::Scalar min_dist = 1e26;
  195. for(int ci = 0;ci<3;ci++)
  196. {
  197. typename Vec3::Scalar dist = (c[ci]-r).norm();
  198. if(dist < min_dist)
  199. {
  200. min_dist = dist;
  201. closest = ci;
  202. }
  203. }
  204. assert(closest>=0);
  205. return n.dot(r-c[closest]);
  206. }
  207. // Z-values of this are < z-values of that
  208. bool is_completely_behind(const Triangle & that) const
  209. {
  210. const typename Vec3::Scalar ac0 = that.c[0](2);
  211. const typename Vec3::Scalar ac1 = that.c[1](2);
  212. const typename Vec3::Scalar ac2 = that.c[2](2);
  213. const typename Vec3::Scalar ic0 = this->c[0](2);
  214. const typename Vec3::Scalar ic1 = this->c[1](2);
  215. const typename Vec3::Scalar ic2 = this->c[2](2);
  216. return
  217. (ic0 < ac2 && ic1 <= ac2 && ic2 <= ac2) ||
  218. (ic0 <= ac2 && ic1 < ac2 && ic2 <= ac2) ||
  219. (ic0 <= ac2 && ic1 <= ac2 && ic2 < ac2);
  220. }
  221. bool is_behind_plane(const Triangle &that) const
  222. {
  223. using namespace std;
  224. const typename Vec3::Scalar apc0 = that.project(this->c[0]);
  225. const typename Vec3::Scalar apc1 = that.project(this->c[1]);
  226. const typename Vec3::Scalar apc2 = that.project(this->c[2]);
  227. cout<<" "<<
  228. apc0<<", "<<
  229. apc1<<", "<<
  230. apc2<<", "<<endl;
  231. return (apc0 < ZERO() && apc1 < ZERO() && apc2 < ZERO());
  232. }
  233. bool is_in_front_of_plane(const Triangle &that) const
  234. {
  235. using namespace std;
  236. const typename Vec3::Scalar apc0 = that.project(this->c[0]);
  237. const typename Vec3::Scalar apc1 = that.project(this->c[1]);
  238. const typename Vec3::Scalar apc2 = that.project(this->c[2]);
  239. cout<<" "<<
  240. apc0<<", "<<
  241. apc1<<", "<<
  242. apc2<<", "<<endl;
  243. return (apc0 > ZERO() && apc1 > ZERO() && apc2 > ZERO());
  244. }
  245. bool is_coplanar(const Triangle &that) const
  246. {
  247. using namespace std;
  248. const typename Vec3::Scalar apc0 = that.project(this->c[0]);
  249. const typename Vec3::Scalar apc1 = that.project(this->c[1]);
  250. const typename Vec3::Scalar apc2 = that.project(this->c[2]);
  251. return (fabs(apc0)<=ZERO() && fabs(apc1)<=ZERO() && fabs(apc2)<=ZERO());
  252. }
  253. // http://stackoverflow.com/a/14561664/148668
  254. // a1 is line1 start, a2 is line1 end, b1 is line2 start, b2 is line2 end
  255. static bool seg_seg_intersect(const Vec3 & a1, const Vec3 & a2, const Vec3 & b1, const Vec3 & b2)
  256. {
  257. Vec3 b = a2-a1;
  258. Vec3 d = b2-b1;
  259. typename Vec3::Scalar bDotDPerp = b(0) * d(1) - b(1) * d(0);
  260. // if b dot d == 0, it means the lines are parallel so have infinite intersection points
  261. if (bDotDPerp == 0)
  262. return false;
  263. Vec3 c = b1-a1;
  264. typename Vec3::Scalar t = (c(0) * d(1) - c(1) * d(0)) / bDotDPerp;
  265. if (t < 0 || t > 1)
  266. return false;
  267. typename Vec3::Scalar u = (c(0) * b(1) - c(1) * b(0)) / bDotDPerp;
  268. if (u < 0 || u > 1)
  269. return false;
  270. return true;
  271. }
  272. bool has_corner_inside(const Triangle & that) const
  273. {
  274. // http://www.blackpawn.com/texts/pointinpoly/
  275. // Compute vectors
  276. Vec3 A = that.c[0];
  277. Vec3 B = that.c[1];
  278. Vec3 C = that.c[2];
  279. A(2) = B(2) = C(2) = 0;
  280. for(int ci = 0;ci<3;ci++)
  281. {
  282. Vec3 P = this->c[ci];
  283. P(2) = 0;
  284. Vec3 v0 = C - A;
  285. Vec3 v1 = B - A;
  286. Vec3 v2 = P - A;
  287. // Compute dot products
  288. typename Vec3::Scalar dot00 = v0.dot(v0);
  289. typename Vec3::Scalar dot01 = v0.dot(v1);
  290. typename Vec3::Scalar dot02 = v0.dot(v2);
  291. typename Vec3::Scalar dot11 = v1.dot(v1);
  292. typename Vec3::Scalar dot12 = v1.dot(v2);
  293. // Compute barycentric coordinates
  294. typename Vec3::Scalar invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
  295. typename Vec3::Scalar u = (dot11 * dot02 - dot01 * dot12) * invDenom;
  296. typename Vec3::Scalar v = (dot00 * dot12 - dot01 * dot02) * invDenom;
  297. // Check if point is in triangle
  298. if((u >= 0) && (v >= 0) && (u + v < 1))
  299. {
  300. return true;
  301. }
  302. }
  303. return false;
  304. }
  305. bool overlaps(const Triangle &that) const
  306. {
  307. // Edges cross
  308. for(int e = 0;e<3;e++)
  309. {
  310. for(int f = 0;f<3;f++)
  311. {
  312. if(seg_seg_intersect(
  313. this->c[e],this->c[(e+1)%3],
  314. that.c[e],that.c[(e+1)%3]))
  315. {
  316. return true;
  317. }
  318. }
  319. }
  320. // This could be entirely inside that
  321. if(this->has_corner_inside(that))
  322. {
  323. return true;
  324. }
  325. // vice versa
  326. if(that.has_corner_inside(*this))
  327. {
  328. return true;
  329. }
  330. return false;
  331. }
  332. bool operator< (const Triangle &that) const
  333. {
  334. // THIS < THAT if "depth" of THIS < "depth" of THAT
  335. // " if THIS should be draw before THAT
  336. using namespace std;
  337. bool ret = false;
  338. // Self compare
  339. if(that.id == this->id)
  340. {
  341. ret = false;
  342. }
  343. if(this->is_completely_behind(that))
  344. {
  345. cout<<" "<<this->id<<" completely behind "<<that.id<<endl;
  346. ret = false;
  347. }else if(that.is_completely_behind(*this))
  348. {
  349. cout<<" "<<that.id<<" completely behind "<<this->id<<endl;
  350. ret = true;
  351. }else
  352. {
  353. if(!this->overlaps(that))
  354. {
  355. assert(!that.overlaps(*this));
  356. cout<<" THIS does not overlap THAT"<<endl;
  357. // No overlap use barycenter
  358. return
  359. 1./3.*(this->c[0](2) + this->c[1](2) + this->c[2](2)) >
  360. 1./3.*(that.c[0](2) + that.c[1](2) + that.c[2](2));
  361. }else
  362. {
  363. if(this->is_coplanar(that) || that.is_coplanar(*this))
  364. {
  365. cout<<" coplanar"<<endl;
  366. // co-planar: decide based on barycenter depth
  367. ret =
  368. 1./3.*(this->c[0](2) + this->c[1](2) + this->c[2](2)) >
  369. 1./3.*(that.c[0](2) + that.c[1](2) + that.c[2](2));
  370. }else if(this->is_behind_plane(that))
  371. {
  372. cout<<" THIS behind plane of THAT"<<endl;
  373. ret = true;
  374. }else if(that.is_behind_plane(*this))
  375. {
  376. cout<<" THAT behind of plane of THIS"<<endl;
  377. ret = false;
  378. // THAT is in front of plane of THIS
  379. }else if(that.is_in_front_of_plane(*this))
  380. {
  381. cout<<" THAT in front of plane of THIS"<<endl;
  382. ret = true;
  383. // THIS is in front of plane of THAT
  384. }else if(this->is_in_front_of_plane(that))
  385. {
  386. cout<<" THIS in front plane of THAT"<<endl;
  387. ret = false;
  388. }else
  389. {
  390. cout<<" compare bary"<<endl;
  391. ret =
  392. 1./3.*(this->c[0](2) + this->c[1](2) + this->c[2](2)) >
  393. 1./3.*(that.c[0](2) + that.c[1](2) + that.c[2](2));
  394. }
  395. }
  396. }
  397. if(ret)
  398. {
  399. // THIS < THAT so better not be THAT < THIS
  400. cout<<this->id<<" < "<<that.id<<endl;
  401. assert(!(that < *this));
  402. }else
  403. {
  404. // THIS >= THAT so could be THAT < THIS or THAT == THIS
  405. }
  406. return ret;
  407. }
  408. };
  409. //#include <igl/matlab/MatlabWorkspace.h>
  410. //
  411. //template <
  412. // typename DerivedV,
  413. // typename DerivedF,
  414. // typename DerivedMV,
  415. // typename DerivedP,
  416. // typename DerivedFF,
  417. // typename DerivedI>
  418. //IGL_INLINE void igl::sort_triangles_robust(
  419. // const Eigen::PlainObjectBase<DerivedV> & V,
  420. // const Eigen::PlainObjectBase<DerivedF> & F,
  421. // const Eigen::PlainObjectBase<DerivedMV> & MV,
  422. // const Eigen::PlainObjectBase<DerivedP> & P,
  423. // Eigen::PlainObjectBase<DerivedFF> & FF,
  424. // Eigen::PlainObjectBase<DerivedI> & I)
  425. //{
  426. // assert(false &&
  427. // "THIS WILL NEVER WORK because depth sorting is not a numerical sort where"
  428. // "pairwise comparisons of triangles are transitive. Rather it is a"
  429. // "topological sort on a dependecy graph. Dependency encodes 'This triangle"
  430. // "must be drawn before that one'");
  431. // using namespace std;
  432. // using namespace Eigen;
  433. // typedef Matrix<typename DerivedV::Scalar,3,1> Vec3;
  434. // assert(V.cols() == 4);
  435. // Matrix<typename DerivedV::Scalar, DerivedV::RowsAtCompileTime,3> VMVP =
  436. // V*(MV.transpose()*P.transpose().eval().block(0,0,4,3));
  437. //
  438. // MatrixXd projV(V.rows(),3);
  439. // for(int v = 0;v<V.rows();v++)
  440. // {
  441. // Vector3d vv;
  442. // vv(0) = V(v,0);
  443. // vv(1) = V(v,1);
  444. // vv(2) = V(v,2);
  445. // Vector3d p;
  446. // project(vv,p);
  447. // projV.row(v) = p;
  448. // }
  449. //
  450. // vector<Triangle<Vec3> > vF(F.rows());
  451. // MatrixXd N(F.rows(),3);
  452. // MatrixXd C(F.rows()*3,3);
  453. // for(int f = 0;f<F.rows();f++)
  454. // {
  455. // vF[f] =
  456. // //Triangle<Vec3>(f,VMVP.row(F(f,0)),VMVP.row(F(f,1)),VMVP.row(F(f,2)));
  457. // Triangle<Vec3>(f,projV.row(F(f,0)),projV.row(F(f,1)),projV.row(F(f,2)));
  458. // N.row(f) = vF[f].n;
  459. // for(int c = 0;c<3;c++)
  460. // for(int d = 0;d<3;d++)
  461. // C(f*3+c,d) = vF[f].c[c](d);
  462. // }
  463. // MatlabWorkspace mw;
  464. // mw.save_index(F,"F");
  465. // mw.save(V,"V");
  466. // mw.save(MV,"MV");
  467. // mw.save(P,"P");
  468. // Vector4i VP;
  469. // glGetIntegerv(GL_VIEWPORT, VP.data());
  470. // mw.save(projV,"projV");
  471. // mw.save(VP,"VP");
  472. // mw.save(VMVP,"VMVP");
  473. // mw.save(N,"N");
  474. // mw.save(C,"C");
  475. // mw.write("ao.mat");
  476. // sort(vF.begin(),vF.end());
  477. //
  478. // // check
  479. // for(int f = 0;f<F.rows();f++)
  480. // {
  481. // for(int g = f+1;g<F.rows();g++)
  482. // {
  483. // assert(!(vF[g] < vF[f])); // should never happen
  484. // }
  485. // }
  486. // FF.resize(F.rows(),3);
  487. // I.resize(F.rows(),1);
  488. // for(int f = 0;f<F.rows();f++)
  489. // {
  490. // FF.row(f) = F.row(vF[f].id);
  491. // I(f) = vF[f].id;
  492. // }
  493. //
  494. // mw.save_index(FF,"FF");
  495. // mw.save_index(I,"I");
  496. // mw.write("ao.mat");
  497. //}
  498. //template <
  499. // typename DerivedV,
  500. // typename DerivedF,
  501. // typename DerivedFF,
  502. // typename DerivedI>
  503. //IGL_INLINE void igl::sort_triangles_robust(
  504. // const Eigen::PlainObjectBase<DerivedV> & V,
  505. // const Eigen::PlainObjectBase<DerivedF> & F,
  506. // Eigen::PlainObjectBase<DerivedFF> & FF,
  507. // Eigen::PlainObjectBase<DerivedI> & I)
  508. //{
  509. // using namespace Eigen;
  510. // using namespace std;
  511. // // Put model, projection, and viewport matrices into double arrays
  512. // Matrix4d MV;
  513. // Matrix4d P;
  514. // glGetDoublev(GL_MODELVIEW_MATRIX, MV.data());
  515. // glGetDoublev(GL_PROJECTION_MATRIX, P.data());
  516. // if(V.cols() == 3)
  517. // {
  518. // Matrix<typename DerivedV::Scalar, DerivedV::RowsAtCompileTime,4> hV;
  519. // hV.resize(V.rows(),4);
  520. // hV.block(0,0,V.rows(),V.cols()) = V;
  521. // hV.col(3).setConstant(1);
  522. // return sort_triangles_robust(hV,F,MV,P,FF,I);
  523. // }else
  524. // {
  525. // return sort_triangles_robust(V,F,MV,P,FF,I);
  526. // }
  527. //}
  528. #endif
  529. #ifdef IGL_STATIC_LIBRARY
  530. // Explicit template instanciation
  531. //template void igl::sort_triangles_robust<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::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> >&);
  532. #ifndef IGL_NO_OPENGL
  533. template void igl::sort_triangles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::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> >&);
  534. template void igl::sort_triangles_slow<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::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> >&);
  535. #endif
  536. #endif