point_solid_signed_squared_distance.h 1.6 KB

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