SPE-1821 Fix issue with overhangs sometimes wrongly detected when using classic

Fix gcode export - remove empty lines
This commit is contained in:
Pavel 2023-07-24 16:41:15 +02:00 committed by Vojtech Bubnik
parent ec2caaec82
commit c74eb1abe0
3 changed files with 12 additions and 5 deletions

View File

@ -203,6 +203,13 @@ std::pair<float,float> calculate_overhang_speed(const ExtrusionAttributes &attri
float fan_speed = std::min(interpolate_speed(fan_speed_sections, attributes.overhang_attributes->start_distance_from_prev_layer), float fan_speed = std::min(interpolate_speed(fan_speed_sections, attributes.overhang_attributes->start_distance_from_prev_layer),
interpolate_speed(fan_speed_sections, attributes.overhang_attributes->end_distance_from_prev_layer)); interpolate_speed(fan_speed_sections, attributes.overhang_attributes->end_distance_from_prev_layer));
if (!config.enable_dynamic_overhang_speeds) {
final_speed = -1;
}
if (!config.enable_dynamic_fan_speeds.get_at(extruder_id)) {
fan_speed = -1;
}
return {final_speed, fan_speed}; return {final_speed, fan_speed};
} }

View File

@ -92,12 +92,12 @@ std::vector<ExtendedPoint> estimate_points_properties(const POINTS
const ExtendedPoint &curr = points[point_idx]; const ExtendedPoint &curr = points[point_idx];
const ExtendedPoint &next = points[point_idx + 1]; const ExtendedPoint &next = points[point_idx + 1];
if ((curr.distance > 0 && curr.distance < boundary_offset + 2.0f) || if ((curr.distance > -boundary_offset && curr.distance < boundary_offset + 2.0f) ||
(next.distance > 0 && next.distance < boundary_offset + 2.0f)) { (next.distance > -boundary_offset && next.distance < boundary_offset + 2.0f)) {
double line_len = (next.position - curr.position).norm(); double line_len = (next.position - curr.position).norm();
if (line_len > 4.0f) { if (line_len > 4.0f) {
double a0 = std::clamp((curr.distance + 2 * boundary_offset) / line_len, 0.0, 1.0); double a0 = std::clamp((curr.distance + 3 * boundary_offset) / line_len, 0.0, 1.0);
double a1 = std::clamp(1.0f - (next.distance + 2 * boundary_offset) / line_len, 0.0, 1.0); double a1 = std::clamp(1.0f - (next.distance + 3 * boundary_offset) / line_len, 0.0, 1.0);
double t0 = std::min(a0, a1); double t0 = std::min(a0, a1);
double t1 = std::max(a0, a1); double t1 = std::max(a0, a1);

View File

@ -582,7 +582,7 @@ void PrintObject::calculate_overhanging_perimeters()
layer_region->m_perimeters = layer_region->m_perimeters =
ExtrusionProcessor::calculate_and_split_overhanging_extrusions(&layer_region->m_perimeters, ExtrusionProcessor::calculate_and_split_overhanging_extrusions(&layer_region->m_perimeters,
unscaled_polygons_lines[prev_layer_id], unscaled_polygons_lines[prev_layer_id],
curled_lines[prev_layer_id]); curled_lines[l->id()]);
} }
} }
}); });