point_segment_squared_distance.h 931 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef IGL_COPYLEFT_CGAL_POINT_SEGMENT_SQUARED_DISTANCE_H
  2. #define IGL_COPYLEFT_CGAL_POINT_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 a point P1 and segment S2 find the points on each of closest
  13. // approach and the squared distance thereof.
  14. //
  15. // Inputs:
  16. // P1 point
  17. // S2 segment
  18. // Outputs:
  19. // P2 point on S2 closest to P1
  20. // d distance betwee P1 and S2
  21. template < typename Kernel>
  22. IGL_INLINE void point_segment_squared_distance(
  23. const CGAL::Point_3<Kernel> & P1,
  24. const CGAL::Segment_3<Kernel> & S2,
  25. CGAL::Point_3<Kernel> & P2,
  26. typename Kernel::FT & d
  27. );
  28. }
  29. }
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "point_segment_squared_distance.cpp"
  33. #endif
  34. #endif