point_solid_signed_squared_distance.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 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. #ifndef IGL_COPYLEFT_CGAL_POINT_SOLID_SIGNED_SQUARED_DISTANCE_H
  9. #define IGL_COPYLEFT_CGAL_POINT_SOLID_SIGNED_SQUARED_DISTANCE_H
  10. #include "../../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace copyleft
  15. {
  16. namespace cgal
  17. {
  18. /// Given a set of points (Q) and the boundary mesh (VB,FB) of a solid (as
  19. /// defined in [Zhou et al. 2016], determine the signed squared distance
  20. /// for each point q in Q so that d(q,B) is negative if inside and positive
  21. /// if outside.
  22. ///
  23. /// @param[in] Q #Q by 3 list of query point positions
  24. /// @param[in] VB #VB by 3 list of mesh vertex positions of B
  25. /// @param[in] FB #FB by 3 list of mesh triangle indices into VB
  26. /// @param[out] D #Q list of signed squared distances
  27. template <
  28. typename DerivedQ,
  29. typename DerivedVB,
  30. typename DerivedFB,
  31. typename DerivedD>
  32. IGL_INLINE void point_solid_signed_squared_distance(
  33. const Eigen::PlainObjectBase<DerivedQ> & Q,
  34. const Eigen::PlainObjectBase<DerivedVB> & VB,
  35. const Eigen::PlainObjectBase<DerivedFB> & FB,
  36. Eigen::PlainObjectBase<DerivedD> & D);
  37. }
  38. }
  39. }
  40. #ifndef IGL_STATIC_LIBRARY
  41. # include "point_solid_signed_squared_distance.cpp"
  42. #endif
  43. #endif