Merge branch 'master' into fs_emboss

# Conflicts:
#	src/slic3r/GUI/GLCanvas3D.cpp
This commit is contained in:
Filip Sykala - NTB T15p 2022-10-21 09:52:36 +02:00
commit e85e7a743b
2 changed files with 9 additions and 1 deletions

View File

@ -1356,6 +1356,9 @@ void GLCanvas3D::toggle_sla_auxiliaries_visibility(bool visible, const ModelObje
void GLCanvas3D::toggle_model_objects_visibility(bool visible, const ModelObject* mo, int instance_idx, const ModelVolume* mv)
{
#if ENABLE_RAYCAST_PICKING
std::vector<std::shared_ptr<SceneRaycasterItem>>* raycasters = get_raycasters_for_picking(SceneRaycaster::EType::Volume);
#endif // ENABLE_RAYCAST_PICKING
for (GLVolume* vol : m_volumes.volumes) {
if (vol->is_wipe_tower)
vol->is_active = (visible && mo == nullptr);
@ -1382,6 +1385,11 @@ void GLCanvas3D::toggle_model_objects_visibility(bool visible, const ModelObject
}
}
}
#if ENABLE_RAYCAST_PICKING
auto it = std::find_if(raycasters->begin(), raycasters->end(), [vol](std::shared_ptr<SceneRaycasterItem> item) { return item->get_raycaster() == vol->mesh_raycaster.get(); });
if (it != raycasters->end())
(*it)->set_active(vol->is_active);
#endif // ENABLE_RAYCAST_PICKING
}
if (visible && !mo)

View File

@ -182,7 +182,7 @@ void MeshClipper::recalculate_triangles()
// it so it lies on our line. This will be the figure to subtract
// from the cut. The coordinates must not overflow after the transform,
// make the rectangle a bit smaller.
const coord_t size = (std::numeric_limits<coord_t>::max() - scale_(std::max(std::abs(e*a), std::abs(e*b)))) / 4;
const coord_t size = (std::numeric_limits<coord_t>::max()/2 - scale_(std::max(std::abs(e * a), std::abs(e * b)))) / 4;
Polygons ep {Polygon({Point(-size, 0), Point(size, 0), Point(size, 2*size), Point(-size, 2*size)})};
ep.front().rotate(angle);
ep.front().translate(scale_(-e * a), scale_(-e * b));