setting an objects origin to match its face normals
Quite a few possible ways.. here's one:

Select a face of the object, whose normal you want to be Object Z, and in the Header &gt; Transform Orientations dropdown, hit the little '+' to create a Custom Orientation from it.
In the Object Mode Header &gt; Options menu, check 'Origins' (version 2.81+)
With the object (and therefore its axis) selected, Header &gt; Object &gt; Transform &gt; Align to Transform Orientation, selecting the orientation you have just created, from the dropdown in the 'Adjust Last Operation' Panel.

(and don't forget to switch the 'Origins' option off again ;) )
You can actually create a Custom Orientation from any 3 vertices. Or determine Y down an edge, or from any 2 vertices. In both of those cases, though, you might be 180 degrees out; the selection is not ordered.