def __init__(self, start_wp=None, end_wp=None, wp_width=5, **kwargs): # FCF59B Shape.__init__(self, color=(0xFF, 0xFF, 0xFF), **kwargs) if start_wp is not None and end_wp is not None: self.start_waypoint = start_wp self.end_waypoint = end_wp else: self.start_waypoint = (self.points[2] + self.points[3]) / 2 self.end_waypoint = (self.points[0] + self.points[1]) / 2 self.start_waypoint = Waypoint( self.start_waypoint[0], self.start_waypoint[1], ydim=wp_width, owner=self, angle=self.angle, ) self.end_waypoint = Waypoint( self.end_waypoint[0], self.end_waypoint[1], ydim=wp_width, owner=self, angle=self.angle, ) self.start_waypoint.nxt = [self.end_waypoint]
def __init__(self, start_wps=[], end_wps=[], **kwargs): Shape.__init__(self, color=(0xf1, 0xf4, 0xf5), **kwargs) point0 = (self.points[2] + self.points[3]) / 2 point1 = (self.points[0] + self.points[1]) / 2 if len(start_wps) and len(end_wps): self.start_waypoints = start_wps self.end_waypoints = end_wps else: self.start_waypoints = [ Waypoint(point0[0], point0[1], owner=self, ydim=5, angle=self.angle), Waypoint(point1[0], point1[1], owner=self, ydim=5, angle=self.angle + np.pi) ] self.end_waypoints = [ Waypoint(point1[0], point1[1], owner=self, ydim=5, angle=self.angle), Waypoint(point0[0], point0[1], owner=self, ydim=5, angle=self.angle + np.pi) ] self.start_waypoints[0].nxt = [self.end_waypoints[0]] self.start_waypoints[1].nxt = [self.end_waypoints[1]]
def __init__(self, **kwargs): Shape.__init__(self, color=(50, 50, 50), **kwargs) self.start_waypoint = (self.points[2] + self.points[3]) / 2 self.end_waypoint = (self.points[0] + self.points[1]) / 2 self.start_waypoint = Waypoint(self.start_waypoint[0], self.start_waypoint[1], self.angle) self.end_waypoint = Waypoint(self.end_waypoint[0], self.end_waypoint[1], self.angle) self.start_waypoint.nxt = [self.end_waypoint]
def __init__(self, **kwargs): Shape.__init__(self, color=(120, 150, 20), **kwargs) point0 = (self.points[2] + self.points[3]) / 2 point1 = (self.points[0] + self.points[1]) / 2 self.start_waypoints = [ Waypoint(point0[0], point0[1], self.angle), Waypoint(point1[0], point1[1], self.angle + np.pi) ] self.end_waypoints = [ Waypoint(point1[0], point1[1], self.angle), Waypoint(point0[0], point0[1], self.angle + np.pi) ] self.start_waypoints[0].nxt = [self.end_waypoints[0]] self.start_waypoints[1].nxt = [self.end_waypoints[1]]