mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-16 10:05:59 +08:00
Ported PrintObject::make_perimeters() to C++
This commit is contained in:
parent
f7509f2a3f
commit
f2e2c9aa71
@ -34,24 +34,6 @@ sub support_layers {
|
||||
return [ map $self->get_support_layer($_), 0..($self->support_layer_count - 1) ];
|
||||
}
|
||||
|
||||
sub make_perimeters {
|
||||
my ($self) = @_;
|
||||
|
||||
return if $self->step_done(STEP_PERIMETERS);
|
||||
|
||||
# Temporary workaround for detect_surfaces_type() not being idempotent (see #3764).
|
||||
# We can remove this when idempotence is restored. This make_perimeters() method
|
||||
# will just call merge_slices() to undo the typed slices and invalidate posDetectSurfaces.
|
||||
if ($self->typed_slices) {
|
||||
$self->invalidate_step(STEP_SLICE);
|
||||
}
|
||||
|
||||
# prerequisites
|
||||
$self->slice;
|
||||
|
||||
$self->_make_perimeters;
|
||||
}
|
||||
|
||||
# This will assign a type (top/bottom/internal) to $layerm->slices
|
||||
# and transform $layerm->fill_surfaces from expolygon
|
||||
# to typed top/bottom/internal surfaces;
|
||||
|
@ -164,7 +164,6 @@ class PrintObject
|
||||
void _slice();
|
||||
std::vector<ExPolygons> _slice_region(size_t region_id, std::vector<float> z, bool modifier);
|
||||
|
||||
void _make_perimeters();
|
||||
void _infill();
|
||||
|
||||
/// Initialize and generate support material.
|
||||
|
@ -946,16 +946,6 @@ PrintObject::_slice_region(size_t region_id, std::vector<float> z, bool modifier
|
||||
return layers;
|
||||
}
|
||||
|
||||
void
|
||||
PrintObject::make_perimeters()
|
||||
{
|
||||
if (this->state.is_done(posPerimeters)) return;
|
||||
if (this->typed_slices)
|
||||
this->state.invalidate(posSlice);
|
||||
this->slice(); // take care of prereqs
|
||||
this->_make_perimeters();
|
||||
}
|
||||
|
||||
/*
|
||||
1) Decides Z positions of the layers,
|
||||
2) Initializes layers and their regions
|
||||
@ -1059,11 +1049,20 @@ PrintObject::slice()
|
||||
}
|
||||
|
||||
void
|
||||
PrintObject::_make_perimeters()
|
||||
PrintObject::make_perimeters()
|
||||
{
|
||||
if (this->state.is_done(posPerimeters)) return;
|
||||
this->state.set_started(posPerimeters);
|
||||
|
||||
// Temporary workaround for detect_surfaces_type() not being idempotent (see #3764).
|
||||
// We can remove this when idempotence is restored. This make_perimeters() method
|
||||
// will just call merge_slices() to undo the typed slices and invalidate posDetectSurfaces.
|
||||
if (this->typed_slices)
|
||||
this->state.invalidate(posSlice);
|
||||
|
||||
// prerequisites
|
||||
this->slice();
|
||||
|
||||
// merge slices if they were split into types
|
||||
// This is not currently taking place because since merge_slices + detect_surfaces_type
|
||||
// are not truly idempotent we are invalidating posSlice here (see the Perl part of
|
||||
|
@ -153,7 +153,7 @@ _constant()
|
||||
}
|
||||
RETVAL = (SV*)newRV_noinc((SV*)layers_av);
|
||||
%};
|
||||
void _make_perimeters();
|
||||
void make_perimeters();
|
||||
void _infill();
|
||||
void _simplify_slices(double distance);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user