signed_distance.cpp 23 KB

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