mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-16 12:45:53 +08:00
gap fill : only if perimeters aren't touching
medial axis: concatenate_polylines_with_crossing fixed
This commit is contained in:
parent
41c5d32744
commit
a3bdc74045
@ -1149,7 +1149,7 @@ MedialAxis::concatenate_polylines_with_crossing(ThickPolylines& pp)
|
|||||||
Vec2d v_other(other_reverse ? other.lines().back().vector().x() : other.lines().front().vector().x(),
|
Vec2d v_other(other_reverse ? other.lines().back().vector().x() : other.lines().front().vector().x(),
|
||||||
other_reverse ? other.lines().back().vector().y() : other.lines().front().vector().y());
|
other_reverse ? other.lines().back().vector().y() : other.lines().front().vector().y());
|
||||||
v_other *= (1 / std::sqrt(v_other.x()*v_other.x() + v_other.y()*v_other.y()));
|
v_other *= (1 / std::sqrt(v_other.x()*v_other.x() + v_other.y()*v_other.y()));
|
||||||
float other_dot = (float)( v_poly.x()*v_other.x() + v_poly.y()*v_other.y() );
|
float other_dot = std::abs(float( v_poly.x()*v_other.x() + v_poly.y()*v_other.y() ));
|
||||||
if (other_dot > best_dot) {
|
if (other_dot > best_dot) {
|
||||||
best_candidate = &other;
|
best_candidate = &other;
|
||||||
best_idx = j;
|
best_idx = j;
|
||||||
|
@ -50,6 +50,9 @@ void PerimeterGenerator::process()
|
|||||||
|
|
||||||
// solid infill
|
// solid infill
|
||||||
coord_t solid_infill_spacing = this->solid_infill_flow.scaled_spacing();
|
coord_t solid_infill_spacing = this->solid_infill_flow.scaled_spacing();
|
||||||
|
|
||||||
|
// nozzle diameter
|
||||||
|
const double nozzle_diameter = this->print_config->nozzle_diameter.get_at(this->config->perimeter_extruder - 1);
|
||||||
|
|
||||||
// Calculate the minimum required spacing between two adjacent traces.
|
// Calculate the minimum required spacing between two adjacent traces.
|
||||||
// This should be equal to the nominal flow spacing but we experiment
|
// This should be equal to the nominal flow spacing but we experiment
|
||||||
@ -69,7 +72,6 @@ void PerimeterGenerator::process()
|
|||||||
// We consider overhang any part where the entire nozzle diameter is not supported by the
|
// We consider overhang any part where the entire nozzle diameter is not supported by the
|
||||||
// lower layer, so we take lower slices and offset them by half the nozzle diameter used
|
// lower layer, so we take lower slices and offset them by half the nozzle diameter used
|
||||||
// in the current layer
|
// in the current layer
|
||||||
double nozzle_diameter = this->print_config->nozzle_diameter.get_at(this->config->perimeter_extruder-1);
|
|
||||||
this->_lower_slices_p = offset(*this->lower_slices, double(scale_(+nozzle_diameter/2)));
|
this->_lower_slices_p = offset(*this->lower_slices, double(scale_(+nozzle_diameter/2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,6 +589,8 @@ void PerimeterGenerator::process()
|
|||||||
if (!gaps.empty()) {
|
if (!gaps.empty()) {
|
||||||
// collapse
|
// collapse
|
||||||
double min = 0.2 * perimeter_width * (1 - INSET_OVERLAP_TOLERANCE);
|
double min = 0.2 * perimeter_width * (1 - INSET_OVERLAP_TOLERANCE);
|
||||||
|
//be sure we don't gapfill where the perimeters are already touching each other (negative spacing).
|
||||||
|
min = std::max(min, double(Flow::new_from_spacing(EPSILON, nozzle_diameter, this->layer_height, false).scaled_width()));
|
||||||
double max = 2. * perimeter_spacing;
|
double max = 2. * perimeter_spacing;
|
||||||
ExPolygons gaps_ex = diff_ex(
|
ExPolygons gaps_ex = diff_ex(
|
||||||
offset2_ex(gaps, double(-min / 2), double(+min / 2)),
|
offset2_ex(gaps, double(-min / 2), double(+min / 2)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user