remesh_intersections.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Qingnan Zhou <[email protected]>
  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. //
  9. #ifndef IGL_COPYLEFT_CGAL_REMESH_INTERSECTIONS_H
  10. #define IGL_COPYLEFT_CGAL_REMESH_INTERSECTIONS_H
  11. #include "../../igl_inline.h"
  12. #include <Eigen/Dense>
  13. #include "CGAL_includes.hpp"
  14. namespace igl
  15. {
  16. namespace copyleft
  17. {
  18. namespace cgal
  19. {
  20. /// Remesh faces according to results of intersection detection and
  21. /// construction (e.g. from `igl::copyleft::cgal::intersect_other` or
  22. /// `igl::copyleft::cgal::SelfIntersectMesh`)
  23. ///
  24. /// @param[in] V #V by 3 list of vertex positions
  25. /// @param[in] F #F by 3 list of triangle indices into V
  26. /// @param[in] T #F list of cgal triangles
  27. /// @param[in] offending #offending map taking face indices into F to pairs of order
  28. /// of first finding and list of intersection objects from all
  29. /// intersections
  30. /// @param[in] stitch_all if true, merge all vertices with the same coordinate.
  31. /// @param[out] VV #VV by 3 list of vertex positions, if stitch_all = false then
  32. /// first #V vertices will always be V
  33. /// @param[out] FF #FF by 3 list of triangle indices into V
  34. /// @param[out] IF #intersecting face pairs by 2 list of intersecting face pairs,
  35. /// indexing F
  36. /// @param[out] J #FF list of indices into F denoting birth triangle
  37. /// @param[out] IM if stitch_all = true #VV list from 0 to #VV-1
  38. /// elseif stitch_all = false #VV list of indices into VV of unique vertices.
  39. ///
  40. template <
  41. typename DerivedV,
  42. typename DerivedF,
  43. typename Kernel,
  44. typename DerivedVV,
  45. typename DerivedFF,
  46. typename DerivedJ,
  47. typename DerivedIM>
  48. IGL_INLINE void remesh_intersections(
  49. const Eigen::MatrixBase<DerivedV> & V,
  50. const Eigen::MatrixBase<DerivedF> & F,
  51. const std::vector<CGAL::Triangle_3<Kernel> > & T,
  52. const std::map<
  53. typename DerivedF::Index,
  54. std::vector<
  55. std::pair<typename DerivedF::Index, CGAL::Object> > > & offending,
  56. bool stitch_all,
  57. bool slow_and_more_precise_rounding,
  58. Eigen::PlainObjectBase<DerivedVV> & VV,
  59. Eigen::PlainObjectBase<DerivedFF> & FF,
  60. Eigen::PlainObjectBase<DerivedJ> & J,
  61. Eigen::PlainObjectBase<DerivedIM> & IM);
  62. }
  63. }
  64. }
  65. #ifndef IGL_STATIC_LIBRARY
  66. # include "remesh_intersections.cpp"
  67. #endif
  68. #endif