-
Notifications
You must be signed in to change notification settings - Fork 9
[FEATURE] sync zones and graphics #79
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
Conversation
hexdae
commented
Aug 17, 2025
- sync zones and text
- add initial test for zone sync
- add zones to groups
- simpler zone test
- fix zone sync
- fix patch
91cb488
to
9ff4a64
Compare
min_y = min(y for x, y in all_points) | ||
max_y = max(y for x, y in all_points) | ||
|
||
return VirtualBoundingBox(min_x, min_y, max_x - min_x, max_y - min_y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious if get_kicad_bbox()
would work here? I think it just calls kicad item's GetBoundingBox()
for j in range(contour.PointCount()): | ||
pt = contour.CPoint(j) | ||
contour.SetPoint(j, pcbnew.VECTOR2I(pt.x + dx, pt.y + dy)) | ||
self._capture_outline() # Update cached points |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see kicad Zone
has move()
:
def move(self, delta: Vector2):
"""Moves the zone by the given delta vector"""
self.outline.move(delta)
for polygon in self.filled_polygons.values():
for shape in polygon:
shape.move(delta)
not sure if it'll work here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, added
I'm probably missing something but I think there are 2 strategies being used for syncing elements:
Is there a reason to require both? Would |
6296ab3
to
548702b
Compare
548702b
to
ed1f171
Compare
Initially I thought I needed the capture geometry for some of the polygons, but almost everything we want to move has a .move option, so good idea, removed those methods |