diff --git a/freecad/kiconnect/board.py b/freecad/kiconnect/board.py index ee5f4aa..8d1763f 100644 --- a/freecad/kiconnect/board.py +++ b/freecad/kiconnect/board.py @@ -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