@drewgandy said:
For instance, if I have a "diagonal line" that I want to draw a rectangle against, how do I do it?
Sometimes the Ruby Console (billed as a programmer's tool for writing plugins, but I like it for modeling) answers your need. Try diving into Chapter Two, Ruby Console.
The first project there is the main and jib on a sloop. The main is orthogonal, the jib is not. Both are easy because any three points are always coplanar. Your four-point rectangles must be coplanar. The second project there adds a rectangle for the bottom of a banister: an example of a rectangle at an odd angle.