Merge tag 'version_2.7.2' into master_27x

version_2.7.2
This commit is contained in:
Lukas Matena 2024-02-29 21:05:49 +01:00
commit 29ce2faa4a
8 changed files with 2417 additions and 2304 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2255,7 +2255,7 @@ LayerResult GCodeGenerator::process_layer(
print.config().before_layer_gcode.value, m_writer.extruder()->id(), &config) print.config().before_layer_gcode.value, m_writer.extruder()->id(), &config)
+ "\n"; + "\n";
} }
gcode += this->change_layer(previous_layer_z, print_z); // this will increase m_layer_index gcode += this->change_layer(previous_layer_z, print_z, result.spiral_vase_enable); // this will increase m_layer_index
m_layer = &layer; m_layer = &layer;
if (this->line_distancer_is_required(layer_tools.extruders) && this->m_layer != nullptr && this->m_layer->lower_layer != nullptr) if (this->line_distancer_is_required(layer_tools.extruders) && this->m_layer != nullptr && this->m_layer->lower_layer != nullptr)
m_travel_obstacle_tracker.init_layer(layer, layers); m_travel_obstacle_tracker.init_layer(layer, layers);
@ -2439,7 +2439,7 @@ LayerResult GCodeGenerator::process_layer(
}}; }};
bool removed_retraction{false}; bool removed_retraction{false};
if (this->m_config.travel_ramping_lift.get_at(*m_layer_change_extruder_id)) { if (this->m_config.travel_ramping_lift.get_at(*m_layer_change_extruder_id) && !result.spiral_vase_enable) {
const std::string retraction_start_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change_Retraction_Start); const std::string retraction_start_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change_Retraction_Start);
const std::string retraction_end_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change_Retraction_End); const std::string retraction_end_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change_Retraction_End);
@ -2453,6 +2453,7 @@ LayerResult GCodeGenerator::process_layer(
gcode.replace(start, end - start, ""); gcode.replace(start, end - start, "");
layer_change_gcode = this->get_layer_change_gcode(*m_previous_layer_last_position_before_wipe, *m_current_layer_first_position, *m_layer_change_extruder_id); layer_change_gcode = this->get_layer_change_gcode(*m_previous_layer_last_position_before_wipe, *m_current_layer_first_position, *m_layer_change_extruder_id);
removed_retraction = true; removed_retraction = true;
} }
} }
@ -2774,7 +2775,8 @@ std::string GCodeGenerator::preamble()
// called by GCodeGenerator::process_layer() // called by GCodeGenerator::process_layer()
std::string GCodeGenerator::change_layer( std::string GCodeGenerator::change_layer(
coordf_t previous_layer_z, coordf_t previous_layer_z,
coordf_t print_z coordf_t print_z,
bool vase_mode
) { ) {
std::string gcode; std::string gcode;
if (m_layer_count > 0) if (m_layer_count > 0)
@ -2783,7 +2785,7 @@ std::string GCodeGenerator::change_layer(
if (!EXTRUDER_CONFIG(travel_ramping_lift) && EXTRUDER_CONFIG(retract_layer_change)) { if (!EXTRUDER_CONFIG(travel_ramping_lift) && EXTRUDER_CONFIG(retract_layer_change)) {
gcode += this->retract_and_wipe(); gcode += this->retract_and_wipe();
} else if (EXTRUDER_CONFIG(travel_ramping_lift)){ } else if (EXTRUDER_CONFIG(travel_ramping_lift) && !vase_mode){
m_previous_layer_last_position_before_wipe = this->last_position ? m_previous_layer_last_position_before_wipe = this->last_position ?
std::optional{to_3d(this->point_to_gcode(*this->last_position), previous_layer_z)} : std::optional{to_3d(this->point_to_gcode(*this->last_position), previous_layer_z)} :
std::nullopt; std::nullopt;
@ -3062,7 +3064,7 @@ void GCodeGenerator::GCodeOutputStream::write_format(const char* format, ...)
va_end(args); va_end(args);
} }
std::string GCodeGenerator::travel_to_first_position(const Vec3crd& point) { std::string GCodeGenerator::travel_to_first_position(const Vec3crd& point, const double from_z) {
std::string gcode; std::string gcode;
const Vec3d gcode_point = to_3d(this->point_to_gcode(point.head<2>()), unscaled(point.z())); const Vec3d gcode_point = to_3d(this->point_to_gcode(point.head<2>()), unscaled(point.z()));
@ -3080,7 +3082,7 @@ std::string GCodeGenerator::travel_to_first_position(const Vec3crd& point) {
if (EXTRUDER_CONFIG(retract_length) > 0 && (!this->last_position || (!EXTRUDER_CONFIG(travel_ramping_lift)))) { if (EXTRUDER_CONFIG(retract_length) > 0 && (!this->last_position || (!EXTRUDER_CONFIG(travel_ramping_lift)))) {
if (!this->last_position || EXTRUDER_CONFIG(retract_before_travel) < (this->point_to_gcode(*this->last_position) - gcode_point.head<2>()).norm()) { if (!this->last_position || EXTRUDER_CONFIG(retract_before_travel) < (this->point_to_gcode(*this->last_position) - gcode_point.head<2>()).norm()) {
gcode += this->writer().retract(); gcode += this->writer().retract();
gcode += this->writer().get_travel_to_z_gcode(gcode_point.z() + lift, "lift"); gcode += this->writer().get_travel_to_z_gcode(from_z + lift, "lift");
} }
} }
this->last_position = point.head<2>(); this->last_position = point.head<2>();
@ -3119,7 +3121,7 @@ std::string GCodeGenerator::_extrude(
if (!m_current_layer_first_position) { if (!m_current_layer_first_position) {
const Vec3crd point = to_3d(path.front().point, scaled(this->m_last_layer_z)); const Vec3crd point = to_3d(path.front().point, scaled(this->m_last_layer_z));
gcode += this->travel_to_first_position(point); gcode += this->travel_to_first_position(point, unscaled(point.z()));
} else { } else {
// go to first point of extrusion path // go to first point of extrusion path
if (!this->last_position) { if (!this->last_position) {

View File

@ -266,7 +266,8 @@ private:
std::string preamble(); std::string preamble();
std::string change_layer( std::string change_layer(
coordf_t previous_layer_z, coordf_t previous_layer_z,
coordf_t print_z coordf_t print_z,
bool vase_mode
); );
std::string extrude_entity(const ExtrusionEntityReference &entity, const GCode::SmoothPathCache &smooth_path_cache, const std::string_view description, double speed = -1.); std::string extrude_entity(const ExtrusionEntityReference &entity, const GCode::SmoothPathCache &smooth_path_cache, const std::string_view description, double speed = -1.);
std::string extrude_loop(const ExtrusionLoop &loop, const GCode::SmoothPathCache &smooth_path_cache, const std::string_view description, double speed = -1.); std::string extrude_loop(const ExtrusionLoop &loop, const GCode::SmoothPathCache &smooth_path_cache, const std::string_view description, double speed = -1.);
@ -333,7 +334,7 @@ private:
const std::string &comment const std::string &comment
); );
std::string travel_to_first_position(const Vec3crd& point); std::string travel_to_first_position(const Vec3crd& point, const double from_z);
bool needs_retraction(const Polyline &travel, ExtrusionRole role = ExtrusionRole::None); bool needs_retraction(const Polyline &travel, ExtrusionRole role = ExtrusionRole::None);

View File

@ -72,7 +72,7 @@ std::string WipeTowerIntegration::append_tcr(GCodeGenerator &gcodegen, const Wip
} }
} else { } else {
const Vec3crd point = to_3d(xy_point, scaled(z)); const Vec3crd point = to_3d(xy_point, scaled(z));
gcode += gcodegen.travel_to_first_position(point); gcode += gcodegen.travel_to_first_position(point, current_z);
} }
gcode += gcodegen.unretract(); gcode += gcodegen.unretract();
} else { } else {
@ -93,8 +93,12 @@ std::string WipeTowerIntegration::append_tcr(GCodeGenerator &gcodegen, const Wip
gcodegen.m_wipe.reset_path(); // We don't want wiping on the ramming lines. gcodegen.m_wipe.reset_path(); // We don't want wiping on the ramming lines.
toolchange_gcode_str = gcodegen.set_extruder(new_extruder_id, tcr.print_z); // TODO: toolchange_z vs print_z toolchange_gcode_str = gcodegen.set_extruder(new_extruder_id, tcr.print_z); // TODO: toolchange_z vs print_z
if (gcodegen.config().wipe_tower) { if (gcodegen.config().wipe_tower) {
const double retract_to_z = tcr.priming ? tcr.print_z + gcodegen.config().z_offset.value : z; if (tcr.priming) {
deretraction_str += gcodegen.writer().get_travel_to_z_gcode(retract_to_z, "restore layer Z"); const double return_to_z{tcr.print_z + gcodegen.config().z_offset.value};
deretraction_str += gcodegen.writer().get_travel_to_z_gcode(return_to_z, "set priming layer Z");
} else {
deretraction_str += gcodegen.writer().travel_to_z(z, "restore layer Z");
}
deretraction_str += gcodegen.unretract(); deretraction_str += gcodegen.unretract();
} }
} }

View File

@ -433,7 +433,11 @@ bool Model::looks_like_multipart_object() const
return false; return false;
BoundingBoxf3 bb_this = obj->volumes[0]->mesh().bounding_box(); BoundingBoxf3 bb_this = obj->volumes[0]->mesh().bounding_box();
BoundingBoxf3 tbb_this = obj->instances[0]->transform_bounding_box(bb_this);
// FIXME: There is sadly the case when instances are empty (AMF files). The normalization of instances in that
// case is performed only after this function is called. For now (shortly before the 2.7.2 release, let's
// just do this non-invasive check. Reordering all the functions could break it much more.
BoundingBoxf3 tbb_this = (! obj->instances.empty() ? obj->instances[0]->transform_bounding_box(bb_this) : bb_this);
if (!tbb.defined) if (!tbb.defined)
tbb = tbb_this; tbb = tbb_this;

View File

@ -924,9 +924,9 @@ void GUI_App::init_app_config()
{ {
// Profiles for the alpha are stored into the PrusaSlicer-alpha directory to not mix with the current release. // Profiles for the alpha are stored into the PrusaSlicer-alpha directory to not mix with the current release.
// SetAppName(SLIC3R_APP_KEY); SetAppName(SLIC3R_APP_KEY);
// SetAppName(SLIC3R_APP_KEY "-alpha"); // SetAppName(SLIC3R_APP_KEY "-alpha");
SetAppName(SLIC3R_APP_KEY "-beta"); // SetAppName(SLIC3R_APP_KEY "-beta");
// SetAppDisplayName(SLIC3R_APP_NAME); // SetAppDisplayName(SLIC3R_APP_NAME);

View File

@ -3,7 +3,7 @@
set(SLIC3R_APP_NAME "PrusaSlicer") set(SLIC3R_APP_NAME "PrusaSlicer")
set(SLIC3R_APP_KEY "PrusaSlicer") set(SLIC3R_APP_KEY "PrusaSlicer")
set(SLIC3R_VERSION "2.7.2-beta1") set(SLIC3R_VERSION "2.7.2")
set(SLIC3R_BUILD_ID "PrusaSlicer-${SLIC3R_VERSION}+UNKNOWN") set(SLIC3R_BUILD_ID "PrusaSlicer-${SLIC3R_VERSION}+UNKNOWN")
set(SLIC3R_RC_VERSION "2,7,2,0") set(SLIC3R_RC_VERSION "2,7,2,0")
set(SLIC3R_RC_VERSION_DOTS "2.7.2.0") set(SLIC3R_RC_VERSION_DOTS "2.7.2.0")