FIX:add "printable_bounding_box" api

jira: STUDIO-13765
Change-Id: I748ad0371ce80a3ac1a7774fea14d47beb79a187
(cherry picked from commit 1368c67499a0d0f273c824e916bf66980a526203)
This commit is contained in:
zhou.xu
2025-08-01 11:50:59 +08:00
committed by Noisyfox
parent 59c2e222d8
commit 3bfeb2dc0b
3 changed files with 27 additions and 28 deletions

View File

@@ -100,6 +100,7 @@ private:
std::string m_model_filename;
// Print volume bounding box exteded with axes and model.
BoundingBoxf3 m_extended_bounding_box;
BoundingBoxf3 m_printable_bounding_box;
// Slightly expanded print bed polygon, for collision detection.
//Polygon m_polygon;
GLModel m_triangles;
@@ -148,6 +149,7 @@ public:
// Bounding box around the print bed, axes and model, for rendering.
const BoundingBoxf3& extended_bounding_box() const { return m_extended_bounding_box; }
const BoundingBoxf3 &printable_bounding_box() const { return m_printable_bounding_box; }
// Check against an expanded 2d bounding box.
//FIXME shall one check against the real build volume?
@@ -161,7 +163,8 @@ public:
private:
//BBS: add partplate related logic
// Calculate an extended bounding box from axes and current model for visualization purposes.
BoundingBoxf3 calc_extended_bounding_box(bool consider_model_offset = true) const;
BoundingBoxf3 calc_printable_bounding_box() const;
BoundingBoxf3 calc_extended_bounding_box() const;
void update_model_offset();
//BBS: with offset
void update_bed_triangles();