fix some bug

This commit is contained in:
QIDI TECH
2024-11-30 14:00:32 +08:00
parent 1244542711
commit dd004ebffd
11 changed files with 51 additions and 10 deletions

View File

@@ -663,12 +663,16 @@ void Layer::make_ironing()
return true;
if (this->angle > rhs.angle)
return false;
if (this->inset < rhs.inset)
return true;
if (this->inset > rhs.inset)
return false;
return false;
}
bool operator==(const IroningParams &rhs) const {
return this->extruder == rhs.extruder && this->just_infill == rhs.just_infill &&
this->line_spacing == rhs.line_spacing && this->height == rhs.height && this->speed == rhs.speed && this->angle == rhs.angle && this->pattern == rhs.pattern;
this->line_spacing == rhs.line_spacing && this->height == rhs.height && this->speed == rhs.speed && this->angle == rhs.angle && this->pattern == rhs.pattern && this->inset == rhs.inset;
}
LayerRegion *layerm = nullptr;
@@ -712,6 +716,7 @@ void Layer::make_ironing()
//TODO just_infill is currently not used.
ironing_params.just_infill = false;
ironing_params.line_spacing = config.ironing_spacing;
ironing_params.inset = config.ironing_inset;
ironing_params.height = default_layer_height * 0.01 * config.ironing_flow;
ironing_params.speed = config.ironing_speed;
ironing_params.angle = (int(config.ironing_direction.value+layerm->region().config().infill_direction.value)%180) * M_PI / 180.;
@@ -802,7 +807,9 @@ void Layer::make_ironing()
polys = union_safety_offset(polys);
}
// Trim the top surfaces with half the nozzle diameter.
ironing_areas = intersection_ex(polys, offset(this->lslices, - float(scale_(0.5 * nozzle_dmr))));
//QDS: ironing inset
double ironing_areas_offset = ironing_params.inset == 0 ? float(scale_(0.5 * nozzle_dmr)) : scale_(ironing_params.inset);
ironing_areas = intersection_ex(polys, offset(this->lslices, - ironing_areas_offset));
}
// Create the filler object.

View File

@@ -148,7 +148,7 @@ static Polylines generate_infill_layers(coordf_t z_height, double repeat_ratio,
Polylines result;
coordf_t trans_layer_size = grid_size * 0.4; // upper.
coordf_t repeat_layer_size = grid_size * repeat_ratio; // lower.
z_height += repeat_layer_size / 2 + trans_layer_size; // offset to improve first few layer strength and reduce the risk of warpping.
z_height += repeat_layer_size / 2 ; // offset to improve first few layer strength and reduce the risk of warpping.
coordf_t period = trans_layer_size + repeat_layer_size;
coordf_t remains = z_height - std::floor(z_height / period) * period;
coordf_t trans_z = remains - repeat_layer_size; // put repeat layer first.

View File

@@ -3697,6 +3697,17 @@ void GCodeProcessor::process_G2_G3(const GCodeReader::GCodeLine& line)
m_seams_detector.activate(true);
m_seams_detector.set_first_vertex(m_result.moves.back().position - m_extruder_offsets[m_extruder_id] - plate_offset);
}
//QDS: some layer may only has G3/G3, update right layer height
if (m_detect_layer_based_on_tag && !m_result.spiral_vase_layers.empty()) {
if (delta_pos[Z] >= 0.0 && type == EMoveType::Extrude && m_result.spiral_vase_layers.back().first == FLT_MAX) {
// replace layer height placeholder with correct value
m_result.spiral_vase_layers.back().first = static_cast<float>(m_end_position[Z]);
}
if (!m_result.moves.empty())
m_result.spiral_vase_layers.back().second.second = m_result.moves.size() - 1 - m_seams_count;
}
//QDS: store move
store_move_vertex(type, m_move_path_type);
}