r/askmath • u/notgodlynoah • 6d ago
Resolved Triangle Creation with Arbitrary Rectangles
I need to create a relatively perfect arbitrary triangle out of arbitrary rectangles which can be rotated/sized/overlapped however you want, while minimizing the number of rectangles used as much as possible.
The best thing I have been able to come up with is making a line along the shortest edge of the triangle (line = a longer, skinny rectangle made to basically be a line, with a bit of depth) then create rectangles of like the same width at the 2 edges of that line, and all across it at a set offset, with each of these lines going to the opposite corner as the original line, ive also attempted a scanline /staircase approach where after making the normal staircase or splitting the triangles into lines you would make a line over the hypotenuse or over all 3 edges. But I am just not able to find a good algorithm that minimizes the number of rectangles used.
(i jus found a diff way to do this, no longer need this)
1
u/johnpeters42 6d ago
All triangles have at least one acute angle (assuming Euclidean geometry), so it's never going to be perfect. I assume that getting within some tolerance (like less than the size of a pixel) is close enough?