Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Morgan 'ARR\!' Allen
796206f116 helper method to find the Board Feature of a Sketch 2025-05-16 23:15:55 -07:00

View file

@ -72,7 +72,7 @@ class BoardObject(BaseObject):
return self.board_sketch
def get_boardpoly(self):
def get_boardpoly(self, polygon_id=None):
# TODO remove in favor of extract_polygons class method
board = self.kicad_board
@ -80,8 +80,10 @@ class BoardObject(BaseObject):
edge_cuts = [ edge for edge in board.get_shapes() if edge.layer == BoardLayer.BL_Edge_Cuts ]
polygons = [ edge for edge in edge_cuts if isinstance(edge, BoardPolygon) ]
# XXX only single board supported at the moment
return polygons[0]
if polygon_id:
return [ p for p in polygons if p.id.value == polygon_id ][0]
else:
return polygons
def pocket_vias(self):
board = self.kicad_board