resolve_intersections.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_COPYLEFT_CGAL_RESOLVE_INTERSECTIONS_H
  9. #define IGL_COPYLEFT_CGAL_RESOLVE_INTERSECTIONS_H
  10. #include "../../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace copyleft
  15. {
  16. // RESOLVE_INTERSECTIONS Given a list of possible intersecting segments with
  17. // endpoints, split segments to overlap only at endpoints
  18. //
  19. // Inputs:
  20. // V #V by 2 list of vertex positions
  21. // E #E by 2 list of segment indices into V
  22. // Outputs:
  23. // VI #VI by 2 list of output vertex positions, copies of V are always
  24. // the first #V vertices
  25. // EI #EI by 2 list of segment indices into V, #EI ≥ #E
  26. // J #EI list of indices into E revealing "parent segments"
  27. // IM #VI list of indices into VV of unique vertices.
  28. namespace cgal
  29. {
  30. template <
  31. typename DerivedV,
  32. typename DerivedE,
  33. typename DerivedVI,
  34. typename DerivedEI,
  35. typename DerivedJ,
  36. typename DerivedIM>
  37. IGL_INLINE void resolve_intersections(
  38. const Eigen::PlainObjectBase<DerivedV> & V,
  39. const Eigen::PlainObjectBase<DerivedE> & E,
  40. Eigen::PlainObjectBase<DerivedVI> & VI,
  41. Eigen::PlainObjectBase<DerivedEI> & EI,
  42. Eigen::PlainObjectBase<DerivedJ> & J,
  43. Eigen::PlainObjectBase<DerivedIM> & IM);
  44. }
  45. }
  46. }
  47. #ifndef IGL_STATIC_LIBRARY
  48. # include "resolve_intersections.cpp"
  49. #endif
  50. #endif