Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra perimeters detection includes extra perimeters. #3614

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions xs/src/libslic3r/PrintObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ PrintObject::_make_perimeters()
this->typed_slices = false;
this->state.invalidate(posPrepareInfill);
}

std::cerr << "Done merging slices" << std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops ;)

// compare each layer to the one below, and mark those slices needing
// one additional inner perimeter, like the top of domed objects-

Expand Down Expand Up @@ -695,13 +695,12 @@ PrintObject::_make_perimeters()
const Flow ext_perimeter_flow = layerm.flow(frExternalPerimeter);
const coord_t ext_perimeter_width = ext_perimeter_flow.scaled_width();
const coord_t ext_perimeter_spacing = ext_perimeter_flow.scaled_spacing();

for (Surfaces::iterator slice = layerm.slices.surfaces.begin();
slice != layerm.slices.surfaces.end(); ++slice) {
while (true) {
// compute the total thickness of perimeters
const coord_t perimeters_thickness = ext_perimeter_width/2 + ext_perimeter_spacing/2
+ (region.config.perimeters-1 + region.config.extra_perimeters) * perimeter_spacing;
+ (region.config.perimeters-1 + region.config.extra_perimeters + slice->extra_perimeters) * perimeter_spacing;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's right!
And I clearly see my error at porting time: region.config.extra_perimeters is a boolean: it should not be summed in that expression! I wrote region.config.extra_perimeters instead of slice->extra_perimeters.


// define a critical area where we don't want the upper slice to fall into
// (it should either lay over our perimeters or outside this area)
Expand Down