mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
Fix missing infill layers (fill_surface_by_multilines & fill_surface_trapezoidal bug fix) (#12516)
* FillRectilinear bugfix
* cleaning
* Revert "cleaning"
This reverts commit 0de21ada78.
* Filltrapezoidal is OK
* Filltrapezoidal fix 2
This commit is contained in:
committed by
SoftFever
parent
2f3bfd03d5
commit
ce1d91024b
@@ -3021,24 +3021,25 @@ bool FillRectilinear::fill_surface_by_multilines(const Surface *surface, FillPar
|
|||||||
multiline_fill(fill_lines, params, spacing);
|
multiline_fill(fill_lines, params, spacing);
|
||||||
|
|
||||||
// Contract surface polygon by half line width to avoid excesive overlap with perimeter
|
// Contract surface polygon by half line width to avoid excesive overlap with perimeter
|
||||||
ExPolygons contracted = offset_ex(surface->expolygon, -float(scale_(0.5 * this->spacing)));
|
const ExPolygons contracted = offset_ex(surface->expolygon, -float(scale_(0.5 * this->spacing)));
|
||||||
|
|
||||||
// if contraction results in empty polygon, use original surface
|
// if contraction results in empty ExPolygons, use original surface
|
||||||
const ExPolygon &intersection_surface = contracted.empty() ? surface->expolygon : contracted.front();
|
const ExPolygons& intersection_surface = contracted.empty() ? ExPolygons{surface->expolygon} : contracted;
|
||||||
|
|
||||||
// Intersect polylines with perimeter
|
// Intersect polylines with perimeter
|
||||||
fill_lines = intersection_pl(std::move(fill_lines), intersection_surface);
|
fill_lines = intersection_pl(std::move(fill_lines), intersection_surface);
|
||||||
|
|
||||||
if ((params.pattern == ipLateralLattice || params.pattern == ipLateralHoneycomb ) && params.multiline >1 )
|
if ((params.pattern == ipLateralLattice || params.pattern == ipLateralHoneycomb) && params.multiline > 1)
|
||||||
remove_overlapped(fill_lines, line_width);
|
remove_overlapped(fill_lines, line_width);
|
||||||
|
|
||||||
if (!fill_lines.empty()) {
|
if (!fill_lines.empty()) {
|
||||||
if (params.dont_connect()) {
|
if (params.dont_connect()) {
|
||||||
if (fill_lines.size() > 1)
|
if (fill_lines.size() > 1)
|
||||||
fill_lines = chain_polylines(std::move(fill_lines));
|
fill_lines = chain_polylines(std::move(fill_lines));
|
||||||
append(polylines_out, std::move(fill_lines));
|
append(polylines_out, std::move(fill_lines));
|
||||||
} else
|
} else
|
||||||
connect_infill(std::move(fill_lines), intersection_surface, polylines_out, this->spacing, params);
|
connect_infill(std::move(fill_lines), to_polygons(intersection_surface), get_extents(surface->expolygon.contour), polylines_out,
|
||||||
|
this->spacing, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -3268,7 +3269,7 @@ bool FillRectilinear::fill_surface_trapezoidal(
|
|||||||
ExPolygons contracted = offset_ex(expolygon, -float(scale_(0.5 * this->spacing)));
|
ExPolygons contracted = offset_ex(expolygon, -float(scale_(0.5 * this->spacing)));
|
||||||
|
|
||||||
// if contraction results in empty polygon, use original surface
|
// if contraction results in empty polygon, use original surface
|
||||||
const ExPolygon &intersection_surface = contracted.empty() ? expolygon : contracted.front();
|
const ExPolygons& intersection_surface = contracted.empty() ? ExPolygons{expolygon} : contracted;
|
||||||
|
|
||||||
// Intersect polylines with offset expolygon
|
// Intersect polylines with offset expolygon
|
||||||
polylines = intersection_pl(std::move(polylines), intersection_surface);
|
polylines = intersection_pl(std::move(polylines), intersection_surface);
|
||||||
@@ -3284,7 +3285,14 @@ bool FillRectilinear::fill_surface_trapezoidal(
|
|||||||
// Connect infill lines using offset expolygon
|
// Connect infill lines using offset expolygon
|
||||||
int infill_start_idx = polylines_out.size();
|
int infill_start_idx = polylines_out.size();
|
||||||
if (!polylines.empty()) {
|
if (!polylines.empty()) {
|
||||||
Slic3r::Fill::chain_or_connect_infill(std::move(polylines), intersection_surface, polylines_out, this->spacing, params);
|
if (params.dont_connect()) {
|
||||||
|
if (polylines.size() > 1)
|
||||||
|
polylines = chain_polylines(std::move(polylines));
|
||||||
|
append(polylines_out, std::move(polylines));
|
||||||
|
} else {
|
||||||
|
connect_infill(std::move(polylines), to_polygons(intersection_surface), get_extents(intersection_surface), polylines_out,
|
||||||
|
this->spacing, params);
|
||||||
|
}
|
||||||
|
|
||||||
// Rotate back the infill lines to original orientation
|
// Rotate back the infill lines to original orientation
|
||||||
if (std::abs(base_angle) >= EPSILON) {
|
if (std::abs(base_angle) >= EPSILON) {
|
||||||
|
|||||||
Reference in New Issue
Block a user