extract x,y,z matrices from patch