diff --git a/libs/geom/include/psemek/geom/box.hpp b/libs/geom/include/psemek/geom/box.hpp index fb8149c0..c91bae2f 100644 --- a/libs/geom/include/psemek/geom/box.hpp +++ b/libs/geom/include/psemek/geom/box.hpp @@ -252,6 +252,14 @@ namespace psemek::geom return os; } + template + point clamp(point p, box const & b) + { + for (std::size_t i = 0; i < N; ++i) + p[i] = clamp(p[i], b[i]); + return p; + } + template box expand(box b, T const & d) {