parameters: (self)
docstring: Generates a curve for each connection of two stops / transfer nodes.
docstring_summary: Generates a curve for each connection of two stops / transfer nodes.
docstring_tokens: Generates a curve for each connection of two stops / transfer nodes .
function: def __generate_shapes_for_segments(self):
          """Generates a curve for each connection of two stops / transfer nodes."""
          for (id1, id2), info in self.segments.items():
              point1 = [self.__get_stop(id1)['point']['x'], self.__get_stop(id1)['point']['y']]
              point2 = [self.__get_stop(id2)['point']['x'], self.__get_stop(id2)['point']['y']]
  
              if info['guide_points'][id1]:
                  guide1 = self.__get_average_stops_point(info['guide_points'][id1])
              else:
                  guide1 = [2 * point1[0] - point2[0], 2 * point1[1] - point2[1]]
  
              if info['guide_points'][id2]:
                  guide2 = self.__get_average_stops_point(info['guide_points'][id2])
              else:
                  guide2 = [2 * point2[0] - point1[0], 2 * point2[1] - point1[1]]
  
              curve_points = bezier_curves.segment_to_Catmull_Rom_curve(guide1, point1, point2, guide2,
                                                                        self.points_per_curve, self.alpha)
              info['curve'] = np.array(curve_points)
  
              polyline = []
              for point in curve_points:
                  polyline.append({'x': point[0], 'y': point[1]})
  
              shape = {'id': {'stop1_id': id1, 'stop2_id': id2},
                       'polyline': polyline}
              self.shapes.append(shape)
function_tokens: def __generate_shapes_for_segments ( self ) : for ( id1 , id2 ) , info in self . segments . items ( ) : point1 = [ self . __get_stop ( id1 ) [ 'point' ] [ 'x' ] , self . __get_stop ( id1 ) [ 'point' ] [ 'y' ] ] point2 = [ self . __get_stop ( id2 ) [ 'point' ] [ 'x' ] , self . __get_stop ( id2 ) [ 'point' ] [ 'y' ] ] if info [ 'guide_points' ] [ id1 ] : guide1 = self . __get_average_stops_point ( info [ 'guide_points' ] [ id1 ] ) else : guide1 = [ 2 * point1 [ 0 ] - point2 [ 0 ] , 2 * point1 [ 1 ] - point2 [ 1 ] ] if info [ 'guide_points' ] [ id2 ] : guide2 = self . __get_average_stops_point ( info [ 'guide_points' ] [ id2 ] ) else : guide2 = [ 2 * point2 [ 0 ] - point1 [ 0 ] , 2 * point2 [ 1 ] - point1 [ 1 ] ] curve_points = bezier_curves . segment_to_Catmull_Rom_curve ( guide1 , point1 , point2 , guide2 , self . points_per_curve , self . alpha ) info [ 'curve' ] = np . array ( curve_points ) polyline = [ ] for point in curve_points : polyline . append ( { 'x' : point [ 0 ] , 'y' : point [ 1 ] } ) shape = { 'id' : { 'stop1_id' : id1 , 'stop2_id' : id2 } , 'polyline' : polyline } self . shapes . append ( shape )