Created
February 22, 2022 20:55
-
-
Save yaqwsx/e7e4f056abc22575fb14d2e8a6695056 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kikit.common import findBoardBoundingBox | |
# This function should be provided by KiKit, but at the moment, it is not. I | |
# opened an issue for that: https://github.com/yaqwsx/KiKit/issues/283. | |
# Basically, panel.makeGrid should take the tolerance parameter, but it doesn't | |
# at the moment. | |
def locateBoard(inputFilename, tolerance): | |
""" | |
Given a filename of the board, find the source are of it. | |
""" | |
inputBoard = pcbnew.LoadBoard(inputFilename) | |
return expandRect(findBoardBoundingBox(inputBoard), tolerance) | |
# And somewhere in the code: | |
substrates = panel.makeGrid(input, | |
sourceArea=locateBoard(input, tolerance=1 * mm), | |
rows=rows, | |
cols=cols, | |
destination=(100 * mm, 100 * mm), | |
verSpace=0, horSpace=0, rotation=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment