medial_axis width bugfix (at least enough for the outer "lobes")

assert bugfix in thin walls (edge case)
2 bugfix in overlap
This commit is contained in:
supermerill 2019-02-11 14:02:13 +01:00
parent bfd921d0b4
commit 7d4f090786
3 changed files with 13 additions and 8 deletions

View File

@ -149,6 +149,7 @@ void Layer::make_perimeters()
// Separate the fill surfaces.
ExPolygons expp = intersection_ex(to_polygons(fill_surfaces), (*l)->slices);
(*l)->fill_expolygons = expp;
(*l)->fill_no_overlap_expolygons = (*layerm)->fill_no_overlap_expolygons;
(*l)->fill_surfaces.set(std::move(expp), fill_surfaces.surfaces.front());
}
}

View File

@ -1513,7 +1513,7 @@ MedialAxis::grow_to_nozzle_diameter(ThickPolylines& pp, const ExPolygons& anchor
void
MedialAxis::taper_ends(ThickPolylines& pp) {
const coord_t min_size = this->nozzle_diameter * 0.1;
const coord_t min_size = std::min(this->nozzle_diameter * 0.1, this->height * (1. - 0.25 * PI));
const coordf_t length = std::min(this->anchor_size, (this->nozzle_diameter - min_size) / 2);
if (length <= SCALED_RESOLUTION) return;
//ensure the width is not lower than 0.4.
@ -1626,9 +1626,12 @@ ExtrusionEntityCollection thin_variable_width(const ThickPolylines &polylines, E
if (role == erGapFill) {
// Convert from spacing to extrusion width based on the extrusion model
// of a square extrusion ended with semi circles.
flow.width = (float)unscaled(line.a_width) + flow.height * (1. - 0.25 * PI);
flow.width = unscale<coordf_t>(line.a_width) + flow.height * (1. - 0.25 * PI);
} else if (unscale<coordf_t>(line.a_width) < 2 * flow.height * (1. - 0.25 * PI)) {
double percent = unscale<coordf_t>(line.a_width) / (2 * flow.height * (1. - 0.25 * PI));
flow.width = unscale<coordf_t>(line.a_width)/2 + flow.height * (1. - 0.25 * PI);
} else {
flow.width = (float)unscaled(line.a_width);
flow.width = unscale<coordf_t>(line.a_width);
}
#ifdef SLIC3R_DEBUG
printf(" filling %f gap\n", flow.width);

View File

@ -282,7 +282,8 @@ void PerimeterGenerator::process()
for (ExPolygon &half_thin : half_thins) {
//growing back the polygon
ExPolygons thin = offset_ex(half_thin, (float)(min_width / 2));
assert(thin.size() == 1);
assert(thin.size() <= 1);
if (thin.empty()) continue;
coord_t overlap = (coord_t)scale_(this->config->thin_walls_overlap.get_abs_value(this->ext_perimeter_flow.nozzle_diameter));
ExPolygons anchor = intersection_ex(offset_ex(half_thin, (float)(min_width / 2) +
(float)(overlap), jtSquare), no_thin_zone, true);
@ -514,7 +515,7 @@ void PerimeterGenerator::process()
// only apply infill overlap if we actually have one perimeter
coord_t overlap = 0;
if (inset > 0) {
overlap = scale_(this->config->get_abs_value("infill_overlap", unscale<coord_t>(inset + solid_infill_spacing / 2)));
overlap = scale_(this->config->get_abs_value("infill_overlap", unscale<coordf_t>(inset + solid_infill_spacing / 2)));
}
// simplify infill contours according to resolution
Polygons pp;