segment_segment_squared_distance.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef IGL_COPYLEFT_CGAL_SEGMENT_SEGMENT_SQUARED_DISTANCE_H
  2. #define IGL_COPYLEFT_CGAL_SEGMENT_SEGMENT_SQUARED_DISTANCE_H
  3. #include <igl/igl_inline.h>
  4. #include <CGAL/Segment_3.h>
  5. #include <CGAL/Point_3.h>
  6. namespace igl
  7. {
  8. namespace copyleft
  9. {
  10. namespace cgal
  11. {
  12. // Given two segments S1 and S2 find the points on each of closest
  13. // approach and the squared distance thereof.
  14. //
  15. // Inputs:
  16. // S1 first segment
  17. // S2 second segment
  18. // Outputs:
  19. // P1 point on S1 closest to S2
  20. // P2 point on S2 closest to S1
  21. // d distance betwee P1 and S2
  22. // Returns true if the closest approach is unique.
  23. template < typename Kernel>
  24. IGL_INLINE bool segment_segment_squared_distance(
  25. const CGAL::Segment_3<Kernel> & S1,
  26. const CGAL::Segment_3<Kernel> & S2,
  27. CGAL::Point_3<Kernel> & P1,
  28. CGAL::Point_3<Kernel> & P2,
  29. typename Kernel::FT & d
  30. );
  31. }
  32. }
  33. }
  34. #ifndef IGL_STATIC_LIBRARY
  35. # include "segment_segment_squared_distance.cpp"
  36. #endif
  37. #endif