diff --git a/libs/geom/include/psemek/geom/mesh.hpp b/libs/geom/include/psemek/geom/mesh.hpp index ac904be9..bc5cbdd4 100644 --- a/libs/geom/include/psemek/geom/mesh.hpp +++ b/libs/geom/include/psemek/geom/mesh.hpp @@ -28,11 +28,11 @@ namespace psemek::geom } template - std::vector> edges(box const &) + std::vector> edges(box const &) { static_assert(N > 0); // who knows?.. - std::vector> result; + std::vector> result; for (std::size_t i = 0; i < N; ++i) { @@ -51,4 +51,17 @@ namespace psemek::geom return result; } + template + std::vector> triangulate_convex(std::vector const & v) + { + std::vector> result; + + for (std::size_t i = 1; i + 1 < v.size(); ++i) + { + result.push_back({static_cast(0), static_cast(i), static_cast(i + 1)}); + } + + return result; + } + }