--[[
Joins 2 parts at given surfaces with beams.
--]]

function PartJoiner:JoinParts(Part1,Part2,Surface1,Surface2)
	--Get the offsets and sizes.
	local OffsetData1 = SurfaceData[Surface1]
	local OffsetData2 = SurfaceData[Surface2]
	local Size1,Size2 = Part1.Size,Part2.Size
	
	--Create the beams.
	for i,Offset1 in pairs(OffsetData1) do
		local Offset2 = OffsetData2[i]
		JoinPartsAtOffset(Part1,Part2,Offset1.Position * Size1,Offset2.Position * Size2,Offset1.Rotation,Size1[Offset1.Width],Size2[Offset2.Width])
	end
end



return PartJoiner
