If you think of drawing a diagonal across the rectangle, you have achieved your objective for 2 triangles, each being half of the rectangle area.
For multiple triangles, start at any one of the corners, draw a line from it to a random point on the opposite (not adjacent) side. Use that point to draw another line to a point on the original side (increasing the X position as you go).
The final line drawn must meet the opposite corner on the original side.
Save the coordinates of each triangle as 3 tuples. The first tuple of the first triangle, for example, may be {0,0}, depending on the point numbering nomenclature of your screen.
I'm working on a python project which requires me to divide a rectangular space in to triangles.

There can be no overlap or spaces between the triangles.
All of the rectangles area has to be filled.
Ideally the angles and the sizes of the triangles should differ from
each other in a random fashion.
The algorithm should return a list of all triangles as tuples of
their three corner coordinates.

I am requesting an algorithm to solve the above.
Things I have tried.
I have looked for packages and algorithms that might help me but haven't found any.
So far, I've thought about creating one random triangle at a time following the top border but get stuck when I reach the opposite vertical border. I don't how to continue from there while making sure that no space is left without a triangle.
I also thought about just drawing random lines from border to border, but I can't figure out how to find all the triangles created by their intersections as well as guaranteeing that all subareas are triangles.
Any help would be greatly appriciated!
Extract list of randomly sized triangles fully covering a rectangular space in Python