GeneralPath gp1 = new GeneralPath( ); for ( int i = 0; i < va1.length; i++ ) { if ( i == 0 ) { gp1.moveTo( (float) va1[i].get( 0 ), (float) va1[i].get( 1 ) ); } else { gp1.lineTo( (float) va1[i].get( 0 ), (float) va1[i].get( 1 ) ); } } gp1.closePath( );
Polygon p1 = PolygonImpl.create( vectors2locations( va1 ) ); Polygon p2 = PolygonImpl.create( vectors2locations( va2 ) );
	protected boolean testIntersect( Object3D near )	{		Vector[] va1 = getViewerVectors( );		Vector[] va2 = near.getViewerVectors( );		GeneralPath gp1 = new GeneralPath( );		for ( int i = 0; i < va1.length; i++ )		{			if ( i == 0 )			{				gp1.moveTo( (float) va1[i].get( 0 ), (float) va1[i].get( 1 ) );			}			else			{				gp1.lineTo( (float) va1[i].get( 0 ), (float) va1[i].get( 1 ) );			}		}		gp1.closePath( );		GeneralPath gp2 = new GeneralPath( );		for ( int i = 0; i < va2.length; i++ )		{			if ( i == 0 )			{				gp2.moveTo( (float) va2[i].get( 0 ), (float) va2[i].get( 1 ) );			}			else			{				gp2.lineTo( (float) va2[i].get( 0 ), (float) va2[i].get( 1 ) );			}		}		gp2.closePath( );		Area ar1 = new Area( gp1 );		Area ar2 = new Area( gp2 );		ar1.intersect( ar2 );		return ar1.isEmpty( );	}