mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 02:26:12 +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;
|
1;
|
||||||
|
@ -199,6 +199,8 @@ class PrintObject
|
|||||||
/// fill_surfaces but we only turn them into VOID surfaces, thus preserving the boundaries.
|
/// fill_surfaces but we only turn them into VOID surfaces, thus preserving the boundaries.
|
||||||
void clip_fill_surfaces();
|
void clip_fill_surfaces();
|
||||||
|
|
||||||
|
void _simplify_slices(double distance);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Print* _print;
|
Print* _print;
|
||||||
ModelObject* _model_object;
|
ModelObject* _model_object;
|
||||||
|
@ -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 _make_perimeters();
|
||||||
void _infill();
|
void _infill();
|
||||||
|
void _simplify_slices(double distance);
|
||||||
|
|
||||||
int ptr()
|
int ptr()
|
||||||
%code%{ RETVAL = (int)(intptr_t)THIS; %};
|
%code%{ RETVAL = (int)(intptr_t)THIS; %};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user