Skip to content

Commit

Permalink
Ported PrintObject::infill() to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
alranel committed Nov 26, 2018
1 parent 1cc8a8d commit aac9c24
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
9 changes: 0 additions & 9 deletions lib/Slic3r/Print/Object.pm
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ sub prepare_infill {
$self->set_step_done(STEP_PREPARE_INFILL);
}

sub infill {
my ($self) = @_;

# prerequisites
$self->prepare_infill;

$self->_infill;
}

sub generate_support_material {
my $self = shift;

Expand Down
2 changes: 1 addition & 1 deletion src/test/libslic3r/test_support_material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ bool test_6_checks(Print &print)

// Pre-Processing.
PrintObject *print_object = print.objects.front();
print_object->_infill();
print_object->infill();
SupportMaterial *support_material = print.objects.front()->_support_material();
support_material->generate(print_object);
// TODO but not needed in test 6 (make brims and make skirts).
Expand Down
18 changes: 7 additions & 11 deletions xs/src/libslic3r/PrintObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,9 @@ PrintObject::slice()
void
PrintObject::make_perimeters()
{
// prerequisites
this->slice();

if (this->state.is_done(posPerimeters)) return;
this->state.set_started(posPerimeters);

Expand All @@ -1063,9 +1066,6 @@ PrintObject::make_perimeters()
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
Expand Down Expand Up @@ -1185,8 +1185,11 @@ PrintObject::make_perimeters()
}

void
PrintObject::_infill()
PrintObject::infill()
{
// prerequisites
this->prepare_infill();

if (this->state.is_done(posInfill)) return;
this->state.set_started(posInfill);

Expand Down Expand Up @@ -1383,13 +1386,6 @@ PrintObject::combine_infill()
}
}

void
PrintObject::infill()
{
this->prepare_infill();
this->_infill();
}

SupportMaterial *
PrintObject::_support_material()
{
Expand Down
2 changes: 1 addition & 1 deletion xs/xsp/Print.xsp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ _constant()
RETVAL = (SV*)newRV_noinc((SV*)layers_av);
%};
void make_perimeters();
void _infill();
void infill();
void _simplify_slices(double distance);

int ptr()
Expand Down

0 comments on commit aac9c24

Please sign in to comment.