black format

This commit is contained in:
Andrej730
2024-07-02 14:49:14 +05:00
parent 10c3893b79
commit 5d1b2e4651
+8 -6
View File
@@ -226,7 +226,7 @@ def main(settings, files, iterators=None, merge_projection=True, progress_functi
else: else:
num_passes = 0 num_passes = 0
for iteration in range(num_passes+1): for iteration in range(num_passes + 1):
# initialize empty group, note that in the current approach only one # initialize empty group, note that in the current approach only one
# group is stored # group is stored
@@ -248,7 +248,7 @@ def main(settings, files, iterators=None, merge_projection=True, progress_functi
if iteration != num_passes: if iteration != num_passes:
pairs = svgfill_context.get_face_pairs() pairs = svgfill_context.get_face_pairs()
semantics = [None] * (max(pairs)+1) semantics = [None] * (max(pairs) + 1)
# For every edge print the two neighbouring faces # For every edge print the two neighbouring faces
# for x in range(0, len(pairs), 2): # for x in range(0, len(pairs), 2):
# print(x // 2, *pairs[x:x+2]) # print(x // 2, *pairs[x:x+2])
@@ -348,17 +348,19 @@ def main(settings, files, iterators=None, merge_projection=True, progress_functi
# of element surfaces non-orthogonal to the view direction # of element surfaces non-orthogonal to the view direction
def format(x): def format(x):
if x is None: return None if x is None:
return None
elif isinstance(x, tuple): elif isinstance(x, tuple):
# found to be inside element using tree.select() no face or style info # found to be inside element using tree.select() no face or style info
return x return x
else: return (x.instance.is_a(), x.ray_distance, tuple(x.position)) else:
return (x.instance.is_a(), x.ray_distance, tuple(x.position))
pp = pairs[he_idx:he_idx+2] pp = pairs[he_idx : he_idx + 2]
if pp == (-1, -1): if pp == (-1, -1):
continue continue
data = list(map(format, map(semantics.__getitem__, pp))) data = list(map(format, map(semantics.__getitem__, pp)))
if None not in data and data[0][0] == data[1][0] and abs(data[0][1] - data[1][1]) < 1.e-5: if None not in data and data[0][0] == data[1][0] and abs(data[0][1] - data[1][1]) < 1.0e-5:
to_remove.append(he_idx // 2) to_remove.append(he_idx // 2)
# Print edge index and semantic data # Print edge index and semantic data
# print(he_idx // 2, *data) # print(he_idx // 2, *data)