From 958b47ab471053798ff55194c4aff4cf52f7602a Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 26 Apr 2023 23:37:38 +0200 Subject: Speed up protoboard generation --- gerbonara/utils.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gerbonara/utils.py') diff --git a/gerbonara/utils.py b/gerbonara/utils.py index 933b3ca..c1868af 100644 --- a/gerbonara/utils.py +++ b/gerbonara/utils.py @@ -264,6 +264,11 @@ def add_bounds(b1, b2): return sum_bounds((b1, b2)) +def offset_bounds(bounds, dx=0, dy=0): + (min_x, min_y), (max_x, max_y) = bounds + return (min_x+dx, min_y+dy), (max_x+dx, max_y+dy) + + def sum_bounds(bounds, *, default=None): """ Add/union multiple bounding boxes. -- cgit