Skip to content

Conversation

hexdae
Copy link
Contributor

@hexdae 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

@hexdae hexdae force-pushed the feature/zone-sync branch 2 times, most recently from 91cb488 to 9ff4a64 Compare August 21, 2025 03:27
@hexdae hexdae changed the title [FEATURE] zone sync [FEATURE] sync zones and graphics Aug 21, 2025
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)
Copy link
Contributor

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
Copy link
Contributor

@akhilles akhilles Aug 21, 2025

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, added

@akhilles
Copy link
Contributor

I'm probably missing something but I think there are 2 strategies being used for syncing elements:

  • clone_to_board + move_by
  • capture_geometry + apply_geometry

Is there a reason to require both? Would clone_to_board + move_by not suffice?

@hexdae hexdae force-pushed the feature/zone-sync branch from 6296ab3 to 548702b Compare August 23, 2025 01:31
@hexdae hexdae force-pushed the feature/zone-sync branch from 548702b to ed1f171 Compare August 24, 2025 03:13
@hexdae
Copy link
Contributor Author

hexdae commented Aug 24, 2025

I 'm probably missing something but I think there are 2 strategies being used for syncing elements:
clone_to_board + move_by
capture_geometry + apply_geometry
Is there a reason to require both? Would clone_to_board + move_by not suffice?

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

@hexdae hexdae merged commit 8e6a63d into main Aug 24, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants