コード例 #1
0
 def Move(self, displacement):
     if (self.refpoint):
         self.refpoint = self.refpoint + np.array(displacement)
     for _, comp in self.components.items():
         comp.MoveBy(displacement)
     for hidbod in self.hidden_bodies:
         MiroAPI.MoveBodyBy(hidbod, displacement)
コード例 #2
0
 def MoveToMatch(self, pointname, other_component, other_pointname, dist=0):
     '''Moves the component to match the provided linkpoint position with the position of a 
     linkpoint on the other component. Distance is calculated in the direction of the 
     linkpoint on the other, non-moving component.'''
     marg = other_component.GetLinkDir(other_pointname)
     marg = marg * dist
     move = other_component.GetLinkPoint(
         other_pointname) - self.GetLinkPoint(pointname) + marg
     MiroAPI.MoveBodyBy(self.body, move)
コード例 #3
0
 def MoveToPosition(self, pos):
     MiroAPI.MoveBodyBy(self.body, pos - self.GetPosition())
コード例 #4
0
 def MoveBy(self, delta_pos):
     MiroAPI.MoveBodyBy(self.body, delta_pos)