triangle_wrapper.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@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_TRIANGLE_WRAPPER_H
  9. #define IGL_TRIANGLE_WRAPPER_H
  10. #include <igl/igl_inline.h>
  11. #include <string>
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. // Triangulate the interior of a polygon using the triangle library.
  16. //
  17. // Inputs:
  18. // V #V by 2 list of 2D vertex positions
  19. // E #E by 2 list of vertex ids forming unoriented edges of the boundary of the polygon
  20. // H #H by 2 coordinates of points contained inside holes of the polygon
  21. // Outputs:
  22. // V2 #V2 by 2 coordinates of the vertives of the generated triangulation
  23. // F2 #F2 by 3 list of indices forming the faces of the generated triangulation
  24. //
  25. // TODO: expose the option to prevent Steiner points on the boundary
  26. //
  27. IGL_INLINE void triangle_wrapper(
  28. const Eigen::MatrixXd& V,
  29. const Eigen::MatrixXi& E,
  30. const Eigen::MatrixXd& H,
  31. Eigen::MatrixXd& V2,
  32. Eigen::MatrixXi& F2,
  33. const std::string flags = std::string("q"));
  34. }
  35. #ifdef IGL_HEADER_ONLY
  36. # include "triangle_wrapper.cpp"
  37. #endif
  38. #endif