Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement "Only one wall on top surfaces": better support for interface_shells #8627

Merged
merged 1 commit into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/libslic3r/LayerRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ void LayerRegion::make_perimeters(const SurfaceCollection &slices, const LayerRe
g.lower_slices = &this->layer()->lower_layer->lslices;
if (this->layer()->upper_layer != NULL)
g.upper_slices = &this->layer()->upper_layer->lslices;


int region_id = this->region().print_object_region_id();
if (this->layer()->upper_layer != NULL)
g.upper_slices_same_region = &this->layer()->upper_layer->get_region(region_id)->slices;

g.layer_id = (int)this->layer()->id();
g.ext_perimeter_flow = this->flow(frExternalPerimeter);
g.overhang_flow = this->bridging_flow(frPerimeter, object_config.thick_bridges);
Expand Down
16 changes: 14 additions & 2 deletions src/libslic3r/PerimeterGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,13 @@ void PerimeterGenerator::split_top_surfaces(const ExPolygons &orig_polygons, ExP
double min_width_top_surface = std::max(double(ext_perimeter_spacing / 2. + 10), scale_(config->min_width_top_surface.get_abs_value(unscale_(perimeter_width))));

// get the Polygons upper the polygon this layer
Polygons upper_polygons_series_clipped = ClipperUtils::clip_clipper_polygons_with_subject_bbox(*this->upper_slices, last_box);
Polygons upper_polygons_series_clipped;
if (object_config->interface_shells) {
auto upper_slicer_same_region = to_expolygons(this->upper_slices_same_region->surfaces);
upper_polygons_series_clipped = ClipperUtils::clip_clipper_polygons_with_subject_bbox(upper_slicer_same_region, last_box);
} else
upper_polygons_series_clipped = ClipperUtils::clip_clipper_polygons_with_subject_bbox(*this->upper_slices, last_box);

upper_polygons_series_clipped = offset(upper_polygons_series_clipped, min_width_top_surface);

// set the clip to a virtual "second perimeter"
Expand Down Expand Up @@ -2991,7 +2997,13 @@ void PerimeterGenerator::process_arachne()
coord_t perimeter_width = this->perimeter_flow.scaled_width();

// Get top ExPolygons from current infill contour.
Polygons upper_slices_clipped = ClipperUtils::clip_clipper_polygons_with_subject_bbox(*upper_slices, infill_contour_bbox);
Polygons upper_slices_clipped;
if (object_config->interface_shells) {
auto upper_slicer_same_region = to_expolygons(this->upper_slices_same_region->surfaces);
upper_slices_clipped = ClipperUtils::clip_clipper_polygons_with_subject_bbox(upper_slicer_same_region, infill_contour_bbox);
} else
upper_slices_clipped = ClipperUtils::clip_clipper_polygons_with_subject_bbox(*upper_slices, infill_contour_bbox);

top_expolygons = diff_ex(infill_contour, upper_slices_clipped);

if (!top_expolygons.empty()) {
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/PerimeterGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class PerimeterGenerator {
const SurfaceCollection *slices;
const LayerRegionPtrs *compatible_regions;
const ExPolygons *upper_slices;
const SurfaceCollection *upper_slices_same_region;
const ExPolygons *lower_slices;
double layer_height;
int layer_id;
Expand Down
Loading