FIX:not limit bounding box in assembly view
jira: none Change-Id: I9b6113c815563cb2ded2c19b62286cdf6b509913
This commit is contained in:
parent
dbe2e5325d
commit
d0e91b5164
|
@ -1577,15 +1577,18 @@ BoundingBoxf3 GLCanvas3D::volumes_bounding_box() const
|
||||||
{
|
{
|
||||||
BoundingBoxf3 bb;
|
BoundingBoxf3 bb;
|
||||||
BoundingBoxf3 expand_part_plate_list_box;
|
BoundingBoxf3 expand_part_plate_list_box;
|
||||||
|
bool is_limit = m_canvas_type != ECanvasType::CanvasAssembleView;
|
||||||
|
if (is_limit) {
|
||||||
auto plate_list_box = wxGetApp().plater()->get_partplate_list().get_bounding_box();
|
auto plate_list_box = wxGetApp().plater()->get_partplate_list().get_bounding_box();
|
||||||
auto horizontal_radius = 0.5 * sqrt(std::pow(plate_list_box.min[0] - plate_list_box.max[0], 2) + std::pow(plate_list_box.min[1] - plate_list_box.max[1], 2));
|
auto horizontal_radius = 0.5 * sqrt(std::pow(plate_list_box.min[0] - plate_list_box.max[0], 2) + std::pow(plate_list_box.min[1] - plate_list_box.max[1], 2));
|
||||||
const float scale = 2;
|
const float scale = 2;
|
||||||
expand_part_plate_list_box.merge(plate_list_box.min - scale * Vec3d(horizontal_radius, horizontal_radius, 0));
|
expand_part_plate_list_box.merge(plate_list_box.min - scale * Vec3d(horizontal_radius, horizontal_radius, 0));
|
||||||
expand_part_plate_list_box.merge(plate_list_box.max + scale * Vec3d(horizontal_radius, horizontal_radius, 0));
|
expand_part_plate_list_box.merge(plate_list_box.max + scale * Vec3d(horizontal_radius, horizontal_radius, 0));
|
||||||
|
}
|
||||||
for (const GLVolume *volume : m_volumes.volumes) {
|
for (const GLVolume *volume : m_volumes.volumes) {
|
||||||
if (!m_apply_zoom_to_volumes_filter || ((volume != nullptr) && volume->zoom_to_volumes)) {
|
if (!m_apply_zoom_to_volumes_filter || ((volume != nullptr) && volume->zoom_to_volumes)) {
|
||||||
const auto v_bb = volume->transformed_bounding_box();
|
const auto v_bb = volume->transformed_bounding_box();
|
||||||
if (!expand_part_plate_list_box.overlap(v_bb))
|
if (is_limit && !expand_part_plate_list_box.overlap(v_bb))
|
||||||
continue;
|
continue;
|
||||||
bb.merge(v_bb);
|
bb.merge(v_bb);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue