From fb89cee37a67914facd693607e4be536292a4313 Mon Sep 17 00:00:00 2001 From: Endika Llano Matxin <119845498+endikallanomatxin@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:02:19 +0200 Subject: [PATCH 1/2] Fix lineTo to do nothing instead of raising error when startPoint and endPoint are equal --- cadquery/cq.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cadquery/cq.py b/cadquery/cq.py index b853fa720..499a4cb6b 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -1622,6 +1622,9 @@ def lineTo(self: T, x: float, y: float, forConstruction: bool = False) -> T: endPoint = self.plane.toWorldCoords((x, y)) + if startPoint == endPoint: + return self + p = Edge.makeLine(startPoint, endPoint) if not forConstruction: From e3d6907844834f7aecb5ed59bd64955b928a520e Mon Sep 17 00:00:00 2001 From: Endika Llano Matxin <119845498+endikallanomatxin@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:26:53 +0200 Subject: [PATCH 2/2] format acording to black --- cadquery/cq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cadquery/cq.py b/cadquery/cq.py index 499a4cb6b..7c3afb60f 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -1624,7 +1624,7 @@ def lineTo(self: T, x: float, y: float, forConstruction: bool = False) -> T: if startPoint == endPoint: return self - + p = Edge.makeLine(startPoint, endPoint) if not forConstruction: