From 14c726008d9438e68db72a696f81428fbc7245ff Mon Sep 17 00:00:00 2001 From: Vincent Cadoret Date: Fri, 11 Dec 2020 19:50:15 -0500 Subject: [PATCH] Split out clashes that were not grouped so they so up individually. --- src/ifcclash/ifcclash.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ifcclash/ifcclash.py b/src/ifcclash/ifcclash.py index 819cafff4c..4b9b3c47e9 100644 --- a/src/ifcclash/ifcclash.py +++ b/src/ifcclash/ifcclash.py @@ -283,7 +283,9 @@ class IfcClasher: continue clashes = clash_set["clashes"] if len(clashes) == 0: + print(f"Skipping clash set [{clash_set['name']}] since it contains no clash results.") continue + count_of_input_clashes += len(clashes) positions = [] @@ -307,7 +309,13 @@ class IfcClasher: if len(pred) == len(clashes.values()): i = 0 for clash in clashes.values(): - clash["smart_group"] = int(pred[i]) + int_prediction = int(pred[i]) + if int_prediction == -1: + # ungroup this clash since it's a single clash that we were not able to group. + new_clash_group_number = np.amax(pred).item() + 1 + i + clash["smart_group"] = new_clash_group_number + else: + clash["smart_group"] = int_prediction i += 1 # Create JSON with smart_groups that contain GlobalIDs