diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index a3e72994e..2e65c147e 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -32,11 +32,6 @@ sub regions { return [ map $self->get_region($_), 0..($self->region_count-1) ]; } -sub merge_slices { - my ($self) = @_; - $_->merge_slices for @{$self->regions}; -} - sub make_perimeters { my $self = shift; Slic3r::debugf "Making perimeters for layer %d\n", $self->id; diff --git a/xs/src/libslic3r/Layer.cpp b/xs/src/libslic3r/Layer.cpp index 2e1a8c50e..250572fb7 100644 --- a/xs/src/libslic3r/Layer.cpp +++ b/xs/src/libslic3r/Layer.cpp @@ -126,6 +126,14 @@ Layer::make_slices() } } +void +Layer::merge_slices() +{ + FOREACH_LAYERREGION(this, layerm) { + (*layerm)->merge_slices(); + } +} + template bool Layer::any_internal_region_slice_contains(const T &item) const diff --git a/xs/src/libslic3r/Layer.hpp b/xs/src/libslic3r/Layer.hpp index 8b2ef6f3f..d34abec36 100644 --- a/xs/src/libslic3r/Layer.hpp +++ b/xs/src/libslic3r/Layer.hpp @@ -95,6 +95,7 @@ class Layer { LayerRegion* add_region(PrintRegion* print_region); void make_slices(); + void merge_slices(); template bool any_internal_region_slice_contains(const T &item) const; template bool any_bottom_region_slice_contains(const T &item) const; diff --git a/xs/xsp/Layer.xsp b/xs/xsp/Layer.xsp index 611e2cae9..e8372206c 100644 --- a/xs/xsp/Layer.xsp +++ b/xs/xsp/Layer.xsp @@ -71,6 +71,7 @@ %code%{ RETVAL = (int)(intptr_t)THIS; %}; void make_slices(); + void merge_slices(); bool any_internal_region_slice_contains_polyline(Polyline* polyline) %code%{ RETVAL = THIS->any_internal_region_slice_contains(*polyline); %}; bool any_bottom_region_slice_contains_polyline(Polyline* polyline)