Improve performance when bed are large

This commit is contained in:
SoftFever 2024-05-11 23:26:02 +08:00
parent 98caf561ef
commit 8f77755535
3 changed files with 13 additions and 10 deletions

View file

@ -1307,9 +1307,9 @@ Polygons EdgeGrid::Grid::contours_simplified(coord_t offset, bool fill_holes) co
// 1) Collect the lines.
std::vector<Line> lines;
EndPointMapType start_point_to_line_idx;
for (int r = 0; r <= int(m_rows); ++ r) {
for (int c = 0; c <= int(m_cols); ++ c) {
int addr = (r + 1) * cell_cols + c + 1;
for (coord_t r = 0; r <= coord_t(m_rows); ++ r) {
for (coord_t c = 0; c <= coord_t(m_cols); ++ c) {
size_t addr = (r + 1) * cell_cols + c + 1;
bool left = cell_inside[addr - 1];
bool top = cell_inside[addr - cell_cols];
bool current = cell_inside[addr];