I've been trying to come up with a way to create a rectangular hole within another rectangle or square surface and that the hole can be rotated and placed anywhere within the surface. Obviously the current idea is to use triangles, but I'm not exactly sure how to decide which triangles connect from which surface corner to the cutout corners without having the triangles overlapping the hole itself.
I already know how to generate polygons from coordinates, and I did figure out a working algorithm to create 1 hole on the surface, however I still am having trouble for creating two holes.
Something like this, where the red rectangles is the hole: !enter image description here
EDIT: I am also aware that roblox realtime CSG is now a thing, however I cannot use it because of the yielding and that it's server-side only.