How to make a selected face be truly flat

I have no objection to my lil’ part helping others. It’s why I posted it. It was basically just converting pseudo code description of the task into concise Ruby code as possible.

But it may suffer from the same “SketchUp has differing behavior” syndrome.
My lil method uses the API’s idea of parallel vectors (within the API tolerance) to decide if faces are coplanar. I seem to recall a topic thread on this that TT weighed in on. It was about the API’s lack of a “coplanar” test method for the API.

I think SW gets around this by first doing what TT suggests, so that by the time he calls my method the faces are truly coplanar, so the normal vector compare can be trusted.