From bab3404b2dff2fa54b7c4c246d2194ebfbb59545 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 19 Dec 2015 16:36:07 +0100 Subject: [PATCH] Very minor code improvements --- xs/src/libslic3r/GCode.cpp | 2 +- xs/src/libslic3r/PerimeterGenerator.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xs/src/libslic3r/GCode.cpp b/xs/src/libslic3r/GCode.cpp index 1069555a4..36e77726b 100644 --- a/xs/src/libslic3r/GCode.cpp +++ b/xs/src/libslic3r/GCode.cpp @@ -322,7 +322,7 @@ GCode::extrude(ExtrusionLoop loop, std::string description, double speed) if (this->config.spiral_vase) { loop.split_at(last_pos); } else if (this->config.seam_position == spNearest || this->config.seam_position == spAligned) { - Polygon polygon = loop.polygon(); + const Polygon polygon = loop.polygon(); // simplify polygon in order to skip false positives in concave/convex detection // (loop is always ccw as polygon.simplify() only works on ccw polygons) diff --git a/xs/src/libslic3r/PerimeterGenerator.cpp b/xs/src/libslic3r/PerimeterGenerator.cpp index 1828f2a05..6ef6c580e 100644 --- a/xs/src/libslic3r/PerimeterGenerator.cpp +++ b/xs/src/libslic3r/PerimeterGenerator.cpp @@ -68,18 +68,18 @@ PerimeterGenerator::process() if (this->config->thin_walls) { offsets = offset2( last, - -(0.5*ext_pwidth + 0.5*ext_min_spacing - 1), - +(0.5*ext_min_spacing - 1) + -(ext_pwidth/2 + ext_min_spacing/2 - 1), + +(ext_min_spacing/2 - 1) ); } else { - offsets = offset(last, -0.5*ext_pwidth); + offsets = offset(last, -ext_pwidth/2); } // look for thin walls if (this->config->thin_walls) { Polygons diffpp = diff( last, - offset(offsets, +0.5*ext_pwidth), + offset(offsets, +ext_pwidth/2), true // medial axis requires non-overlapping geometry ); @@ -122,8 +122,8 @@ PerimeterGenerator::process() if (this->config->thin_walls) { offsets = offset2( last, - -(distance + 0.5*min_spacing - 1), - +(0.5*min_spacing - 1) + -(distance + min_spacing/2 - 1), + +(min_spacing/2 - 1) ); } else { offsets = offset(