How to get the corners of a trapezoid prism?

image
I already know the top 4 positions and the height of the prism. Its basically a surface light.

1 Like

Based on image you provided, you have 4 known things: top side size, bottom side size, height and length of prism. To find all corners, you can use this:

local function GetCorners(Part, Top, Bottom, Height, Depth)
	local Corners = {}
	for x = -1, 1, 2 do
		for y = -1, 1, 2 do
			for z = -1, 1, 2 do
				local Corner = Part.CFrame * Vector3.new((y == 1 and Top or Bottom) / 2 * x, Height / 2 * y, Depth / 2 * z)
				table.insert(Corners, Corner)
			end
		end
	end
	return Corners
end

You maybe will need to adjust Vector3 values if your prism rotated diffirently.

1 Like

I actually don’t know the bottom length of the trapezoid. Just the top 4 corners and the height.

It’s impossible to get other corners with such data. You need at least angle of prism to get bottom corners.