signed_distance.cpp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 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 "signed_distance.h"
  9. #include "get_seconds.h"
  10. #include "per_edge_normals.h"
  11. #include "parallel_for.h"
  12. #include "per_face_normals.h"
  13. #include "per_vertex_normals.h"
  14. #include "point_mesh_squared_distance.h"
  15. #include "pseudonormal_test.h"
  16. template <
  17. typename DerivedP,
  18. typename DerivedV,
  19. typename DerivedF,
  20. typename DerivedS,
  21. typename DerivedI,
  22. typename DerivedC,
  23. typename DerivedN>
  24. IGL_INLINE void igl::signed_distance(
  25. const Eigen::MatrixBase<DerivedP> & P,
  26. const Eigen::MatrixBase<DerivedV> & V,
  27. const Eigen::MatrixBase<DerivedF> & F,
  28. const SignedDistanceType sign_type,
  29. const typename DerivedV::Scalar lower_bound,
  30. const typename DerivedV::Scalar upper_bound,
  31. Eigen::PlainObjectBase<DerivedS> & S,
  32. Eigen::PlainObjectBase<DerivedI> & I,
  33. Eigen::PlainObjectBase<DerivedC> & C,
  34. Eigen::PlainObjectBase<DerivedN> & N)
  35. {
  36. using namespace Eigen;
  37. using namespace std;
  38. const int dim = V.cols();
  39. assert((V.cols() == 3||V.cols() == 2) && "V should have 3d or 2d positions");
  40. assert((P.cols() == 3||P.cols() == 2) && "P should have 3d or 2d positions");
  41. assert(V.cols() == P.cols() && "V should have same dimension as P");
  42. // Only unsigned distance is supported for non-triangles
  43. if(sign_type != SIGNED_DISTANCE_TYPE_UNSIGNED)
  44. {
  45. assert(F.cols() == dim && "F should have co-dimension 0 simplices");
  46. }
  47. typedef Eigen::Matrix<typename DerivedV::Scalar,1,3> RowVector3S;
  48. // Prepare distance computation
  49. AABB<DerivedV,3> tree3;
  50. AABB<DerivedV,2> tree2;
  51. switch(dim)
  52. {
  53. default:
  54. case 3:
  55. tree3.init(V,F);
  56. break;
  57. case 2:
  58. tree2.init(V,F);
  59. break;
  60. }
  61. Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> FN,VN,EN;
  62. Eigen::Matrix<typename DerivedF::Scalar,Eigen::Dynamic,2> E;
  63. Eigen::Matrix<typename DerivedF::Scalar,Eigen::Dynamic,1> EMAP;
  64. WindingNumberAABB<RowVector3S,DerivedV,DerivedF> hier3;
  65. switch(sign_type)
  66. {
  67. default:
  68. assert(false && "Unknown SignedDistanceType");
  69. case SIGNED_DISTANCE_TYPE_UNSIGNED:
  70. // do nothing
  71. break;
  72. case SIGNED_DISTANCE_TYPE_DEFAULT:
  73. case SIGNED_DISTANCE_TYPE_WINDING_NUMBER:
  74. switch(dim)
  75. {
  76. default:
  77. case 3:
  78. hier3.set_mesh(V,F);
  79. hier3.grow();
  80. break;
  81. case 2:
  82. // no precomp, no hierarchy
  83. break;
  84. }
  85. break;
  86. case SIGNED_DISTANCE_TYPE_PSEUDONORMAL:
  87. switch(dim)
  88. {
  89. default:
  90. case 3:
  91. // "Signed Distance Computation Using the Angle Weighted Pseudonormal"
  92. // [Bærentzen & Aanæs 2005]
  93. per_face_normals(V,F,FN);
  94. per_vertex_normals(V,F,PER_VERTEX_NORMALS_WEIGHTING_TYPE_ANGLE,FN,VN);
  95. per_edge_normals(
  96. V,F,PER_EDGE_NORMALS_WEIGHTING_TYPE_UNIFORM,FN,EN,E,EMAP);
  97. break;
  98. case 2:
  99. FN.resize(F.rows(),2);
  100. VN = DerivedV::Zero(V.rows(),2);
  101. for(int e = 0;e<F.rows();e++)
  102. {
  103. // rotate edge vector
  104. FN(e,0) = (V(F(e,1),1)-V(F(e,0),1));
  105. FN(e,1) = -(V(F(e,1),0)-V(F(e,0),0));
  106. FN.row(e).normalize();
  107. // add to vertex normal
  108. VN.row(F(e,1)) += FN.row(e);
  109. VN.row(F(e,0)) += FN.row(e);
  110. }
  111. // normalize to average
  112. VN.rowwise().normalize();
  113. break;
  114. }
  115. N.resize(P.rows(),dim);
  116. break;
  117. }
  118. //
  119. // convert to bounds on (unsiged) squared distances
  120. typedef typename DerivedV::Scalar Scalar;
  121. const Scalar max_abs = std::max(std::abs(lower_bound),std::abs(upper_bound));
  122. const Scalar up_sqr_d = std::pow(max_abs,2.0);
  123. const Scalar low_sqr_d =
  124. std::pow(std::max(max_abs-(upper_bound-lower_bound),(Scalar)0.0),2.0);
  125. S.resize(P.rows(),1);
  126. I.resize(P.rows(),1);
  127. C.resize(P.rows(),dim);
  128. parallel_for(P.rows(),[&](const int p)
  129. //for(int p = 0;p<P.rows();p++)
  130. {
  131. RowVector3S q3;
  132. Eigen::Matrix<typename DerivedV::Scalar,1,2> q2;
  133. switch(P.cols())
  134. {
  135. default:
  136. case 3:
  137. q3.head(P.row(p).size()) = P.row(p);
  138. break;
  139. case 2:
  140. q2 = P.row(p).head(2);
  141. break;
  142. }
  143. typename DerivedV::Scalar s=1,sqrd=0;
  144. Eigen::Matrix<typename DerivedV::Scalar,1,Eigen::Dynamic> c;
  145. RowVector3S c3;
  146. Eigen::Matrix<typename DerivedV::Scalar,1,2> c2;
  147. int i=-1;
  148. // in all cases compute squared unsiged distances
  149. sqrd = dim==3?
  150. tree3.squared_distance(V,F,q3,low_sqr_d,up_sqr_d,i,c3):
  151. tree2.squared_distance(V,F,q2,low_sqr_d,up_sqr_d,i,c2);
  152. if(sqrd >= up_sqr_d || sqrd <= low_sqr_d)
  153. {
  154. // Out of bounds gets a nan (nans on grids can be flood filled later using
  155. // igl::flood_fill)
  156. S(p) = std::numeric_limits<double>::quiet_NaN();
  157. I(p) = F.rows()+1;
  158. C.row(p).setConstant(0);
  159. }else
  160. {
  161. // Determine sign
  162. switch(sign_type)
  163. {
  164. default:
  165. assert(false && "Unknown SignedDistanceType");
  166. case SIGNED_DISTANCE_TYPE_UNSIGNED:
  167. break;
  168. case SIGNED_DISTANCE_TYPE_DEFAULT:
  169. case SIGNED_DISTANCE_TYPE_WINDING_NUMBER:
  170. {
  171. Scalar w = 0;
  172. if(dim == 3)
  173. {
  174. s = 1.-2.*hier3.winding_number(q3.transpose());
  175. }else
  176. {
  177. assert(!V.derived().IsRowMajor);
  178. assert(!F.derived().IsRowMajor);
  179. s = 1.-2.*winding_number(V,F,q2);
  180. }
  181. break;
  182. }
  183. case SIGNED_DISTANCE_TYPE_PSEUDONORMAL:
  184. {
  185. RowVector3S n3;
  186. Eigen::Matrix<typename DerivedV::Scalar,1,2> n2;
  187. dim==3 ?
  188. pseudonormal_test(V,F,FN,VN,EN,EMAP,q3,i,c3,s,n3):
  189. pseudonormal_test(V,E,EN,VN,q2,i,c2,s,n2);
  190. Eigen::Matrix<typename DerivedV::Scalar,1,Eigen::Dynamic> n;
  191. (dim==3 ? n = n3 : n = n2);
  192. N.row(p) = n;
  193. break;
  194. }
  195. }
  196. I(p) = i;
  197. S(p) = s*sqrt(sqrd);
  198. C.row(p) = (dim==3 ? c=c3 : c=c2);
  199. }
  200. }
  201. ,10000);
  202. }
  203. template <
  204. typename DerivedP,
  205. typename DerivedV,
  206. typename DerivedF,
  207. typename DerivedS,
  208. typename DerivedI,
  209. typename DerivedC,
  210. typename DerivedN>
  211. IGL_INLINE void igl::signed_distance(
  212. const Eigen::MatrixBase<DerivedP> & P,
  213. const Eigen::MatrixBase<DerivedV> & V,
  214. const Eigen::MatrixBase<DerivedF> & F,
  215. const SignedDistanceType sign_type,
  216. Eigen::PlainObjectBase<DerivedS> & S,
  217. Eigen::PlainObjectBase<DerivedI> & I,
  218. Eigen::PlainObjectBase<DerivedC> & C,
  219. Eigen::PlainObjectBase<DerivedN> & N)
  220. {
  221. typedef typename DerivedV::Scalar Scalar;
  222. Scalar lower = std::numeric_limits<Scalar>::min();
  223. Scalar upper = std::numeric_limits<Scalar>::max();
  224. return signed_distance(P,V,F,sign_type,lower,upper,S,I,C,N);
  225. }
  226. template <
  227. typename DerivedV,
  228. typename DerivedF,
  229. typename DerivedFN,
  230. typename DerivedVN,
  231. typename DerivedEN,
  232. typename DerivedEMAP,
  233. typename Derivedq>
  234. IGL_INLINE typename DerivedV::Scalar igl::signed_distance_pseudonormal(
  235. const AABB<DerivedV,3> & tree,
  236. const Eigen::MatrixBase<DerivedV> & V,
  237. const Eigen::MatrixBase<DerivedF> & F,
  238. const Eigen::MatrixBase<DerivedFN> & FN,
  239. const Eigen::MatrixBase<DerivedVN> & VN,
  240. const Eigen::MatrixBase<DerivedEN> & EN,
  241. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  242. const Eigen::MatrixBase<Derivedq> & q)
  243. {
  244. typename DerivedV::Scalar s,sqrd;
  245. Eigen::Matrix<typename DerivedV::Scalar,1,3> n,c;
  246. int i = -1;
  247. signed_distance_pseudonormal(tree,V,F,FN,VN,EN,EMAP,q,s,sqrd,i,c,n);
  248. return s*sqrt(sqrd);
  249. }
  250. template <
  251. typename DerivedP,
  252. typename DerivedV,
  253. typename DerivedF,
  254. typename DerivedFN,
  255. typename DerivedVN,
  256. typename DerivedEN,
  257. typename DerivedEMAP,
  258. typename DerivedS,
  259. typename DerivedI,
  260. typename DerivedC,
  261. typename DerivedN>
  262. IGL_INLINE void igl::signed_distance_pseudonormal(
  263. const Eigen::MatrixBase<DerivedP> & P,
  264. const Eigen::MatrixBase<DerivedV> & V,
  265. const Eigen::MatrixBase<DerivedF> & F,
  266. const AABB<DerivedV,3> & tree,
  267. const Eigen::MatrixBase<DerivedFN> & FN,
  268. const Eigen::MatrixBase<DerivedVN> & VN,
  269. const Eigen::MatrixBase<DerivedEN> & EN,
  270. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  271. Eigen::PlainObjectBase<DerivedS> & S,
  272. Eigen::PlainObjectBase<DerivedI> & I,
  273. Eigen::PlainObjectBase<DerivedC> & C,
  274. Eigen::PlainObjectBase<DerivedN> & N)
  275. {
  276. using namespace Eigen;
  277. const size_t np = P.rows();
  278. S.resize(np,1);
  279. I.resize(np,1);
  280. N.resize(np,3);
  281. C.resize(np,3);
  282. typedef typename AABB<DerivedV,3>::RowVectorDIMS RowVector3S;
  283. # pragma omp parallel for if(np>1000)
  284. for(std::ptrdiff_t p = 0;p<np;p++)
  285. {
  286. typename DerivedV::Scalar s,sqrd;
  287. RowVector3S n,c;
  288. int i = -1;
  289. RowVector3S q = P.row(p);
  290. signed_distance_pseudonormal(tree,V,F,FN,VN,EN,EMAP,q,s,sqrd,i,c,n);
  291. S(p) = s*sqrt(sqrd);
  292. I(p) = i;
  293. N.row(p) = n;
  294. C.row(p) = c;
  295. }
  296. }
  297. template <
  298. typename DerivedV,
  299. typename DerivedF,
  300. typename DerivedFN,
  301. typename DerivedVN,
  302. typename DerivedEN,
  303. typename DerivedEMAP,
  304. typename Derivedq,
  305. typename Scalar,
  306. typename Derivedc,
  307. typename Derivedn>
  308. IGL_INLINE void igl::signed_distance_pseudonormal(
  309. const AABB<DerivedV,3> & tree,
  310. const Eigen::MatrixBase<DerivedV> & V,
  311. const Eigen::MatrixBase<DerivedF> & F,
  312. const Eigen::MatrixBase<DerivedFN> & FN,
  313. const Eigen::MatrixBase<DerivedVN> & VN,
  314. const Eigen::MatrixBase<DerivedEN> & EN,
  315. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  316. const Eigen::MatrixBase<Derivedq> & q,
  317. Scalar & s,
  318. Scalar & sqrd,
  319. int & i,
  320. Eigen::PlainObjectBase<Derivedc> & c,
  321. Eigen::PlainObjectBase<Derivedn> & n)
  322. {
  323. using namespace Eigen;
  324. using namespace std;
  325. //typedef Eigen::Matrix<typename DerivedV::Scalar,1,3> RowVector3S;
  326. // Alec: Why was this constructor around q necessary?
  327. //sqrd = tree.squared_distance(V,F,RowVector3S(q),i,(RowVector3S&)c);
  328. // Alec: Why was this constructor around c necessary?
  329. //sqrd = tree.squared_distance(V,F,q,i,(RowVector3S&)c);
  330. sqrd = tree.squared_distance(V,F,q,i,c);
  331. pseudonormal_test(V,F,FN,VN,EN,EMAP,q,i,c,s,n);
  332. }
  333. template <
  334. typename DerivedV,
  335. typename DerivedE,
  336. typename DerivedEN,
  337. typename DerivedVN,
  338. typename Derivedq,
  339. typename Scalar,
  340. typename Derivedc,
  341. typename Derivedn>
  342. IGL_INLINE void igl::signed_distance_pseudonormal(
  343. const AABB<DerivedV,2> & tree,
  344. const Eigen::MatrixBase<DerivedV> & V,
  345. const Eigen::MatrixBase<DerivedE> & E,
  346. const Eigen::MatrixBase<DerivedEN> & EN,
  347. const Eigen::MatrixBase<DerivedVN> & VN,
  348. const Eigen::MatrixBase<Derivedq> & q,
  349. Scalar & s,
  350. Scalar & sqrd,
  351. int & i,
  352. Eigen::PlainObjectBase<Derivedc> & c,
  353. Eigen::PlainObjectBase<Derivedn> & n)
  354. {
  355. using namespace Eigen;
  356. using namespace std;
  357. typedef Eigen::Matrix<typename DerivedV::Scalar,1,2> RowVector2S;
  358. sqrd = tree.squared_distance(V,E,RowVector2S(q),i,(RowVector2S&)c);
  359. pseudonormal_test(V,E,EN,VN,q,i,c,s,n);
  360. }
  361. template <
  362. typename DerivedV,
  363. typename DerivedF,
  364. typename Derivedq>
  365. IGL_INLINE typename DerivedV::Scalar igl::signed_distance_winding_number(
  366. const AABB<DerivedV,3> & tree,
  367. const Eigen::MatrixBase<DerivedV> & V,
  368. const Eigen::MatrixBase<DerivedF> & F,
  369. const igl::WindingNumberAABB<Derivedq,DerivedV,DerivedF> & hier,
  370. const Eigen::MatrixBase<Derivedq> & q)
  371. {
  372. typedef typename DerivedV::Scalar Scalar;
  373. Scalar s,sqrd;
  374. Eigen::Matrix<Scalar,1,3> c;
  375. int i=-1;
  376. signed_distance_winding_number(tree,V,F,hier,q,s,sqrd,i,c);
  377. return s*sqrt(sqrd);
  378. }
  379. template <
  380. typename DerivedV,
  381. typename DerivedF,
  382. typename Derivedq,
  383. typename Scalar,
  384. typename Derivedc>
  385. IGL_INLINE void igl::signed_distance_winding_number(
  386. const AABB<DerivedV,3> & tree,
  387. const Eigen::MatrixBase<DerivedV> & V,
  388. const Eigen::MatrixBase<DerivedF> & F,
  389. const igl::WindingNumberAABB<Derivedq,DerivedV,DerivedF> & hier,
  390. const Eigen::MatrixBase<Derivedq> & q,
  391. Scalar & s,
  392. Scalar & sqrd,
  393. int & i,
  394. Eigen::PlainObjectBase<Derivedc> & c)
  395. {
  396. using namespace Eigen;
  397. using namespace std;
  398. typedef Eigen::Matrix<typename DerivedV::Scalar,1,3> RowVector3S;
  399. sqrd = tree.squared_distance(V,F,RowVector3S(q),i,(RowVector3S&)c);
  400. const Scalar w = hier.winding_number(q.transpose());
  401. s = 1.-2.*w;
  402. }
  403. template <
  404. typename DerivedV,
  405. typename DerivedF,
  406. typename Derivedq,
  407. typename Scalar,
  408. typename Derivedc>
  409. IGL_INLINE void igl::signed_distance_winding_number(
  410. const AABB<DerivedV,2> & tree,
  411. const Eigen::MatrixBase<DerivedV> & V,
  412. const Eigen::MatrixBase<DerivedF> & F,
  413. const Eigen::MatrixBase<Derivedq> & q,
  414. Scalar & s,
  415. Scalar & sqrd,
  416. int & i,
  417. Eigen::PlainObjectBase<Derivedc> & c)
  418. {
  419. using namespace Eigen;
  420. using namespace std;
  421. typedef Eigen::Matrix<typename DerivedV::Scalar,1,2> RowVector2S;
  422. sqrd = tree.squared_distance(V,F,RowVector2S(q),i,(RowVector2S&)c);
  423. Scalar w;
  424. // TODO: using .data() like this is very dangerous... This is assuming
  425. // colmajor order
  426. assert(!V.derived().IsRowMajor);
  427. assert(!F.derived().IsRowMajor);
  428. s = 1.-2.*winding_number(V,F,q);
  429. }
  430. #ifdef IGL_STATIC_LIBRARY
  431. // Explicit template instantiation
  432. // generated by autoexplicit.sh
  433. template void igl::signed_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 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::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::SignedDistanceType, Eigen::Matrix<double, -1, 3, 1, -1, 3>::Scalar, Eigen::Matrix<double, -1, 3, 1, -1, 3>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
  434. // generated by autoexplicit.sh
  435. template void igl::signed_distance<Eigen::Matrix<float, -1, 3, 0, -1, 3>, 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::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, igl::SignedDistanceType, Eigen::Matrix<float, -1, 3, 0, -1, 3>::Scalar, Eigen::Matrix<float, -1, 3, 0, -1, 3>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
  436. // generated by autoexplicit.sh
  437. template void igl::signed_distance<Eigen::Matrix<float, -1, 3, 1, -1, 3>, 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::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(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<int, -1, 3, 1, -1, 3> > const&, igl::SignedDistanceType, Eigen::Matrix<float, -1, 3, 1, -1, 3>::Scalar, Eigen::Matrix<float, -1, 3, 1, -1, 3>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
  438. template void igl::signed_distance<Eigen::Matrix<float, -1, -1, 0, -1, -1>, 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::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::SignedDistanceType, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
  439. template void igl::signed_distance_pseudonormal<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<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<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::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, double&, double&, int&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
  440. template void igl::signed_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(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<int, -1, -1, 0, -1, -1> > const&, igl::SignedDistanceType, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
  441. template Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar igl::signed_distance_pseudonormal<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<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<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::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&);
  442. template void igl::signed_distance_pseudonormal<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::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<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<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<int, -1, -1, 0, -1, -1> > const&, igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3> const&, 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::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > 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<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  443. template void igl::signed_distance<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::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::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<int, -1, -1, 0, -1, -1> > const&, igl::SignedDistanceType, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -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> >&);
  444. template void igl::signed_distance_winding_number<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::WindingNumberAABB<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, double&, double&, int&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
  445. template Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar igl::signed_distance_winding_number<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 3, 1, 0, 3, 1> >(igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::WindingNumberAABB<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&);
  446. #endif