Very minor code improvements

This commit is contained in:
Alessandro Ranellucci 2015-12-19 16:36:07 +01:00
parent 2df750a9c9
commit bab3404b2d
2 changed files with 7 additions and 7 deletions

View file

@ -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)

View file

@ -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(