Sorting edges/vertices

A face outer_loop,vertices is returned ccw, any inner loops are cw.
Taking into account the face.normal.
Confusion can arise id a face has been reversed and the loop is unchanged.
Also a face made at z=0 always [initially] faces downwards, irrespective of the loop’s vertices direction.
So making a face at z=0 with a ccw set of points still has its normal as ==Z_AXIS.reverse anyway.

To remove the shared edges [I’d forget about loops, normals etc]…

faces = [face1, face2, face3] edges = [face1.edges, face2.edges, face3.edges].flatten togos = [] edges.each{|e| next unless e.faces[1] ### only look at shared edges shared = true e.faces.each{|f| shared = false unless faces.include?(f) ### skip shared edges which are NOT shared by any of the three faces } togos << e if shared } togos[0].parent.entities.erase_entities(togos) if togos[0]

Or something similar…
I fixed it at three faces but of course you can make a more generic format…