point_triangle_squared_distance.h 930 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef IGL_COPYLEFT_CGAL_POINT_TRIANGLE_SQUARED_DISTANCE_H
  2. #define IGL_COPYLEFT_CGAL_POINT_TRIANGLE_SQUARED_DISTANCE_H
  3. #include <igl/igl_inline.h>
  4. #include <CGAL/Triangle_3.h>
  5. #include <CGAL/Point_3.h>
  6. namespace igl
  7. {
  8. namespace copyleft
  9. {
  10. namespace cgal
  11. {
  12. // Given a point P1 and triangle T2 find the points on each of closest
  13. // approach and the squared distance thereof.
  14. //
  15. // Inputs:
  16. // P1 point
  17. // T2 triangle
  18. // Outputs:
  19. // P2 point on T2 closest to P1
  20. // d distance betwee P1 and T2
  21. template < typename Kernel>
  22. IGL_INLINE void point_triangle_squared_distance(
  23. const CGAL::Point_3<Kernel> & P1,
  24. const CGAL::Triangle_3<Kernel> & T2,
  25. CGAL::Point_3<Kernel> & P2,
  26. typename Kernel::FT & d
  27. );
  28. }
  29. }
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "point_triangle_squared_distance.cpp"
  33. #endif
  34. #endif