Scale emulated spiral Z-hop segments based on slicing resolution (#11556)

Spiral Z-Hop resolution

Use slicing resolution to determine segment count for emulated spiral Z-hop

What’s changed

The number of linear segments used to approximate a spiral Z-hop is now derived from the PrintConfig resolution value.

The segment count is clamped to a safe range (4–24) to avoid excessive G-code generation or MCU queue overflow.

Why

Previously a fixed 24 segments were always used, regardless of model resolution.

For small-radius spiral lifts this was excessive and could overwhelm some printers.

Adapting segment count to resolution ensures smooth motion where needed, but lighter G-code where possible.

Details

m_resolution is now stored via apply_print_config().

_spiral_travel_to_z() uses this value to compute segment count dynamically.

Only the linear-segment fallback path is affected; G2/G3 arc-fitting remains unchanged.
This commit is contained in:
Kiss Lorand
2025-12-18 14:30:41 +02:00
committed by GitHub
parent 0e6fc7a92b
commit f9d5519294
2 changed files with 16 additions and 2 deletions

View File

@@ -168,6 +168,9 @@ public:
//BBS: x, y offset for gcode generated
double m_x_offset{ 0 };
double m_y_offset{ 0 };
// Orca: slicing resolution in mm
double m_resolution = 0.01;
std::string m_gcode_label_objects_start;
std::string m_gcode_label_objects_end;