minkowski_sum.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef IGL_COPYLEFT_CGAL_MINKOWSKI_SUM_H
  2. #define IGL_COPYLEFT_CGAL_MINKOWSKI_SUM_H
  3. #include "../../igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. namespace copyleft
  8. {
  9. namespace boolean
  10. {
  11. // Compute the Minkowski sum of a closed triangle mesh (V,F) and a
  12. // segment [s,d] in 3D.
  13. //
  14. // Inputs:
  15. // V #V by 3 list of mesh vertices in 3D
  16. // F #F by 3 list of triangle indices into V
  17. // s segment source endpoint in 3D
  18. // d segment source endpoint in 3D
  19. // Outputs:
  20. // W #W by 3 list of mesh vertices in 3D
  21. // G #G by 3 list of triangle indices into W
  22. // J #G list of indices into [F;#V+F;[s d]] of birth parents
  23. //
  24. template <
  25. typename DerivedV,
  26. typename DerivedF,
  27. typename Deriveds,
  28. typename Derivedd,
  29. typename DerivedW,
  30. typename DerivedG,
  31. typename DerivedJ>
  32. IGL_INLINE void minkowski_sum(
  33. const Eigen::PlainObjectBase<DerivedV> & V,
  34. const Eigen::PlainObjectBase<DerivedF> & F,
  35. const Eigen::PlainObjectBase<Deriveds> & s,
  36. const Eigen::PlainObjectBase<Derivedd> & d,
  37. Eigen::PlainObjectBase<DerivedW> & W,
  38. Eigen::PlainObjectBase<DerivedG> & G,
  39. Eigen::PlainObjectBase<DerivedJ> & J);
  40. }
  41. }
  42. }
  43. #ifndef IGL_STATIC_LIBRARY
  44. # include "minkowski_sum.cpp"
  45. #endif
  46. #endif