mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 10:47:50 -06:00
Fixed potential hang in PerimeterGenerator.cpp
This commit is contained in:
parent
6ac79e3ed6
commit
5b8ed7367a
1 changed files with 4 additions and 4 deletions
|
@ -47,7 +47,7 @@ PerimeterGenerator::process()
|
||||||
for (Surfaces::const_iterator surface = this->slices->surfaces.begin();
|
for (Surfaces::const_iterator surface = this->slices->surfaces.begin();
|
||||||
surface != this->slices->surfaces.end(); ++surface) {
|
surface != this->slices->surfaces.end(); ++surface) {
|
||||||
// detect how many perimeters must be generated for this island
|
// detect how many perimeters must be generated for this island
|
||||||
unsigned short loop_number = this->config->perimeters + surface->extra_perimeters;
|
short loop_number = this->config->perimeters + surface->extra_perimeters;
|
||||||
loop_number--; // 0-indexed loops
|
loop_number--; // 0-indexed loops
|
||||||
|
|
||||||
Polygons gaps;
|
Polygons gaps;
|
||||||
|
@ -187,7 +187,7 @@ PerimeterGenerator::process()
|
||||||
}
|
}
|
||||||
|
|
||||||
// if no hole contains this hole, find the contour loop that contains it
|
// if no hole contains this hole, find the contour loop that contains it
|
||||||
for (unsigned short t = loop_number; t >= 0; --t) {
|
for (short t = loop_number; t >= 0; --t) {
|
||||||
for (unsigned short j = 0; j < contours[t].size(); ++j) {
|
for (unsigned short j = 0; j < contours[t].size(); ++j) {
|
||||||
PerimeterGeneratorLoop &candidate_parent = contours[t][j];
|
PerimeterGeneratorLoop &candidate_parent = contours[t][j];
|
||||||
if (candidate_parent.polygon.contains(loop.polygon.first_point())) {
|
if (candidate_parent.polygon.contains(loop.polygon.first_point())) {
|
||||||
|
@ -203,7 +203,7 @@ PerimeterGenerator::process()
|
||||||
}
|
}
|
||||||
|
|
||||||
// nest contour loops
|
// nest contour loops
|
||||||
for (unsigned short d = loop_number; d >= 1; --d) {
|
for (short d = loop_number; d >= 1; --d) {
|
||||||
PerimeterGeneratorLoops &contours_d = contours[d];
|
PerimeterGeneratorLoops &contours_d = contours[d];
|
||||||
|
|
||||||
// loop through all contours having depth == d
|
// loop through all contours having depth == d
|
||||||
|
@ -211,7 +211,7 @@ PerimeterGenerator::process()
|
||||||
const PerimeterGeneratorLoop &loop = contours_d[i];
|
const PerimeterGeneratorLoop &loop = contours_d[i];
|
||||||
|
|
||||||
// find the contour loop that contains it
|
// find the contour loop that contains it
|
||||||
for (unsigned short t = d-1; t >= 0; --t) {
|
for (short t = d-1; t >= 0; --t) {
|
||||||
for (unsigned short j = 0; j < contours[t].size(); ++j) {
|
for (unsigned short j = 0; j < contours[t].size(); ++j) {
|
||||||
PerimeterGeneratorLoop &candidate_parent = contours[t][j];
|
PerimeterGeneratorLoop &candidate_parent = contours[t][j];
|
||||||
if (candidate_parent.polygon.contains(loop.polygon.first_point())) {
|
if (candidate_parent.polygon.contains(loop.polygon.first_point())) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue