code: def _setup_xy(self,bounds,xdensity,ydensity,x,y,orientation):
          
          self.debug("bounds=%s, xdensity=%s, ydensity=%s, x=%s, y=%s, orientation=%s",bounds,xdensity,ydensity,x,y,orientation)
          # Generate vectors representing coordinates at which the pattern
          # will be sampled.
  
          # CB: note to myself - use slice_._scs if supplied?
          x_points,y_points = SheetCoordinateSystem(bounds,xdensity,ydensity).sheetcoordinates_of_matrixidx()
  
          # Generate matrices of x and y sheet coordinates at which to
          # sample pattern, at the correct orientation
          self.pattern_x, self.pattern_y = self._create_and_rotate_coordinate_arrays(x_points-x,y_points-y,orientation)
docs: Produce pattern coordinate matrices from the bounds and
          density (or rows and cols), and transforms them according to
          x, y, and orientation.