@ Override public boolean refine ( Polygon2D_F64 input , Polygon2D_F64 output ) { if ( input . size ( ) != output . size ( ) ) throw new IllegalArgumentException ( "Input and output sides do not match. " + input . size ( ) + " " + output . size ( ) ) ; // sanity check input. If it's too small this algorithm won't work if ( checkShapeTooSmall ( input ) ) return false ; // see if this work space needs to be resized if ( general . length < input . size ( ) ) { general = new LineGeneral2D_F64 [ input . size ( ) ] ; for ( int i = 0 ; i < general . length ; i ++ ) { general [ i ] = new LineGeneral2D_F64 ( ) ; } } // estimate line equations return optimize ( input , output ) ; }
Refines the fit a polygon by snapping it to the edges .