public ArrayList<PlaToupleInt> entrance_points(Polyline p_polyline){
  ArrayList<PlaToupleInt> result=new ArrayList<PlaToupleInt>(2 * p_polyline.plaline_len());
  int prev_intersection_line_no=-1;
  int prev_intersection_edge_no=-1;
  for (int line_no=1; line_no < p_polyline.plaline_len(-1); ++line_no) {
    PlaSegmentInt curr_line_seg=p_polyline.segment_get(line_no);
    int[] curr_intersections=curr_line_seg.border_intersections(this);
    for (int index=0; index < curr_intersections.length; ++index) {
      int edge_no=curr_intersections[index];
      if (line_no != prev_intersection_line_no || edge_no != prev_intersection_edge_no) {
        result.add(new PlaToupleInt(line_no,edge_no));
        prev_intersection_line_no=line_no;
        prev_intersection_edge_no=edge_no;
      }
    }
  }
  return result;
}

public ArrayList < PlaToupleInt > entrance_points ( Polyline p_polyline ) { ArrayList < PlaToupleInt > result = new ArrayList < PlaToupleInt > ( 2 * p_polyline . plaline_len ( ) ) ; int prev_intersection_line_no = - 1 ; int prev_intersection_edge_no = - 1 ; for ( int line_no = 1 ; line_no < p_polyline . plaline_len ( - 1 ) ; ++ line_no ) { PlaSegmentInt curr_line_seg = p_polyline . segment_get ( line_no ) ; int [ ] curr_intersections = curr_line_seg . border_intersections ( this ) ; for ( int index = 0 ; index < curr_intersections . length ; ++ index ) { int edge_no = curr_intersections [ index ] ; if ( line_no != prev_intersection_line_no || edge_no != prev_intersection_edge_no ) { result . add ( new PlaToupleInt ( line_no , edge_no ) ) ; prev_intersection_line_no = line_no ; prev_intersection_edge_no = edge_no ; } } } return result ; }
returns an arry of tuples of integers . the length of the array is the number of points , where p_polyline enters or leaves the interiour of this shape . the first coordinate of the tuple is the number of the line segment of p_polyline , which enters the simplex and the second coordinate of the tuple is the number of the edge_line of the simplex , which is crossed there . that means that the entrance point is the intersection of this 2 lines .
