triangle_triangle_squared_distance.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef IGL_COPYLEFT_CGAL_TRIANGLE_TRIANGLE_SQUARED_DISTANCE_H
  2. #define IGL_COPYLEFT_CGAL_TRIANGLE_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 two triangles T1 and T2 find the points on each of closest
  13. // approach and the squared distance thereof.
  14. //
  15. // Inputs:
  16. // T1 first triangle
  17. // T2 second triangle
  18. // Outputs:
  19. // P1 point on T1 closest to T2
  20. // P2 point on T2 closest to T1
  21. // d distance betwee P1 and T2
  22. // Returns true if the closest approach is unique.
  23. template < typename Kernel>
  24. IGL_INLINE bool triangle_triangle_squared_distance(
  25. const CGAL::Triangle_3<Kernel> & T1,
  26. const CGAL::Triangle_3<Kernel> & T2,
  27. CGAL::Point_3<Kernel> & P1,
  28. CGAL::Point_3<Kernel> & P2,
  29. typename Kernel::FT & d);
  30. }
  31. }
  32. }
  33. #ifndef IGL_STATIC_LIBRARY
  34. # include "triangle_triangle_squared_distance.cpp"
  35. #endif
  36. #endif