Skip to content

Commit

Permalink
Multimaterial purging lines fixed on rectangular beds with non-standa…
Browse files Browse the repository at this point in the history
…rd origin (#3805)
  • Loading branch information
lukasmatena committed Mar 11, 2020
1 parent e6b0be9 commit a6a7736
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ std::string WipeTowerIntegration::append_tcr(GCode &gcodegen, const WipeTower::T

std::string gcode;

// Toolchangeresult.gcode assumes the wipe tower corner is at the origin
// Toolchangeresult.gcode assumes the wipe tower corner is at the origin (except for priming lines)
// We want to rotate and shift all extrusions (gcode postprocessing) and starting and ending position
float alpha = m_wipe_tower_rotation/180.f * float(M_PI);
Vec2f start_pos = tcr.start_pos;
Expand Down
5 changes: 5 additions & 0 deletions src/libslic3r/GCode/WipeTower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ WipeTower::WipeTower(const PrintConfig& config, const std::vector<std::vector<fl
const std::vector<Vec2d>& bed_points = config.bed_shape.values;
m_bed_shape = (bed_points.size() == 4 ? RectangularBed : CircularBed);
m_bed_width = float(BoundingBoxf(bed_points).size().x());
m_bed_bottom_left = m_bed_shape == RectangularBed
? Vec2f(bed_points.front().x(), bed_points.front().y())
: Vec2f::Zero();
}


Expand Down Expand Up @@ -566,6 +569,8 @@ std::vector<WipeTower::ToolChangeResult> WipeTower::prime(
// In case of a circular bed, place it so it goes across the diameter and hope it will fit
if (m_bed_shape == CircularBed)
cleaning_box.translate(-m_bed_width/2 + m_bed_width * 0.03f, -m_bed_width * 0.12f);
if (m_bed_shape == RectangularBed)
cleaning_box.translate(m_bed_bottom_left);

std::vector<ToolChangeResult> results;

Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/GCode/WipeTower.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class WipeTower
CircularBed
} m_bed_shape;
float m_bed_width; // width of the bed bounding box
Vec2f m_bed_bottom_left; // bottom-left corner coordinates (for rectangular beds)

float m_perimeter_width = 0.4f * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill.
float m_extrusion_flow = 0.038f; //0.029f;// Extrusion flow is derived from m_perimeter_width, layer height and filament diameter.
Expand Down

0 comments on commit a6a7736

Please sign in to comment.