function [ minx,maxx,miny,maxy,minz,maxz,drawPress,plane,surf ] =...
    drawCube(newLocation,res,plane,minx,maxx,miny,maxy,minz,maxz,drawPress )
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here

    newObj=CSGcube(newLocation(1),newLocation(2),newLocation(3),.1,res);
    boundsAdder=CSGtoSurface(newObj,res); %just to get new boundaries
      
    plane=CSGunion(plane,newObj);
    surf=CSGtoSurface(plane,res); %actual new surface
    surf.facecolor='blue';

    boundsIndex=size(minx);
    boundsIndex=boundsIndex(2)+1;

    minx(boundsIndex)=min(boundsAdder.vertices(:,1));
    maxx(boundsIndex)=max(boundsAdder.vertices(:,1));
    miny(boundsIndex)=min(boundsAdder.vertices(:,2));
    maxy(boundsIndex)=max(boundsAdder.vertices(:,2));
    minz(boundsIndex)=min(boundsAdder.vertices(:,3));
    maxz(boundsIndex)=max(boundsAdder.vertices(:,3));

    drawPress=0;

end

