From 621ec86dbe71aee601e97968bf2d366d6dc727d3 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 13 Jun 2022 15:34:31 +0200 Subject: [PATCH] Equip boost adapter with extensive 3D bounding box support --- src/libslic3r/BoostAdapter.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/libslic3r/BoostAdapter.hpp b/src/libslic3r/BoostAdapter.hpp index 3144ae201..36256213f 100644 --- a/src/libslic3r/BoostAdapter.hpp +++ b/src/libslic3r/BoostAdapter.hpp @@ -96,6 +96,36 @@ struct indexed_access { } }; +template using BB3 = Slic3r::BoundingBox3Base>; + +template struct tag> { + using type = box_tag; +}; + +template struct point_type> { + using type = Slic3r::Vec<3, T>; +}; + +template +struct indexed_access, 0, d> { + static inline coord_t get(BB3 const& box) { + return box.min(d); + } + static inline void set(BB3 &box, coord_t const& coord) { + box.min(d) = coord; + } +}; + +template +struct indexed_access, 1, d> { + static inline coord_t get(BB3 const& box) { + return box.max(d); + } + static inline void set(BB3 &box, coord_t const& coord) { + box.max(d) = coord; + } +}; + } }