The part will always be in 90 degree increments in orientation, but what CFrame calculations would I need to do in what order to find the surface area of the side that is facing upward?
✓ ANSWER ACCEPTED
How can I calculate the surface area of the upward facing side of a part using CFrames?
1 answer
✓ Accepted answer
I’m assuming your part is rectangular. if so then it should be pretty simple, just a bit tedious to write. this is because the normal of a face will always be RightVector, UpVector, LookVector or their negative counterparts. it works for any orientation (whichever faces the most up).
function SAFromTop(part)
-- find which side faces most “upwards” or “downwards” by checking the y of each normal
-- if it faces the opposite direction the surface area is still the same on the opposite side because it’s rectangular, so downwards still counts
local function compare(axis1, axis2)
return math.abs(part.CFrame.YVector[axis1]) > math.abs(part.CFrame.YVector[axis2]) and axis1 or axis2
end
local axis = compare(“X”, “Y”)
axis = compare(axis, “Z”)
if axis == “X” then
return part.Size.Y * part.Size.Z
elseif axis == “Y” then
return part.Size.X * part.Size.Z
else -- axis == “Z”
return part.Size.X * part.Size.Y
end
end
of course things get more complicated when it’s not a square...
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Took me a minute to understand how this works (somehow) but makes sense to me. Thanks. And yeah it's just a big rectangle for a sandbox tycoon.
cool. let me know if you still don’t get it I’m happy to explain further.