Skip to content

Commit

Permalink
Add Origin.AsSource
Browse files Browse the repository at this point in the history
Allows the original origin to be preserved. Useful for people who panelising boards that have strict coordinate systems from imported outlines from MCAD software.
  • Loading branch information
Harry-Loud authored Feb 6, 2025
1 parent d4f1478 commit 58ba066
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kikit/panelize.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class Origin(Enum):
TopRight = 2
BottomLeft = 3
BottomRight = 4
FromSource = 5


class NetClass():
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 58ba066

Please sign in to comment.