Passing multiple values between methods/classes

I’m creating an Hexagonal grid
I have the points for creating it already(edges). The method cell calculates the creation of one hexagon and then it is passed to the method grid where the grid is created. The problem is I cannot get the values of all the edges(x,y) created within the grid method. I tried using an ArrayList to save all the edges but I´m getting incomplete values.
I need the edges of the complete grid in order to use them in a more general class.
I know the grid is calculated correctly because I can draw it if I uncomment the code from lines 31 to 35.

Any suggestion would be greatly appreciated

Hexagon h;

void setup() {
  size(500, 500);
  h= new Hexagon();

class Hexagon {

  int sides;
  int size;

  Hexagon() {
    edges= new PVector[sides];

  void cell(float cenX, float cenY) {

    for (int i=0; i<sides; i++) {
      float angle_deg=60*i-30;
      float angle_rad= PI/180*angle_deg;
      float edX= cenX+size*cos(angle_rad);
      float edY= cenY+size*sin(angle_rad);

      edges[i]= new PVector(edX, edY);
    //for (int i =0; i<sides-1;i++){
    //line(edges[i].x, edges[i].y, edges[i+1].x, edges[i+1].y);
    //line(edges[5].x, edges[5].y, edges[0].x, edges[0].y);

  ArrayList<PVector> grid() {

    ArrayList <PVector> gridPts= new ArrayList <PVector>();
    float h=2*size;
    float w=(sqrt(3))*size;
    float vertCent=h*0.75;
    int row=0;

    for (float cenY=h/2; cenY<250; cenY+=vertCent)
      float offX= ((row%2)==0) ? w:w/2;

      for (float cenX=offX+50; cenX<250; cenX+=w)
        cell(cenX, cenY);

        gridPts.add(new PVector(cenX, cenY));
    println(gridPts.get(0));  /////INCOMPLETE VALUES
    return gridPts;

Were you able to resolve this issue?

I’m a bit confused by the example code. Is class Hexagon for a single hexagon, or for a grid of hexagons? Is your only goal to draw the lines of a hexagonal mesh, or do you want to do anything else with it – like give different tiles different fills or outline colors, or change the scale, or merge pieces et cetera?