mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-16 17:56:11 +08:00
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:
parent
bfd921d0b4
commit
7d4f090786
@ -20,7 +20,7 @@ Layer::~Layer()
|
||||
// Test whether whether there are any slices assigned to this layer.
|
||||
bool Layer::empty() const
|
||||
{
|
||||
for (const LayerRegion *layerm : m_regions)
|
||||
for (const LayerRegion *layerm : m_regions)
|
||||
if (layerm != nullptr && ! layerm->slices.empty())
|
||||
// Non empty layer.
|
||||
return false;
|
||||
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
@ -1623,12 +1623,15 @@ ExtrusionEntityCollection thin_variable_width(const ThickPolylines &polylines, E
|
||||
if (path.polyline.points.empty()) {
|
||||
path.polyline.append(line.a);
|
||||
path.polyline.append(line.b);
|
||||
if (role == erGapFill){
|
||||
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);
|
||||
}else{
|
||||
flow.width = (float)unscaled(line.a_width);
|
||||
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 = unscale<coordf_t>(line.a_width);
|
||||
}
|
||||
#ifdef SLIC3R_DEBUG
|
||||
printf(" filling %f gap\n", flow.width);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user