mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 23:35:52 +08:00
Follow-up of 7150e0adda2673797b624e314782a81ca8279bb7 - Fix in clamping max bounding box to avoid z-fighting in gcode preview
This commit is contained in:
parent
7d1a91bfe9
commit
3633112148
@ -5025,9 +5025,9 @@ BoundingBoxf3 GLCanvas3D::_max_bounding_box(bool include_gizmos, bool include_be
|
|||||||
|
|
||||||
// clamp max bb size with respect to bed bb size
|
// clamp max bb size with respect to bed bb size
|
||||||
if (!m_picking_enabled) {
|
if (!m_picking_enabled) {
|
||||||
static const double max_scale_factor = 1.5;
|
static const double max_scale_factor = 2.0;
|
||||||
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 = m_bed.build_volume().bounding_volume().size();
|
||||||
if (bb_size.x() > max_scale_factor * bed_bb_size.x() ||
|
if (bb_size.x() > max_scale_factor * bed_bb_size.x() ||
|
||||||
bb_size.y() > max_scale_factor * bed_bb_size.y() ||
|
bb_size.y() > max_scale_factor * bed_bb_size.y() ||
|
||||||
bb_size.z() > max_scale_factor * bed_bb_size.z()) {
|
bb_size.z() > max_scale_factor * bed_bb_size.z()) {
|
||||||
@ -5037,6 +5037,9 @@ BoundingBoxf3 GLCanvas3D::_max_bounding_box(bool include_gizmos, bool include_be
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
std::cout << to_string(bb.size()) << "\n";
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
return bb;
|
return bb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user