@Override public ShapeTileBox[] divide_into_sections(double p_max_section_width){
  if (p_max_section_width <= 0) {
    return new ShapeTileBox[0];
  }
  double length=box_ur.v_x - box_ll.v_x;
  double height=box_ur.v_y - box_ll.v_y;
  int x_count=(int)Math.ceil(length / p_max_section_width);
  int y_count=(int)Math.ceil(height / p_max_section_width);
  int section_length_x=(int)Math.ceil(length / x_count);
  int section_length_y=(int)Math.ceil(height / y_count);
  ShapeTileBox[] result=new ShapeTileBox[x_count * y_count];
  int curr_index=0;
  for (int j=0; j < y_count; ++j) {
    int curr_lly=box_ll.v_y + j * section_length_y;
    int curr_ury;
    if (j == (y_count - 1)) {
      curr_ury=box_ur.v_y;
    }
 else {
      curr_ury=curr_lly + section_length_y;
    }
    for (int i=0; i < x_count; ++i) {
      int curr_llx=box_ll.v_x + i * section_length_x;
      int curr_urx;
      if (i == (x_count - 1)) {
        curr_urx=box_ur.v_x;
      }
 else {
        curr_urx=curr_llx + section_length_x;
      }
      result[curr_index]=new ShapeTileBox(curr_llx,curr_lly,curr_urx,curr_ury);
      ++curr_index;
    }
  }
  return result;
}

@ Override public ShapeTileBox [ ] divide_into_sections ( double p_max_section_width ) { if ( p_max_section_width <= 0 ) { return new ShapeTileBox [ 0 ] ; } double length = box_ur . v_x - box_ll . v_x ; double height = box_ur . v_y - box_ll . v_y ; int x_count = ( int ) Math . ceil ( length / p_max_section_width ) ; int y_count = ( int ) Math . ceil ( height / p_max_section_width ) ; int section_length_x = ( int ) Math . ceil ( length / x_count ) ; int section_length_y = ( int ) Math . ceil ( height / y_count ) ; ShapeTileBox [ ] result = new ShapeTileBox [ x_count * y_count ] ; int curr_index = 0 ; for ( int j = 0 ; j < y_count ; ++ j ) { int curr_lly = box_ll . v_y + j * section_length_y ; int curr_ury ; if ( j == ( y_count - 1 ) ) { curr_ury = box_ur . v_y ; } else { curr_ury = curr_lly + section_length_y ; } for ( int i = 0 ; i < x_count ; ++ i ) { int curr_llx = box_ll . v_x + i * section_length_x ; int curr_urx ; if ( i == ( x_count - 1 ) ) { curr_urx = box_ur . v_x ; } else { curr_urx = curr_llx + section_length_x ; } result [ curr_index ] = new ShapeTileBox ( curr_llx , curr_lly , curr_urx , curr_ury ) ; ++ curr_index ; } } return result ; }
divides this box into sections with width and height at most p_max_section_width of about equal size .
