public final ArrayList<BrdTracep> split_with_end_point(int line_idx,PlaPointInt p_point){
  ArrayList<BrdTracep> risul=new ArrayList<BrdTracep>(2);
  if (!is_on_the_board())   return risul;
  if (!split_inside_drill_pad_allowed(p_point))   return risul;
  ArrayList<Polyline> split_polylines=polyline.split_at_point(line_idx,p_point);
  if (split_polylines.size() < 2) {
    if (r_board.debug(Mdbg.TRACE_SPLIT,Ldbg.DEBUG))     r_board.userPrintln("split_with_end_point: split_at_point FAIL id=" + get_id_no());
    return risul;
  }
  r_board.remove_item(this);
  BrdTracep first_trace=r_board.insert_trace_without_cleaning(split_polylines.get(0),get_layer(),get_half_width(),net_nos,clearance_idx(),get_fixed_state());
  if (first_trace == null) {
    r_board.userPrintln("split_with_end_point: first insert FAILS");
    return risul;
  }
  BrdTracep second_trace=r_board.insert_trace_without_cleaning(split_polylines.get(1),get_layer(),get_half_width(),net_nos,clearance_idx(),get_fixed_state());
  if (second_trace == null) {
    r_board.userPrintln("split_with_end_point: second insert FAILS");
    return risul;
  }
  if (r_board.debug(Mdbg.TRACE_SPLIT,Ldbg.DEBUG))   r_board.userPrintln("split_with_end_point: first.id=" + first_trace.get_id_no() + " second.id="+ second_trace.get_id_no());
  risul.add(first_trace);
  risul.add(second_trace);
  return risul;
}

public final ArrayList < BrdTracep > split_with_end_point ( int line_idx , PlaPointInt p_point ) { ArrayList < BrdTracep > risul = new ArrayList < BrdTracep > ( 2 ) ; if ( ! is_on_the_board ( ) ) return risul ; if ( ! split_inside_drill_pad_allowed ( p_point ) ) return risul ; ArrayList < Polyline > split_polylines = polyline . split_at_point ( line_idx , p_point ) ; if ( split_polylines . size ( ) < 2 ) { if ( r_board . debug ( Mdbg . TRACE_SPLIT , Ldbg . DEBUG ) ) r_board . userPrintln ( "split_with_end_point: split_at_point FAIL id=" + get_id_no ( ) ) ; return risul ; } r_board . remove_item ( this ) ; BrdTracep first_trace = r_board . insert_trace_without_cleaning ( split_polylines . get ( 0 ) , get_layer ( ) , get_half_width ( ) , net_nos , clearance_idx ( ) , get_fixed_state ( ) ) ; if ( first_trace == null ) { r_board . userPrintln ( "split_with_end_point: first insert FAILS" ) ; return risul ; } BrdTracep second_trace = r_board . insert_trace_without_cleaning ( split_polylines . get ( 1 ) , get_layer ( ) , get_half_width ( ) , net_nos , clearance_idx ( ) , get_fixed_state ( ) ) ; if ( second_trace == null ) { r_board . userPrintln ( "split_with_end_point: second insert FAILS" ) ; return risul ; } if ( r_board . debug ( Mdbg . TRACE_SPLIT , Ldbg . DEBUG ) ) r_board . userPrintln ( "split_with_end_point: first.id=" + first_trace . get_id_no ( ) + " second.id=" + second_trace . get_id_no ( ) ) ; risul . add ( first_trace ) ; risul . add ( second_trace ) ; return risul ; }
splits this trace into two at p_point . can return false i for example p_point is not located on this trace or already split !
