local K=type local r=unpack local N=table.insert local m=Region3.new local F=Vector3.new local function R(K)local r=K[1]-K[1]for N=1,#K,1 do r=r+K[N]end return r/#K end local function s(K)if K.ClassName=="\080\097\114\116"then if K.Shape==Enum.PartType.Block then return region3.block(K.CFrame,K.Size)elseif K.Shape==Enum.PartType.Cylinder then return region3.cylinder(K.CFrame,K.Size)elseif K.Shape==Enum.PartType.Ball then return region3.ellipsoid(K.CFrame,K.Size)end elseif K.ClassName=="\087\101\100\103\101\080\097\114\116"then return region3.wedge(K.CFrame,K.Size)elseif K.ClassName=="\067\111\114\110\101\114\087\101\100\103\101\080\097\114\116"then return region3.cornerWedge(K.CFrame,K.Size)elseif K:IsA("\066\097\115\101\080\097\114\116")then return region3.block(K.CFrame,K.Size)end end
-- private functions

local type = type
local unpack = unpack
local insert = table.insert
local R3 = Region3.new

local v3 = Vector3.new

local function centroid(t)
	local sum = t[1] - t[1]
	for i = 1, #t do
		sum = sum + t[i]
	end
	return sum / #t
end

local function classify(part)
	if part.ClassName == "Part" then
		if part.Shape == Enum.PartType.Block then
			return region3.block(part.CFrame, part.Size)
		elseif part.Shape == Enum.PartType.Cylinder then
			return region3.cylinder(part.CFrame, part.Size)
		elseif part.Shape == Enum.PartType.Ball then
			return region3.ellipsoid(part.CFrame, part.Size)
		end
	elseif part.ClassName == "WedgePart" then
		return region3.wedge(part.CFrame, part.Size)
	elseif part.ClassName == "CornerWedgePart" then
		return region3.cornerWedge(part.CFrame, part.Size)
	elseif part:IsA("BasePart") then -- mesh, CSG, truss, etc... just use block
		return region3.block(part.CFrame, part.Size)
	end
end
