mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 00:36:24 +08:00
Ported PrintObject::_simplify_slices() to C++
This commit is contained in:
parent
725d0ab408
commit
ea186f5651
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -152,6 +152,7 @@ _constant()
|
||||
%};
|
||||
void _make_perimeters();
|
||||
void _infill();
|
||||
void _simplify_slices(double distance);
|
||||
|
||||
int ptr()
|
||||
%code%{ RETVAL = (int)(intptr_t)THIS; %};
|
||||
|
Loading…
x
Reference in New Issue
Block a user