Of course, even given the basics, one has to learn programming techniques that make sense with any new language.
There are a couple of rather fun functions, one is hull which makes a convex hull of a set of objects, and minkowski which creates a Minkowski sum of a set of objects.
|Example of hull() on two spheres|
|Example of angular shape Minkowski with a sphere.|
So I made a function for the flap with the hinge, and then used it with the difference function to make a hole in the surrounding. I used minkowski to make it 0.5mm larger all round to create the clearance, and even included versions rotated at 45 degrees and 90 degrees to ensure the hole covered the flap when open as well as closed.
I am sure I will learn more tricks over time.
[P.S. I know that buying a letterbox from homebase would be a lot cheaper and quicker, but I would learn nothing, OK, so don't even say it]