Limits the length of an infill connecting segment of a solid infill to 3x the solid infill spacing.
This commit is contained in:
parent
483a658144
commit
61d82b02b5
2 changed files with 45 additions and 19 deletions
|
@ -196,19 +196,22 @@ void make_fill(LayerRegion &layerm, ExtrusionEntityCollection &out)
|
||||||
*layerm.layer()->object()
|
*layerm.layer()->object()
|
||||||
);
|
);
|
||||||
f->spacing = internal_flow.spacing();
|
f->spacing = internal_flow.spacing();
|
||||||
using_internal_flow = 1;
|
using_internal_flow = true;
|
||||||
} else {
|
} else {
|
||||||
f->spacing = flow.spacing();
|
f->spacing = flow.spacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
double link_max_length = 0.;
|
double link_max_length = 0.;
|
||||||
#if 0
|
|
||||||
if (! is_bridge) {
|
if (! is_bridge) {
|
||||||
|
#if 0
|
||||||
link_max_length = layerm.region()->config.get_abs_value(surface.is_external() ? "external_fill_link_max_length" : "fill_link_max_length", flow.spacing());
|
link_max_length = layerm.region()->config.get_abs_value(surface.is_external() ? "external_fill_link_max_length" : "fill_link_max_length", flow.spacing());
|
||||||
// printf("flow spacing: %f, is_external: %d, link_max_length: %lf\n", flow.spacing(), int(surface.is_external()), link_max_length);
|
// printf("flow spacing: %f, is_external: %d, link_max_length: %lf\n", flow.spacing(), int(surface.is_external()), link_max_length);
|
||||||
}
|
#else
|
||||||
|
if (density > 80.) // 80%
|
||||||
|
link_max_length = 3. * f->spacing;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
f->layer_id = layerm.layer()->id();
|
f->layer_id = layerm.layer()->id();
|
||||||
f->z = layerm.layer()->print_z;
|
f->z = layerm.layer()->print_z;
|
||||||
f->angle = Geometry::deg2rad(layerm.region()->config.fill_angle.value);
|
f->angle = Geometry::deg2rad(layerm.region()->config.fill_angle.value);
|
||||||
|
|
|
@ -380,13 +380,6 @@ PrintObject::discover_vertical_shells()
|
||||||
}
|
}
|
||||||
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
||||||
shell = union_(shell, true);
|
shell = union_(shell, true);
|
||||||
if (! shell.empty()) {
|
|
||||||
// These regions will be filled by a rectilinear full infill. Currently this type of infill
|
|
||||||
// will only fill regions, which will fit at least a single line. To avoid gaps in the sparse infill,
|
|
||||||
// make sure that this region does not contain narrow parts.
|
|
||||||
coord_t min_perimeter_infill_spacing = coord_t(double(infill_line_spacing) * (1. - INSET_OVERLAP_TOLERANCE));
|
|
||||||
shell = offset2(shell, -min_perimeter_infill_spacing/2, min_perimeter_infill_spacing/2);
|
|
||||||
}
|
|
||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
shell_ex = union_ex(shell, true);
|
shell_ex = union_ex(shell, true);
|
||||||
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
||||||
|
@ -435,7 +428,44 @@ PrintObject::discover_vertical_shells()
|
||||||
}
|
}
|
||||||
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
||||||
|
|
||||||
// Trim the internal & internalvoid by the $shell.
|
// Trim the shells region by the internal & internal void surfaces.
|
||||||
|
const SurfaceType surfaceTypesInternal[] = { stInternal, stInternalVoid };
|
||||||
|
const Polygons polygonsInternal = to_polygons(layerm->fill_surfaces.filter_by_types(surfaceTypesInternal, 2));
|
||||||
|
shell = intersection(shell, polygonsInternal, true);
|
||||||
|
if (shell.empty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// These regions will be filled by a rectilinear full infill. Currently this type of infill
|
||||||
|
// only fills regions, which fit at least a single line. To avoid gaps in the sparse infill,
|
||||||
|
// make sure that this region does not contain parts narrower than the infill spacing width.
|
||||||
|
float min_perimeter_infill_spacing = float(infill_line_spacing) * 1.05f;
|
||||||
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
|
Polygons shell_before = shell;
|
||||||
|
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
||||||
|
// Intentionally inflate a bit more than how much the region has been shrunk,
|
||||||
|
// so there will be some overlap between this solid infill and the other infill regions (mainly the sparse infill).
|
||||||
|
shell = offset2(shell, - 0.5f * min_perimeter_infill_spacing, 0.8f * min_perimeter_infill_spacing,
|
||||||
|
CLIPPER_OFFSET_SCALE, ClipperLib::jtSquare);
|
||||||
|
if (shell.empty())
|
||||||
|
continue;
|
||||||
|
ExPolygons new_internal_solid = intersection_ex(polygonsInternal, shell, false);
|
||||||
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
|
{
|
||||||
|
static size_t idx = 0;
|
||||||
|
SVG svg(debug_out_path("discover_vertical_shells-regularized-%d.svg", idx ++), get_extents(shell_before));
|
||||||
|
// Source shell.
|
||||||
|
svg.draw(union_ex(shell_before, true));
|
||||||
|
// Shell trimmed to the internal surfaces.
|
||||||
|
svg.draw_outline(union_ex(shell, true), "black", "blue", scale_(0.05));
|
||||||
|
// Regularized infill region.
|
||||||
|
svg.draw_outline(new_internal_solid, "red", "magenta", scale_(0.05));
|
||||||
|
svg.Close();
|
||||||
|
}
|
||||||
|
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
||||||
|
|
||||||
|
// Trim the internal & internalvoid by the shell.
|
||||||
|
// Enforce some overlap with the other infill regions.
|
||||||
|
shell = offset(shell, - 0.25f * min_perimeter_infill_spacing);
|
||||||
Slic3r::ExPolygons new_internal = diff_ex(
|
Slic3r::ExPolygons new_internal = diff_ex(
|
||||||
to_polygons(layerm->fill_surfaces.filter_by_type(stInternal)),
|
to_polygons(layerm->fill_surfaces.filter_by_type(stInternal)),
|
||||||
shell,
|
shell,
|
||||||
|
@ -446,13 +476,6 @@ PrintObject::discover_vertical_shells()
|
||||||
shell,
|
shell,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
// Add shells tstInternalVoido internal & internalvoid.
|
|
||||||
const SurfaceType surfaceTypesInternal[] = { stInternal, stInternalVoid };
|
|
||||||
Slic3r::ExPolygons new_internal_solid = intersection_ex(
|
|
||||||
to_polygons(layerm->fill_surfaces.filter_by_types(surfaceTypesInternal, 2)),
|
|
||||||
shell,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue