mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-01 15:22:21 +00:00
Start work on print_pa_pattern
This commit is contained in:
@@ -436,18 +436,17 @@ std::string CalibPressureAdvancePattern::draw_box(double min_x, double min_y, do
|
|||||||
return gcode.str();
|
return gcode.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string CalibPressureAdvancePattern::print_pa_pattern(double start_x, double start_y, double start_pa, double step_pa, int num_patterns)
|
||||||
|
{
|
||||||
|
auto& writer = mp_gcodegen->writer();
|
||||||
|
std::stringstream gcode;
|
||||||
|
|
||||||
Point last_pos = mp_gcodegen.last_pos();
|
gcode << writer.travel_to_z(mp_gcodegen.config().initial_layer_print_height.value, "Move to start layer height");
|
||||||
const double length = get_distance(last_pos.x(), last_pos.y(), to_x, to_y);
|
gcode << move_to(Vec2d(start_x, start_y), "Move to start position");
|
||||||
auto dE = e_per_mm * length;
|
|
||||||
|
|
||||||
if (comment.empty()) {
|
writer.set_pressure_advance(0.0);
|
||||||
gcode << writer.extrude_to_xy(Vec2d(to_x, to_y), dE);
|
|
||||||
} else {
|
|
||||||
gcode << writer.extrude_to_xy(Vec2d(to_x, to_y), dE, comment);
|
|
||||||
}
|
|
||||||
|
|
||||||
return gcode.str();
|
// create anchor and line numbering frame
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
} // namespace Slic3r
|
} // namespace Slic3r
|
||||||
|
|||||||
Reference in New Issue
Block a user