I am trying to write a script that does the exact same thing as can be found here.
I have an object that I want to rotate around one of its own edges, as shown in the link, but can't figure out how to do it.
Like below, I want to rotate the selected object around the edge that is closest to the other object.