isolines.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2023 Alec Jacobson <[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. #ifndef IGL_ISOLINES_H
  9. #define IGL_ISOLINES_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Compute isolines of a scalar field on a triangle mesh.
  15. ///
  16. /// Isolines may cross perfectly at vertices. The output should not contain
  17. /// degenerate segments (so long as the input does not contain degenerate
  18. /// faces). The output segments are *oriented* so that isolines curl
  19. /// counter-clockwise around local maxima (i.e., for 2D scalar fields). Unless
  20. /// an isoline hits a boundary, it should be a closed loop. Isolines may run
  21. /// perfectly along boundaries. Isolines should appear just "above" constants
  22. /// regions.
  23. ///
  24. /// @param[in] V #V by dim list of mesh vertex positions
  25. /// @param[in] F #F by 3 list of mesh triangle indices into V
  26. /// @param[in] S #V by 1 list of per-vertex scalar values
  27. /// @param[in] vals #vals by 1 list of values to compute isolines for
  28. /// @param[out] iV #iV by dim list of isoline vertex positions
  29. /// @param[out] iE #iE by 2 list of edge indices into iV
  30. /// @param[out] I #iE by 1 list of indices into vals indicating which value
  31. /// each segment belongs to
  32. ///
  33. /// \see isolines_intrinsic, edge_crossings
  34. template <
  35. typename DerivedV,
  36. typename DerivedF,
  37. typename DerivedS,
  38. typename Derivedvals,
  39. typename DerivediV,
  40. typename DerivediE,
  41. typename DerivedI>
  42. void isolines(
  43. const Eigen::MatrixBase<DerivedV> & V,
  44. const Eigen::MatrixBase<DerivedF> & F,
  45. const Eigen::MatrixBase<DerivedS> & S,
  46. const Eigen::MatrixBase<Derivedvals> & vals,
  47. Eigen::PlainObjectBase<DerivediV> & iV,
  48. Eigen::PlainObjectBase<DerivediE> & iE,
  49. Eigen::PlainObjectBase<DerivedI> & I);
  50. }
  51. #ifndef IGL_STATIC_LIBRARY
  52. # include "isolines.cpp"
  53. #endif
  54. #endif