resolve_intersections.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef IGL_COPYLEFT_CGAL_RESOLVE_INTERSECTIONS_H
  2. #define IGL_COPYLEFT_CGAL_RESOLVE_INTERSECTIONS_H
  3. #include <igl/igl_inline.h>
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. namespace copyleft
  8. {
  9. // RESOLVE_INTERSECTIONS Given a list of possible intersecting segments with
  10. // endpoints, split segments to overlap only at endpoints
  11. //
  12. // Inputs:
  13. // V #V by 2 list of vertex positions
  14. // E #E by 2 list of segment indices into V
  15. // Outputs:
  16. // VI #VI by 2 list of output vertex positions, copies of V are always
  17. // the first #V vertices
  18. // EI #EI by 2 list of segment indices into V, #EI ≥ #E
  19. // J #EI list of indices into E revealing "parent segments"
  20. // IM #VI list of indices into VV of unique vertices.
  21. namespace cgal
  22. {
  23. template <
  24. typename DerivedV,
  25. typename DerivedE,
  26. typename DerivedVI,
  27. typename DerivedEI,
  28. typename DerivedJ,
  29. typename DerivedIM>
  30. IGL_INLINE void resolve_intersections(
  31. const Eigen::PlainObjectBase<DerivedV> & V,
  32. const Eigen::PlainObjectBase<DerivedE> & E,
  33. Eigen::PlainObjectBase<DerivedVI> & VI,
  34. Eigen::PlainObjectBase<DerivedEI> & EI,
  35. Eigen::PlainObjectBase<DerivedJ> & J,
  36. Eigen::PlainObjectBase<DerivedIM> & IM);
  37. }
  38. }
  39. }
  40. #ifndef IGL_STATIC_LIBRARY
  41. # include "resolve_intersections.cpp"
  42. #endif
  43. #endif