Automatic line breaks and face creation

When a user adds lines, they automatically break any intersecting lines and create/subdivide faces. When ruby adds lines none of that happens.
I can call edge.find_faces, but how to first get the line breaks?

One unpublished trick is to create a temporary Group, add your lines in its Entities collection, and then explode the Group. Line breaking takes place during the explode. Faces will still need to be created using find_faces.

Thomthom has a healing technique in the utils.rb file at the SketchUp STL project