Merge branch 'main' into dev/p2s-pr

# Conflicts:
#	src/slic3r/GUI/DeviceErrorDialog.cpp
This commit is contained in:
Noisyfox
2025-11-09 12:35:32 +08:00
48 changed files with 3533 additions and 3528 deletions

View File

@@ -34,6 +34,7 @@
#include "DailyTips.hpp"
#include "FilamentMapDialog.hpp"
#include "slic3r/GUI/CameraUtils.hpp"
#include "slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp"
#include "slic3r/Utils/UndoRedo.hpp"
#include "slic3r/Utils/MacDarkMode.hpp"
@@ -4694,6 +4695,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
m_camera_movement = true;
m_mouse.drag.start_position_2D = pos;
m_mouse.drag.move_start_threshold_position_2D = pos;
}
}
else if ((evt.LeftUp() || evt.MiddleUp() || evt.RightUp()) ||
@@ -9376,12 +9378,18 @@ Vec3d GLCanvas3D::_mouse_to_3d(const Point& mouse_pos, float* z)
if (m_canvas == nullptr)
return Vec3d(DBL_MAX, DBL_MAX, DBL_MAX);
const Camera& camera = wxGetApp().plater()->get_camera();
if (z == nullptr) {
const SceneRaycaster::HitResult hit = m_scene_raycaster.hit(mouse_pos.cast<double>(), wxGetApp().plater()->get_camera(), nullptr);
const SceneRaycaster::HitResult hit = m_scene_raycaster.hit(mouse_pos.cast<double>(), camera, nullptr);
return hit.is_valid() ? hit.position.cast<double>() : _mouse_to_bed_3d(mouse_pos);
}
// Orca: Handling of the particular case, if we want to get the position for Z = 0
else if (is_approx(static_cast<double>(*z), 0.)) {
Vec2d position = CameraUtils::get_z0_position(camera, Vec2d(mouse_pos.x(), mouse_pos.y()));
return Vec3d(position.x(), position.y(), *z);
}
else {
const Camera& camera = wxGetApp().plater()->get_camera();
const Vec4i32 viewport(camera.get_viewport().data());
Vec3d out;
igl::unproject(Vec3d(mouse_pos.x(), viewport[3] - mouse_pos.y(), *z), camera.get_view_matrix().matrix(), camera.get_projection_matrix().matrix(), viewport, out);
@@ -10068,7 +10076,7 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
std::string objName2 = m_gcode_viewer.m_conflict_result.value()._objName2;
double height = m_gcode_viewer.m_conflict_result.value()._height;
int layer = m_gcode_viewer.m_conflict_result.value().layer;
text = (boost::format(_u8L("Conflicts of G-code paths have been found at layer %d, z = %.2lf mm. Please separate the conflicted objects farther (%s <-> %s).")) % layer %
text = (boost::format(_u8L("Conflicts of G-code paths have been found at layer %d, Z = %.2lfmm. Please separate the conflicted objects farther (%s <-> %s).")) % layer %
height % objName1 % objName2)
.str();
prevConflictText = text;
@@ -10134,7 +10142,7 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
text += (boost::format(_u8L("Filament %s is placed in the %s, but the generated G-code path exceeds the printable range of the %s.")) %filaments %extruder_name %extruder_name).str();
}
else {
text += (boost::format(_u8L("Filaments %s is placed in the %s, but the generated G-code path exceeds the printable range of the %s.")) %filaments %extruder_name %extruder_name).str();
text += (boost::format(_u8L("Filaments %s are placed in the %s, but the generated G-code path exceeds the printable range of the %s.")) %filaments %extruder_name %extruder_name).str();
}
}
error = ErrorType::SLICING_LIMIT_ERROR;
@@ -10186,7 +10194,7 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
if (error_iter->second.size() == 1) {
text += (boost::format(_u8L("Filament %s is placed in the %s, but the generated G-code path exceeds the printable height of the %s.")) % filaments % extruder_name % extruder_name).str();
} else {
text += (boost::format(_u8L("Filaments %s is placed in the %s, but the generated G-code path exceeds the printable height of the %s.")) % filaments % extruder_name % extruder_name).str();
text += (boost::format(_u8L("Filaments %s are placed in the %s, but the generated G-code path exceeds the printable height of the %s.")) % filaments % extruder_name % extruder_name).str();
}
}
if (!text.empty()) {