mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-03 09:25:12 +08:00
Fix wrong travel before printing first skirt point (#9179)
Fix wrong travel before printing first skirt point (SoftFever/OrcaSlicer#9109) don't modify `last_pos`, otherwise it could move out of plate/to wrong places and cause issue
This commit is contained in:
parent
abcd6e7847
commit
74df3a450b
@ -3556,12 +3556,15 @@ std::string GCode::generate_skirt(const Print &print,
|
|||||||
path.mm3_per_mm = mm3_per_mm;
|
path.mm3_per_mm = mm3_per_mm;
|
||||||
}
|
}
|
||||||
|
|
||||||
//set skirt start point location
|
|
||||||
if (first_layer && i==loops.first)
|
|
||||||
this->set_last_pos(Skirt::find_start_point(loop, layer.object()->config().skirt_start_angle));
|
|
||||||
|
|
||||||
//FIXME using the support_speed of the 1st object printed.
|
//FIXME using the support_speed of the 1st object printed.
|
||||||
|
if (first_layer && i==loops.first) {
|
||||||
|
//set skirt start point location
|
||||||
|
const Point desired_start_point = Skirt::find_start_point(loop, layer.object()->config().skirt_start_angle);
|
||||||
|
gcode += this->extrude_loop(loop, "skirt", m_config.support_speed.value, {}, &desired_start_point);
|
||||||
|
}
|
||||||
|
else
|
||||||
gcode += this->extrude_loop(loop, "skirt", m_config.support_speed.value);
|
gcode += this->extrude_loop(loop, "skirt", m_config.support_speed.value);
|
||||||
|
|
||||||
// If we only want a single wall on non-first layers, break now
|
// If we only want a single wall on non-first layers, break now
|
||||||
if (!first_layer && print.m_config.single_loop_draft_shield) {
|
if (!first_layer && print.m_config.single_loop_draft_shield) {
|
||||||
break;
|
break;
|
||||||
@ -4632,7 +4635,7 @@ static std::unique_ptr<EdgeGrid::Grid> calculate_layer_edge_grid(const Layer& la
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, double speed, const ExtrusionEntitiesPtr& region_perimeters)
|
std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, double speed, const ExtrusionEntitiesPtr& region_perimeters, const Point* start_point)
|
||||||
{
|
{
|
||||||
|
|
||||||
// get a copy; don't modify the orientation of the original loop object otherwise
|
// get a copy; don't modify the orientation of the original loop object otherwise
|
||||||
@ -4648,12 +4651,13 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
|
|||||||
// loop.reverse();
|
// loop.reverse();
|
||||||
|
|
||||||
// find the point of the loop that is closest to the current extruder position
|
// find the point of the loop that is closest to the current extruder position
|
||||||
// or randomize if requested
|
// or randomize if requested;
|
||||||
Point last_pos = this->last_pos();
|
// or, if `start_point` is specified, start the loop at point closest to it
|
||||||
|
Point last_pos = start_point ? *start_point : this->last_pos();
|
||||||
float seam_overhang = std::numeric_limits<float>::lowest();
|
float seam_overhang = std::numeric_limits<float>::lowest();
|
||||||
if (!m_config.spiral_mode && description == "perimeter") {
|
if (!m_config.spiral_mode && description == "perimeter") {
|
||||||
assert(m_layer != nullptr);
|
assert(m_layer != nullptr);
|
||||||
m_seam_placer.place_seam(m_layer, loop, this->last_pos(), seam_overhang);
|
m_seam_placer.place_seam(m_layer, loop, last_pos, seam_overhang);
|
||||||
} else
|
} else
|
||||||
loop.split_at(last_pos, false);
|
loop.split_at(last_pos, false);
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ private:
|
|||||||
std::string extrude_entity(const ExtrusionEntity &entity, std::string description = "", double speed = -1., const ExtrusionEntitiesPtr& region_perimeters = ExtrusionEntitiesPtr());
|
std::string extrude_entity(const ExtrusionEntity &entity, std::string description = "", double speed = -1., const ExtrusionEntitiesPtr& region_perimeters = ExtrusionEntitiesPtr());
|
||||||
// Orca: pass the complete collection of region perimeters to the extrude loop to check whether the wipe before external loop
|
// Orca: pass the complete collection of region perimeters to the extrude loop to check whether the wipe before external loop
|
||||||
// should be executed
|
// should be executed
|
||||||
std::string extrude_loop(ExtrusionLoop loop, std::string description, double speed = -1., const ExtrusionEntitiesPtr& region_perimeters = ExtrusionEntitiesPtr());
|
std::string extrude_loop(ExtrusionLoop loop, std::string description, double speed = -1., const ExtrusionEntitiesPtr& region_perimeters = ExtrusionEntitiesPtr(), const Point* start_point = nullptr);
|
||||||
std::string extrude_multi_path(ExtrusionMultiPath multipath, std::string description = "", double speed = -1.);
|
std::string extrude_multi_path(ExtrusionMultiPath multipath, std::string description = "", double speed = -1.);
|
||||||
std::string extrude_path(ExtrusionPath path, std::string description = "", double speed = -1.);
|
std::string extrude_path(ExtrusionPath path, std::string description = "", double speed = -1.);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user