Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCB pcb.footprint.reference_mathces().move(x,y) not moving dependent items #11

Open
dwillmore opened this issue Oct 23, 2024 · 0 comments

Comments

@dwillmore
Copy link

dwillmore commented Oct 23, 2024

This very well may be user error as I am not a python programmer, but I watched the video a couple of times and read the readme.md as well. I'm trying to move a bunch of diodes in my PCB to a staggered grid. I've used a spreadsheet to develop the formula for their locations and it agrees with the x and y values that I get from my python code if I just use a print() instead of the .move().

Here's the code:

 for column in range(0,10):
     for row in range(0,10):
         diode = (row + 10 * column)
         y = 4 * row + ((column % 2)*2)
         x = 3.4641 * column
         pcb.footprint.reference_matches('D.?')[diode].move(x,y)

When I load the pcb up in kicad 7.0, I get:
image

It looks like the silk for the LEDs is close to right (but still wrong). But the holes, references, etc. are up in a crazy jumble negative of the origin. Any guidance? I used .move() because it's supposed to take care of the things that depend on the object being moved so that they stay together, but that doesn't quite look like it's working. Or I'm holding it wrong, which is a definite possibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant