diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2015-10-27 01:23:03 +0300 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2015-10-27 01:24:46 +0300 |
commit | 9fcec107373b6846f3775fe353c7ae29653cf9ac (patch) | |
tree | 745479a8dfd50c9f2d4ccbae9b886ab064710821 /xs/src/libslic3r/PerimeterGenerator.cpp | |
parent | 5b8ed7367a2a9148c215eafa53c7e13b30cd0c36 (diff) |
Finished porting LayerRegion to C++
Diffstat (limited to 'xs/src/libslic3r/PerimeterGenerator.cpp')
-rw-r--r-- | xs/src/libslic3r/PerimeterGenerator.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/xs/src/libslic3r/PerimeterGenerator.cpp b/xs/src/libslic3r/PerimeterGenerator.cpp index a96848531..32662f59c 100644 --- a/xs/src/libslic3r/PerimeterGenerator.cpp +++ b/xs/src/libslic3r/PerimeterGenerator.cpp @@ -47,7 +47,7 @@ PerimeterGenerator::process() for (Surfaces::const_iterator surface = this->slices->surfaces.begin(); surface != this->slices->surfaces.end(); ++surface) { // detect how many perimeters must be generated for this island - short loop_number = this->config->perimeters + surface->extra_perimeters; + signed short loop_number = this->config->perimeters + surface->extra_perimeters; loop_number--; // 0-indexed loops Polygons gaps; @@ -60,7 +60,7 @@ PerimeterGenerator::process() Polylines thin_walls; // we loop one time more than needed in order to find gaps after the last perimeter was applied - for (unsigned short i = 0; i <= loop_number+1; ++i) { // outer loop is 0 + for (signed short i = 0; i <= loop_number+1; ++i) { // outer loop is 0 Polygons offsets; if (i == 0) { // the minimum thickness of a single loop is: @@ -166,16 +166,16 @@ PerimeterGenerator::process() } // nest loops: holes first - for (unsigned short d = 0; d <= loop_number; ++d) { + for (signed short d = 0; d <= loop_number; ++d) { PerimeterGeneratorLoops &holes_d = holes[d]; // loop through all holes having depth == d - for (unsigned short i = 0; i < holes_d.size(); ++i) { + for (signed short i = 0; i < holes_d.size(); ++i) { const PerimeterGeneratorLoop &loop = holes_d[i]; // find the hole loop that contains this one, if any - for (unsigned short t = d+1; t <= loop_number; ++t) { - for (unsigned short j = 0; j < holes[t].size(); ++j) { + for (signed short t = d+1; t <= loop_number; ++t) { + for (signed short j = 0; j < holes[t].size(); ++j) { PerimeterGeneratorLoop &candidate_parent = holes[t][j]; if (candidate_parent.polygon.contains(loop.polygon.first_point())) { candidate_parent.children.push_back(loop); @@ -187,8 +187,8 @@ PerimeterGenerator::process() } // if no hole contains this hole, find the contour loop that contains it - for (short t = loop_number; t >= 0; --t) { - for (unsigned short j = 0; j < contours[t].size(); ++j) { + for (signed short t = loop_number; t >= 0; --t) { + for (signed short j = 0; j < contours[t].size(); ++j) { PerimeterGeneratorLoop &candidate_parent = contours[t][j]; if (candidate_parent.polygon.contains(loop.polygon.first_point())) { candidate_parent.children.push_back(loop); @@ -203,16 +203,16 @@ PerimeterGenerator::process() } // nest contour loops - for (short d = loop_number; d >= 1; --d) { + for (signed short d = loop_number; d >= 1; --d) { PerimeterGeneratorLoops &contours_d = contours[d]; // loop through all contours having depth == d - for (unsigned short i = 0; i < contours_d.size(); ++i) { + for (signed short i = 0; i < contours_d.size(); ++i) { const PerimeterGeneratorLoop &loop = contours_d[i]; // find the contour loop that contains it - for (short t = d-1; t >= 0; --t) { - for (unsigned short j = 0; j < contours[t].size(); ++j) { + for (signed short t = d-1; t >= 0; --t) { + for (signed short j = 0; j < contours[t].size(); ++j) { PerimeterGeneratorLoop &candidate_parent = contours[t][j]; if (candidate_parent.polygon.contains(loop.polygon.first_point())) { candidate_parent.children.push_back(loop); |