Compare commits

..

1 Commits

Author SHA1 Message Date
Ioannis Giannakas
1388dc5da8 Reduce Spiral Z generation segment density (#12564) 2026-05-22 10:46:00 +01:00
3 changed files with 9 additions and 21 deletions

View File

@@ -864,10 +864,10 @@ std::string GCodeWriter::_spiral_travel_to_z(double z, const Vec2d &ij_offset, c
// Determine number of segments based on Resolution
// --------------------------------------------------------------------
const double ref_resolution = 0.01; // reference resolution in mm
const double ref_segments = 16.0; // reference number of segments at reference resolution
const double ref_segments = 8.0; // reference number of segments at reference resolution
// number of linear segments to use for approximating the arc, clamp between 4 and 24
const int segments = std::clamp(int(std::round(ref_segments * (ref_resolution / m_resolution))), 4, 24);
// number of linear segments to use for approximating the arc, clamp between 4 and 16
const int segments = std::clamp(int(std::round(ref_segments * (ref_resolution / m_resolution))), 4, 16);
// --------------------------------------------------------------------
const double px = m_pos(0) - m_x_offset; // take plate offset into consideration

View File

@@ -338,15 +338,7 @@ void FilamentGroupPopup::OnRadioBtn(int idx)
}
}
void FilamentGroupPopup::OnTimer(wxTimerEvent&)
{
if (IsMouseInPopup()) {
StartTimer();
return;
}
Dismiss();
}
void FilamentGroupPopup::OnTimer(wxTimerEvent &event) { Dismiss(); }
void FilamentGroupPopup::Dismiss() {
m_active = false;
@@ -356,22 +348,19 @@ void FilamentGroupPopup::Dismiss() {
void FilamentGroupPopup::OnLeaveWindow(wxMouseEvent &)
{
if (this->GetScreenRect().Contains(wxGetMousePosition())) return;
wxPoint pos = this->ScreenToClient(wxGetMousePosition());
if (this->GetClientRect().Contains(pos)) return;
StartTimer();
}
void FilamentGroupPopup::OnEnterWindow(wxMouseEvent &)
{
// Ignore spurious ENTER synthesized by PopupWindow::OnMouseEvent2 on macOS.
if (!this->GetScreenRect().Contains(wxGetMousePosition())) return;
wxPoint pos = this->ScreenToClient(wxGetMousePosition());
if (!this->GetClientRect().Contains(pos)) return;
ResetTimer();
}
bool FilamentGroupPopup::IsMouseInPopup() const
{
return this->GetScreenRect().Contains(wxGetMousePosition());
}
void FilamentGroupPopup::UpdateButtonStatus(int hover_idx)
{
for (int i = 0; i < ButtonType::btCount; ++i) {
@@ -405,4 +394,4 @@ void FilamentGroupPopup::UpdateButtonStatus(int hover_idx)
Fit();
}
}} // namespace Slic3r::GUI
}} // namespace Slic3r::GUI

View File

@@ -36,7 +36,6 @@ private:
void OnEnterWindow(wxMouseEvent &);
void OnTimer(wxTimerEvent &event);
void Dismiss();
bool IsMouseInPopup() const;
void CreateBmps();