intrinsic_delaunay_triangulation.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2018 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_INTRINSIC_DELAUNAY_TRIANGULATION_H
  9. #define IGL_INTRINSIC_DELAUNAY_TRIANGULATION_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // INTRINSIC_DELAUNAY_TRIANGULATION Flip edges _intrinsically_ until all are
  15. // "intrinsic Delaunay". See "An algorithm for the construction of intrinsic
  16. // delaunay triangulations with applications to digital geometry processing"
  17. // [Fisher et al. 2007].
  18. //
  19. // Inputs:
  20. // l_in #F_in by 3 list of edge lengths (see edge_lengths)
  21. // F_in #F_in by 3 list of face indices into some unspecified vertex list V
  22. // Outputs:
  23. // l #F by 3 list of edge lengths
  24. // F #F by 3 list of new face indices
  25. //
  26. // See also: is_intrinsic_delaunay
  27. template <
  28. typename Derivedl_in,
  29. typename DerivedF_in,
  30. typename Derivedl,
  31. typename DerivedF>
  32. IGL_INLINE void intrinsic_delaunay_triangulation(
  33. const Eigen::MatrixBase<Derivedl_in> & l_in,
  34. const Eigen::MatrixBase<DerivedF_in> & F_in,
  35. Eigen::PlainObjectBase<Derivedl> & l,
  36. Eigen::PlainObjectBase<DerivedF> & F);
  37. // Outputs:
  38. // E #F*3 by 2 list of all directed edges, such that E.row(f+#F*c) is the
  39. // edge opposite F(f,c)
  40. // uE #uE by 2 list of unique undirected edges
  41. // EMAP #F*3 list of indices into uE, mapping each directed edge to unique
  42. // undirected edge
  43. // uE2E #uE list of lists of indices into E of coexisting edges
  44. //
  45. // See also: unique_edge_map
  46. template <
  47. typename Derivedl_in,
  48. typename DerivedF_in,
  49. typename Derivedl,
  50. typename DerivedF,
  51. typename DerivedE,
  52. typename DeriveduE,
  53. typename DerivedEMAP,
  54. typename uE2EType>
  55. IGL_INLINE void intrinsic_delaunay_triangulation(
  56. const Eigen::MatrixBase<Derivedl_in> & l_in,
  57. const Eigen::MatrixBase<DerivedF_in> & F_in,
  58. Eigen::PlainObjectBase<Derivedl> & l,
  59. Eigen::PlainObjectBase<DerivedF> & F,
  60. Eigen::PlainObjectBase<DerivedE> & E,
  61. Eigen::PlainObjectBase<DeriveduE> & uE,
  62. Eigen::PlainObjectBase<DerivedEMAP> & EMAP,
  63. std::vector<std::vector<uE2EType> > & uE2E);
  64. }
  65. #ifndef IGL_STATIC_LIBRARY
  66. # include "intrinsic_delaunay_triangulation.cpp"
  67. #endif
  68. #endif