Ported PrintObject::_simplify_slices() to C++

This commit is contained in:
Alessandro Ranellucci 2018-11-26 09:25:15 +01:00
parent 725d0ab408
commit ea186f5651
4 changed files with 16 additions and 12 deletions

View File

@ -558,16 +558,4 @@ sub combine_infill {
}
}
# Simplify the sliced model, if "resolution" configuration parameter > 0.
# The simplification is problematic, because it simplifies the slices independent from each other,
# which makes the simplified discretization visible on the object surface.
sub _simplify_slices {
my ($self, $distance) = @_;
foreach my $layer (@{$self->layers}) {
$layer->slices->simplify($distance);
$_->slices->simplify($distance) for @{$layer->regions};
}
}
1;

View File

@ -198,6 +198,8 @@ class PrintObject
/// Idempotence of this method is guaranteed by the fact that we don't remove things from
/// fill_surfaces but we only turn them into VOID surfaces, thus preserving the boundaries.
void clip_fill_surfaces();
void _simplify_slices(double distance);
private:
Print* _print;

View File

@ -1635,4 +1635,17 @@ PrintObject::clip_fill_surfaces()
}
}
// Simplify the sliced model, if "resolution" configuration parameter > 0.
// The simplification is problematic, because it simplifies the slices independent from each other,
// which makes the simplified discretization visible on the object surface.
void
PrintObject::_simplify_slices(double distance)
{
for (auto* layer : this->layers) {
layer->slices.simplify(distance);
for (auto* layerm : layer->regions)
layerm->slices.simplify(distance);
}
}
}

View File

@ -152,6 +152,7 @@ _constant()
%};
void _make_perimeters();
void _infill();
void _simplify_slices(double distance);
int ptr()
%code%{ RETVAL = (int)(intptr_t)THIS; %};