From 5aa7758795736c52edc2a18006aacc33ed6cdccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Sun, 25 Aug 2024 21:36:11 -0300 Subject: [PATCH] Small fix in angle input for polytool --- src/bonsai/bonsai/bim/module/model/decorator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/model/decorator.py b/src/bonsai/bonsai/bim/module/model/decorator.py index c416bc3559..e2eae33d3e 100644 --- a/src/bonsai/bonsai/bim/module/model/decorator.py +++ b/src/bonsai/bonsai/bim/module/model/decorator.py @@ -392,11 +392,13 @@ class PolylineDecorator: else: # Creates a fake "second to last" point away from the first point but in the same x axis # this allows to calculate the angle relative to x axis when there is only one point - second_to_last_point = Vector((last_point.x + 10, last_point.y, last_point.z)) + second_to_last_point = Vector((last_point.x - 1000, last_point.y, last_point.z)) distance = (snap_vector - last_point).length if distance > 0: + print(snap_vector, last_point, second_to_last_point) angle = tool.Cad.angle_3_vectors(snap_vector, last_point, second_to_last_point, degrees=True) + print("A", angle) if cls.input_panel: cls.input_panel["X"] = str(round(snap_vector.x, 4)) cls.input_panel["Y"] = str(round(snap_vector.y, 4)) @@ -473,7 +475,7 @@ class PolylineDecorator: else: # Creates a fake "second to last" point away from the first point but in the same x axis # this allows to calculate the angle relative to x axis when there is only one point - second_to_last_point = Vector((last_point.x + 10, last_point.y, last_point.z)) + second_to_last_point = Vector((last_point.x - 10, last_point.y, last_point.z)) distance = float(cls.input_panel["D"])