I use that function, however, it doesn’t help with the size issue. One way i found is to edit the module itself and I got some results. It doesn’t greedy mesh correctly but its close. Help would be appreciated.

```
local module = {}
type voxelGroup = {[number]: any}
type voxelCluster = {[number]: voxelGroup}
type matrix = {[number]: voxelCluster}
type cuboids = {[number]: {Vector3}}
local v3 = Vector3.new
local function find(t: matrix, x: number, z: number, y: number): any
local _x = t[x]
if _x then
local _z = _x[z]
if _z then
return _z[y]
end
end
return
end
local function meshRow(t: matrix, sX, eX, z, y, bl): voxelGroup?
local _r: voxelGroup = {}
for x = sX, eX do
local voxel = find(t, x, z, y)
if (not voxel) or bl[voxel] then return end
table.insert(_r, voxel)
end
return _r
end
local function meshLayer(t: matrix, sX, sZ, eX, eZ, y, bl): voxelCluster?
local _r: voxelCluster = {}
for z = sZ, eZ do
local row = meshRow(t, sX, eX, z, y, bl)
if row then
table.insert(_r, row)
else return end
end
return _r
end
local function greedyChunk(t: matrix, sX, sY, sZ, eX, eY, eZ, bl, size): (Vector3, Vector3)
local cX, cY, cZ = sX, sY, sZ
for x = sX + size, eX * size, size do
local voxel = find(t, x, sZ, sY)
if voxel and not bl[voxel] then
bl[voxel] = true
cX = x
else
break
end
end
local zAdj = find(t, sX, sZ + size, sY)
if zAdj and not bl[zAdj] then
for z = sZ + size, eZ * size, size do
local row = meshRow(t, sX, cX, z, sY, bl)
if row then
cZ = z
for _, v in ipairs(row) do
bl[v] = true
end
else
break
end
end
end
local yAdj = find(t, sX, sZ, sY + size)
if yAdj and not bl[yAdj] then
for y = sY + size, eY * size, size do
local layer = meshLayer(t, sX, sZ, cX, cZ, y, bl)
if layer then
cY = y
for _, vg in ipairs(layer) do
for _, v in ipairs(vg) do
bl[v] = true
end
end
else
break
end
end
end
return v3(sX, sY, sZ) / size, v3(cX, cY, cZ) / size
end
function module.greedyMesh(t: matrix, sV3: Vector3, eV3: Vector3, size: number): cuboids
local bl = {}
local _r = {}
local sX, sY, sZ = sV3.X, sV3.Y, sV3.Z
local eX, eY, eZ = eV3.X, eV3.Y, eV3.Z
for x = sX, eX do
for z = sZ, eZ do
for y = sY, eY do
local voxel = find(t, x, z, y)
if voxel and not bl[voxel] then
bl[voxel] = true
local t = {greedyChunk(t, x, y, z, eX, eY, eZ, bl, size)}
table.insert(t, voxel)
table.insert(_r, t)
end
end
end
task.wait()
end
return _r
end
return module
```

gM.greedyMesh(World, region, region, part_size)

As a side note, im also implementing ores but the problem is i dont know how to make the mesher ignore the ores