private boolean checkShapeTooSmall ( Polygon2D_F64 input ) { // must be longer than the border plus some small fudge factor double minLength = cornerOffset * 2 + 2 ; for ( int i = 0 ; i < input . size ( ) ; i ++ ) { int j = ( i + 1 ) % input . size ( ) ; Point2D_F64 a = input . get ( i ) ; Point2D_F64 b = input . get ( j ) ; if ( a . distance2 ( b ) < minLength * minLength ) return true ; } return false ; }
Looks at the distance between each vertex . If that distance is so small the edge can t be measured the return true .