if( t >= 0.0) {  x = start.x + direction.x*t; y = start.y + direction.y*t; z = start.z + direction.z*t;
if( t >= 0.0) {  x = origin.x + dx*t; y = origin.y + dy*t; z = origin.z + dz*t;
    boolean intersect( Point3d start, Point3d end, Point4d position ) {	double t,v0,vd,x,y,z;	int i,j;	//System.out.println("line segment intersect : planes.length " + planes.length);		if( boundsIsEmpty ) {	    return false;	}		if( boundsIsInfinite ) {	    position.x = start.x;	    position.y = start.y;	    position.z = start.z;	    position.w = 0.0;	    return true;	}	Point3d direction = new Point3d();		direction.x = end.x - start.x;	direction.y = end.y - start.y;	direction.z = end.z - start.z;       	for(i=0;i<planes.length;i++) {	    vd = planes[i].x*direction.x + planes[i].y*direction.y +		planes[i].z*direction.z;	    v0 = -(planes[i].x*start.x + planes[i].y*start.y +		   planes[i].z*start.z + planes[i].w);	    // System.out.println("v0="+v0+" vd="+vd);	    if(vd != 0.0) { // ray is parallel to plane		t = v0/vd;	     		// System.out.println("t is  " + t);	     		if( t >= 0.0) { // plane is behind start	       		    x = start.x + direction.x*t;   // compute intersection point		    y = start.y + direction.y*t;		    z = start.z + direction.z*t;		    // System.out.println("t="+t+" point="+x+" "+y+" "+z);	       		    if( pointInPolytope(x,y,z) ) {			//                   if((t*t) > (end.x-start.x)*(end.x-start.x) +			//                              (end.y-start.y)*(end.y-start.y) +			//                              (end.z-start.z)*(end.z-start.z)) {			if(t <= 1.0) {			    position.x = x;			    position.y = y;			    position.z = z;			    position.w = t;			    return true;  // ray intersects a face of polytope			}		    }		} 	    }	}  	return false;    }