From a8960957c00b5b9e927bd5109ee0bbbd390f8998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Mon, 17 Feb 2025 17:09:13 -0300 Subject: [PATCH] Fix #6083 --- src/bonsai/bonsai/tool/polyline.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bonsai/bonsai/tool/polyline.py b/src/bonsai/bonsai/tool/polyline.py index 29b076a274..385a979fe6 100644 --- a/src/bonsai/bonsai/tool/polyline.py +++ b/src/bonsai/bonsai/tool/polyline.py @@ -505,6 +505,10 @@ class Polyline(bonsai.core.tool.Polyline): for point in polyline_points[1:]: # The first can be repeated to form a wall loop if (x, y, z) == (point.x, point.y, point.z): return "Cannot create two points at the same location" + # Avoids duplicating an edge + if len(polyline_points) > 1: + if Vector((x, y, z)) == Vector((polyline_points[-2].x, polyline_points[-2].y, polyline_points[-2].z)): + return # TODO move this limitation to be Wall tool specific. Right now it also affects Measure tool # Avoids creating segments smaller then 0.1. This is a limitation from create_wall_from_2_points length = (