(field_size, goal_size)
return [
      ((0., -wall_offset_y, box_half_height),
       (field_size[0], thickness, box_half_height)),  # near side
      ((0., wall_offset_y, box_half_height),
       (field_size[0], thickness, box_half_height)),  # far side
      ((-wall_offset_x, -corner_pos_y, box_half_height),
       (thickness, corner_size_y, box_half_height)),  # left near corner
      ((-wall_offset_x, 0., top_pos_z),
       (thickness, goal_size[1], top_size_z)),  # left top corner
      ((-wall_offset_x, corner_pos_y, box_half_height),
       (thickness, corner_size_y, box_half_height)),  # left far corner
      ((wall_offset_x, -corner_pos_y, box_half_height),
       (thickness, corner_size_y, box_half_height)),  # right near corner
      ((wall_offset_x, 0., top_pos_z),
       (thickness, goal_size[1], top_size_z)),  # right top corner
      ((wall_offset_x, corner_pos_y, box_half_height),
       (thickness, corner_size_y, box_half_height)),  # right far corner
  ]
Infers position and size of fieldbox given pitch size.

  Walls are placed around the field so that the ball cannot travel beyond
  `field` but walkers can walk outside of the `field` but not the surrounding
  pitch. Holes are left in the fieldbox at the goal positions to enable scoring.

  Args:
    field_size: a tuple of (length, width) of the field.
    goal_size: a tuple of (unused_depth, width, height) of the goal.

  Returns:
    a list of 8 tuples, each representing the position and size of a wall box.
Infers position and size of fieldbox given pitch size.
Infers position and size of fieldbox given pitch size .
def _fieldbox_pos_size(field_size, goal_size):
  """Infers position and size of fieldbox given pitch size.

  Walls are placed around the field so that the ball cannot travel beyond
  `field` but walkers can walk outside of the `field` but not the surrounding
  pitch. Holes are left in the fieldbox at the goal positions to enable scoring.

  Args:
    field_size: a tuple of (length, width) of the field.
    goal_size: a tuple of (unused_depth, width, height) of the goal.

  Returns:
    a list of 8 tuples, each representing the position and size of a wall box.
  """

  box_half_height = 20.
  corner_pos_y = 0.5 * (field_size[1] + goal_size[1])
  corner_size_y = 0.5 * (field_size[1] - goal_size[1])
  thickness = 1.0
  top_pos_z = box_half_height + goal_size[2]
  top_size_z = box_half_height - goal_size[2]
  wall_offset_x = field_size[0] + thickness
  wall_offset_y = field_size[1] + thickness
  return [
      ((0., -wall_offset_y, box_half_height),
       (field_size[0], thickness, box_half_height)),  # near side
      ((0., wall_offset_y, box_half_height),
       (field_size[0], thickness, box_half_height)),  # far side
      ((-wall_offset_x, -corner_pos_y, box_half_height),
       (thickness, corner_size_y, box_half_height)),  # left near corner
      ((-wall_offset_x, 0., top_pos_z),
       (thickness, goal_size[1], top_size_z)),  # left top corner
      ((-wall_offset_x, corner_pos_y, box_half_height),
       (thickness, corner_size_y, box_half_height)),  # left far corner
      ((wall_offset_x, -corner_pos_y, box_half_height),
       (thickness, corner_size_y, box_half_height)),  # right near corner
      ((wall_offset_x, 0., top_pos_z),
       (thickness, goal_size[1], top_size_z)),  # right top corner
      ((wall_offset_x, corner_pos_y, box_half_height),
       (thickness, corner_size_y, box_half_height)),  # right far corner
  ]
def _fieldbox_pos_size ( field_size , goal_size ) : box_half_height = 20. corner_pos_y = 0.5 * ( field_size [ 1 ] + goal_size [ 1 ] ) corner_size_y = 0.5 * ( field_size [ 1 ] - goal_size [ 1 ] ) thickness = 1.0 top_pos_z = box_half_height + goal_size [ 2 ] top_size_z = box_half_height - goal_size [ 2 ] wall_offset_x = field_size [ 0 ] + thickness wall_offset_y = field_size [ 1 ] + thickness return [ ( ( 0. , - wall_offset_y , box_half_height ) , ( field_size [ 0 ] , thickness , box_half_height ) ) , # near side ( ( 0. , wall_offset_y , box_half_height ) , ( field_size [ 0 ] , thickness , box_half_height ) ) , # far side ( ( - wall_offset_x , - corner_pos_y , box_half_height ) , ( thickness , corner_size_y , box_half_height ) ) , # left near corner ( ( - wall_offset_x , 0. , top_pos_z ) , ( thickness , goal_size [ 1 ] , top_size_z ) ) , # left top corner ( ( - wall_offset_x , corner_pos_y , box_half_height ) , ( thickness , corner_size_y , box_half_height ) ) , # left far corner ( ( wall_offset_x , - corner_pos_y , box_half_height ) , ( thickness , corner_size_y , box_half_height ) ) , # right near corner ( ( wall_offset_x , 0. , top_pos_z ) , ( thickness , goal_size [ 1 ] , top_size_z ) ) , # right top corner ( ( wall_offset_x , corner_pos_y , box_half_height ) , ( thickness , corner_size_y , box_half_height ) ) , # right far corner ]