From 84b7d6327368229e658c4f45e6447fe0dc4338f2 Mon Sep 17 00:00:00 2001 From: imsenthur Date: Fri, 31 Jul 2020 17:16:09 +0530 Subject: [PATCH] A better fix. --- processor.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/processor.py b/processor.py index c4a643e..82474d2 100644 --- a/processor.py +++ b/processor.py @@ -96,19 +96,18 @@ def execute(self, context): y = round(float(match.group('Y')), 3) g = int(match.group('G')) - vertices[i].append((g, round(x, 3), round(y, 3), z)) - else: - print(line) + if g == 0: + if j+1 < len(layer): + if sub_pattern.search(layer[j+1]).group('G') != '0': + vertices[i].append((g, round(x, 3), round(y, 3), z)) + else: + vertices[i].append((g, round(x, 3), round(y, 3), z)) + + else: + vertices[i].append((g, round(x, 3), round(y, 3), z)) vertices.append([]) - # SAFETY NET - for i in range(0, len(vertices)): - for j in range(0, len(vertices[i])): - if j+1 < len(vertices[i]): - if vertices[i][j][0] == 0 and vertices[i][j+1][0] == 0: - vertices[i].pop(j) - count = 1 for _batch in self.batches(vertices, batch_size): for _layer in _batch: