From 58ba066cece6a04aa56f941554e3fce9b2d83bdd Mon Sep 17 00:00:00 2001 From: Harry Loud <91973394+Harry-Loud@users.noreply.github.com> Date: Thu, 6 Feb 2025 13:19:01 +0000 Subject: [PATCH] Add Origin.AsSource Allows the original origin to be preserved. Useful for people who panelising boards that have strict coordinate systems from imported outlines from MCAD software. --- kikit/panelize.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kikit/panelize.py b/kikit/panelize.py index 6dcc3f80..8d845e8a 100644 --- a/kikit/panelize.py +++ b/kikit/panelize.py @@ -144,6 +144,7 @@ class Origin(Enum): TopRight = 2 BottomLeft = 3 BottomRight = 4 + FromSource = 5 class NetClass(): @@ -185,6 +186,8 @@ def getOriginCoord(origin, bBox): return VECTOR2I(bBox.GetX(), bBox.GetY() + bBox.GetHeight()) if origin == Origin.BottomRight: return VECTOR2I(bBox.GetX() + bBox.GetWidth(), bBox.GetY() + bBox.GetHeight()) + if origin == Origin.AsSource: + return VECTOR2I(0,0) def appendItem(board: pcbnew.BOARD, item: pcbnew.BOARD_ITEM, yieldMapping: Optional[Callable[[str, str], None]]=None) -> None: