mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 22:46:01 +08:00
Follow-up of f2a7245f365570660b85755003b45cc448117c76 - Apply clamping max bounding box to avoid z-fighting only in gcode preview
This commit is contained in:
parent
7a3f71331d
commit
7150e0adda
@ -5001,6 +5001,7 @@ BoundingBoxf3 GLCanvas3D::_max_bounding_box(bool include_gizmos, bool include_be
|
|||||||
bb.merge(m_gcode_viewer.get_max_bounding_box());
|
bb.merge(m_gcode_viewer.get_max_bounding_box());
|
||||||
|
|
||||||
// clamp max bb size with respect to bed bb size
|
// clamp max bb size with respect to bed bb size
|
||||||
|
if (!m_picking_enabled) {
|
||||||
static const double max_scale_factor = 1.5;
|
static const double max_scale_factor = 1.5;
|
||||||
const Vec3d bb_size = bb.size();
|
const Vec3d bb_size = bb.size();
|
||||||
const Vec3d bed_bb_size = bed_bb.size();
|
const Vec3d bed_bb_size = bed_bb.size();
|
||||||
@ -5011,6 +5012,7 @@ BoundingBoxf3 GLCanvas3D::_max_bounding_box(bool include_gizmos, bool include_be
|
|||||||
const Vec3d extend_by = max_scale_factor * bed_bb_size;
|
const Vec3d extend_by = max_scale_factor * bed_bb_size;
|
||||||
bb = BoundingBoxf3(bed_bb_center - extend_by, bed_bb_center + extend_by);
|
bb = BoundingBoxf3(bed_bb_center - extend_by, bed_bb_center + extend_by);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return bb;
|
return bb;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user