mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 05:35:59 +08:00
Add missing point to the rectangular travel
This commit is contained in:
parent
aa5573e8b9
commit
0b4e406b28
@ -3321,7 +3321,7 @@ std::string GCodeGenerator::generate_travel_gcode(
|
||||
gcode += this->m_writer.set_travel_acceleration(acceleration);
|
||||
|
||||
Vec3d previous_point{this->point_to_gcode(travel.front())};
|
||||
for (const Vec3crd& point : tcb::span{travel}.subspan(1)) {
|
||||
for (const Vec3crd& point : travel) {
|
||||
const Vec3d gcode_point{this->point_to_gcode(point)};
|
||||
|
||||
gcode += this->m_writer.travel_to_xyz(previous_point, gcode_point, comment);
|
||||
|
@ -433,7 +433,6 @@ Points3 generate_travel_to_extrusion(
|
||||
elevation_params.slope_end + elevation_params.blend_width / 2.0,
|
||||
elevation_params.parabola_points_count
|
||||
);
|
||||
|
||||
Points3 result{generate_elevated_travel(
|
||||
xy_path.points, ensure_points_at_distances, initial_elevation,
|
||||
ElevatedTravelFormula{elevation_params}
|
||||
|
@ -14,7 +14,7 @@
|
||||
using namespace Slic3r;
|
||||
using namespace Test;
|
||||
|
||||
constexpr bool debug_files {true};
|
||||
constexpr bool debug_files {false};
|
||||
|
||||
void check_gcode(std::initializer_list<TestMesh> meshes, const DynamicPrintConfig& config, const unsigned duplicate) {
|
||||
constexpr std::size_t tools_count = 4;
|
||||
@ -32,6 +32,12 @@ void check_gcode(std::initializer_list<TestMesh> meshes, const DynamicPrintConfi
|
||||
Test::init_print({TestMesh::cube_20x20x20}, print, model, config, false, duplicate);
|
||||
std::string gcode = Test::gcode(print);
|
||||
|
||||
if constexpr(debug_files) {
|
||||
static int count{0};
|
||||
std::ofstream file{"check_gcode_" + std::to_string(count++) + ".gcode"};
|
||||
file << gcode;
|
||||
}
|
||||
|
||||
GCodeReader parser;
|
||||
parser.parse_buffer(gcode, [&] (Slic3r::GCodeReader &self, const Slic3r::GCodeReader::GCodeLine &line) {
|
||||
std::regex regex{"^T(\\d+)"};
|
||||
|
Loading…
x
Reference in New Issue
Block a user