signed_distance.cpp 26 KB

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