-- the constructor
-- creates a new Bezier object with the given points added in order

function Bezier.new(...: Vector3 | BasePart)
	local self = setmetatable({}, Bezier)
	local args = {...}
	
	-- holds the points
	self.Points = {}
	
	-- length information
	self.LengthIterations = 1000
	self.LengthIndeces = {}
	self.Length = 0
	
	-- holds the connections from baseparts
	self._connections = {}
	
	-- iterate through given arguments
	for _, p in pairs(args) do
		if typeof(p) == "Vector3" or (typeof(p) == "Instance" and p:IsA("BasePart")) then
			self:AddBezierPoint(p)
		else
			error("The Bezier.new() constructor only takes in Vector3s and BaseParts as inputs!")
		end
	end
	
	-- returns the bezier object
	return self
end

