parameters: (self, poly)
return_statement: return np.array(quad_list)
docstring: Split poly into quads.
docstring_summary: Split poly into quads.
docstring_tokens: Split poly into quads .
function: def poly2quads(self, poly):
          """
          Split poly into quads.
          """
          quad_list = []
          point_num = poly.shape[0]
  
          # point pair
          point_pair_list = []
          for idx in range(point_num // 2):
              point_pair = [poly[idx], poly[point_num - 1 - idx]]
              point_pair_list.append(point_pair)
  
          quad_num = point_num // 2 - 1
          for idx in range(quad_num):
              # reshape and adjust to clock-wise
              quad_list.append((np.array(point_pair_list)[[idx, idx + 1]]
                                ).reshape(4, 2)[[0, 2, 3, 1]])
  
          return np.array(quad_list)
function_tokens: def poly2quads ( self , poly ) : quad_list = [ ] point_num = poly . shape [ 0 ] # point pair point_pair_list = [ ] for idx in range ( point_num // 2 ) : point_pair = [ poly [ idx ] , poly [ point_num - 1 - idx ] ] point_pair_list . append ( point_pair ) quad_num = point_num // 2 - 1 for idx in range ( quad_num ) : # reshape and adjust to clock-wise quad_list . append ( ( np . array ( point_pair_list ) [ [ idx , idx + 1 ] ] ) . reshape ( 4 , 2 ) [ [ 0 , 2 , 3 , 1 ] ] ) return np . array ( quad_list )