Welcome to the forum.
@scudly has provided a solution but it might be nice to see it visually.
You can either use a PGraphic for a tile as this would automatically trim the excess. or use clip() to restrict the area to the tile size.