surface_bounds = function(nodes) local minx,miny,maxx,maxy for _,node in pairs(nodes) do if minx == nil or node.x < minx then minx = node.x end if maxx == nil or node.x > maxx then maxx = node.x end if miny == nil or node.y < miny then miny = node.y end if maxy == nil or node.y > maxy then maxy = node.y end end return minx,miny,maxx+600,maxy+600 end