private boolean is_obstacle_clearance(BrdItem curr_item){
  boolean is_obstacle=curr_item.is_obstacle(this);
  if (!is_obstacle)   return false;
  if (!(this instanceof BrdTracep && curr_item instanceof BrdTracep))   return true;
  BrdTracep this_trace=(BrdTracep)this;
  boolean contact_found=false;
  PlaPoint contact_point=this_trace.corner_first();
  Collection<BrdItem> curr_contacts=this_trace.get_normal_contacts(contact_point,true);
  if (curr_contacts.contains(curr_item))   contact_found=true;
  if (!contact_found) {
    contact_point=this_trace.corner_last();
    curr_contacts=this_trace.get_normal_contacts(contact_point,true);
    if (curr_contacts.contains(curr_item))     contact_found=true;
  }
  if (!contact_found)   return true;
  for (  BrdItem curr_contact : curr_contacts) {
    if (!(curr_contact instanceof BrdAbitPin))     continue;
    if (curr_contact.shares_net(this) && curr_contact.shares_net(curr_item))     return false;
  }
  return true;
}

private boolean is_obstacle_clearance ( BrdItem curr_item ) { boolean is_obstacle = curr_item . is_obstacle ( this ) ; if ( ! is_obstacle ) return false ; if ( ! ( this instanceof BrdTracep && curr_item instanceof BrdTracep ) ) return true ; BrdTracep this_trace = ( BrdTracep ) this ; boolean contact_found = false ; PlaPoint contact_point = this_trace . corner_first ( ) ; Collection < BrdItem > curr_contacts = this_trace . get_normal_contacts ( contact_point , true ) ; if ( curr_contacts . contains ( curr_item ) ) contact_found = true ; if ( ! contact_found ) { contact_point = this_trace . corner_last ( ) ; curr_contacts = this_trace . get_normal_contacts ( contact_point , true ) ; if ( curr_contacts . contains ( curr_item ) ) contact_found = true ; } if ( ! contact_found ) return true ; for ( BrdItem curr_contact : curr_contacts ) { if ( ! ( curr_contact instanceof BrdAbitPin ) ) continue ; if ( curr_contact . shares_net ( this ) && curr_contact . shares_net ( curr_item ) ) return false ; } return true ; }
returns true if curr_item is an obstacle as clearance violation basically , if it is an obstacle generally , check further if it has a clearance violation
