improving sync_from
This commit is contained in:
parent
0a95b5529e
commit
6137b50208
1 changed files with 11 additions and 0 deletions
|
@ -23,6 +23,12 @@ class BoardSketchObject(BaseObject):
|
||||||
def execute(self, feature):
|
def execute(self, feature):
|
||||||
feature.recompute()
|
feature.recompute()
|
||||||
|
|
||||||
|
def get_parent_board(self):
|
||||||
|
try:
|
||||||
|
return self.feature.getParent().getParent().Proxy
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
def point_to_vector(self, point, offset=True):
|
def point_to_vector(self, point, offset=True):
|
||||||
return (
|
return (
|
||||||
App.Vector(point.x,
|
App.Vector(point.x,
|
||||||
|
@ -39,6 +45,11 @@ class BoardSketchObject(BaseObject):
|
||||||
feature = self.feature
|
feature = self.feature
|
||||||
vectors = []
|
vectors = []
|
||||||
|
|
||||||
|
board = self.get_parent_board()
|
||||||
|
if board:
|
||||||
|
self.board_polygon = board.get_polygon(board.polygon_id)
|
||||||
|
|
||||||
|
# board.get_shapes needs to be called to ensure polygons are actually up to date
|
||||||
for node in self.board_polygon.polygons[0].outline:
|
for node in self.board_polygon.polygons[0].outline:
|
||||||
vectors.append(self.point_to_vector(node.point))
|
vectors.append(self.point_to_vector(node.point))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue