lst.add( start ); lst.add( end );
if ( i == 0 || ( retval & Engine3D.OUT_OF_RANGE_START ) != 0 || endClipped ) { lst.add( start ); }  endClipped = false;  if ( ( retval & Engine3D.OUT_OF_RANGE_END ) != 0 ) { endClipped = true; }  if ( i != va.length - 1 || endClipped ) { lst.add( end ); }
	public void clip( Engine3D engine )	{		byte retval;		List lst = new ArrayList( );		switch ( va.length )		{			case 0 :				break;			case 1 :			{				Vector start = new Vector( va[0] );				Vector end = new Vector( va[0] );				retval = engine.checkClipping( start, end );				if ( retval != Engine3D.OUT_OF_RANGE_BOTH )				{					lst.add( start );				}			}				break;			case 2 :			{				Vector start = new Vector( va[0] );				Vector end = new Vector( va[1] );				retval = engine.checkClipping( start, end );				if ( retval != Engine3D.OUT_OF_RANGE_BOTH )				{					lst.add( start );					lst.add( end );				}			}				break;			default :			{				for ( int i = 0; i < va.length; i++ )				{					Vector start = null;					Vector end = null;					if ( i == va.length - 1 )					{						start = new Vector( va[i] );						end = new Vector( va[0] );					}					else					{						start = new Vector( va[i] );						end = new Vector( va[i + 1] );					}					retval = engine.checkClipping( start, end );					if ( retval != Engine3D.OUT_OF_RANGE_BOTH )					{						lst.add( start );						lst.add( end );					}				}			}				break;		}		va = (Vector[]) lst.toArray( new Vector[0] );	}