public Polyline(PlaPointIntAlist points_alist){
  int initial_len=points_alist.size();
  if (initial_len < 2)   throw new IllegalArgumentException(classname + "A must contain at least 2 points");
  ArrayList<PlaPointInt> corners_alist=new ArrayList<PlaPointInt>(initial_len);
  for (  PlaPointInt a_point : points_alist) {
    if (a_point == null)     continue;
    if (has_point(corners_alist,a_point))     continue;
    if (has_colinear(corners_alist,a_point))     continue;
    corners_alist.add(a_point);
  }
  int input_len=corners_alist.size();
  lines_list=new ArrayList<PlaLineInt>(input_len + 1);
  if (input_len < 2)   throw new IllegalArgumentException(classname + "B must contain at least 2 different points");
  PlaPointInt acorner=corners_alist.get(0);
  PlaDirection dir=new PlaDirection(acorner,corners_alist.get(1));
  lines_list.add(new PlaLineInt(acorner,dir.rotate_45_deg(2)));
  for (int index=1; index < input_len; ++index)   lines_list.add(new PlaLineInt(corners_alist.get(index - 1),corners_alist.get(index)));
  acorner=corners_alist.get(input_len - 1);
  dir=new PlaDirection(acorner,corners_alist.get(input_len - 2));
  lines_list.add(new PlaLineInt(acorner,dir.rotate_45_deg(2)));
  corners_allocate(corner_count());
  for (int index=0; index < input_len; index++)   precalculated_corners[index]=corners_alist.get(index);
}

public Polyline ( PlaPointIntAlist points_alist ) { int initial_len = points_alist . size ( ) ; if ( initial_len < 2 ) throw new IllegalArgumentException ( classname + "A must contain at least 2 points" ) ; ArrayList < PlaPointInt > corners_alist = new ArrayList < PlaPointInt > ( initial_len ) ; for ( PlaPointInt a_point : points_alist ) { if ( a_point == null ) continue ; if ( has_point ( corners_alist , a_point ) ) continue ; if ( has_colinear ( corners_alist , a_point ) ) continue ; corners_alist . add ( a_point ) ; } int input_len = corners_alist . size ( ) ; lines_list = new ArrayList < PlaLineInt > ( input_len + 1 ) ; if ( input_len < 2 ) throw new IllegalArgumentException ( classname + "B must contain at least 2 different points" ) ; PlaPointInt acorner = corners_alist . get ( 0 ) ; PlaDirection dir = new PlaDirection ( acorner , corners_alist . get ( 1 ) ) ; lines_list . add ( new PlaLineInt ( acorner , dir . rotate_45_deg ( 2 ) ) ) ; for ( int index = 1 ; index < input_len ; ++ index ) lines_list . add ( new PlaLineInt ( corners_alist . get ( index - 1 ) , corners_alist . get ( index ) ) ) ; acorner = corners_alist . get ( input_len - 1 ) ; dir = new PlaDirection ( acorner , corners_alist . get ( input_len - 2 ) ) ; lines_list . add ( new PlaLineInt ( acorner , dir . rotate_45_deg ( 2 ) ) ) ; corners_allocate ( corner_count ( ) ) ; for ( int index = 0 ; index < input_len ; index ++ ) precalculated_corners [ index ] = corners_alist . get ( index ) ; }
creates a polyline of length point_arr . size + 1 so that the i - th corner of p_polygon will be the intersection of the i - th and the i + 1 - th lines of the new created p_polyline for 0 < = i < p_point_arr . length . there is quite some checks done to ensure the result is meaningfult
