How to find if geometry linked to an edge is coplanar I have this mesh:



I need to find all faces linked to the selected edges. How can I find that using BMesh? I know this way:

for e in edges:
    for f in e.link_faces:
        print("Link Faces:", f)
        normals.append(f.normal.copy())


but for some reason this isn't good for me. Is there any other? Thank you.

EDIT: I need to be more specific, so to highlight the problem.
The object I need to check:



Now I need to know if the edges from a selection lies on the same plane. So I check for those edges face normals. The script:

me = ob.data

if me.is_editmode:
    # Gain direct access to the mesh
    bm = bmesh.from_edit_mesh(me)
else:
    # Create a bmesh from mesh
    # (won't affect mesh, unless explicitly written back)
    bm = bmesh.new()
    bm.from_mesh(me)

# get all selected edges
edges = [e for e in bm.edges if e.select]


# check if all connected face normals are
# on the same plane. the check is strict
faces=[]
normals=[]
for e in edges:
    for f in e.link_faces:
        faces.append(f)
        print("Link Faces:", f)
        print("Normal: ",f.normal)
        print("Normal copy: ",f.normal.copy())
        normals.append(f.normal.copy())

# check they're all the same vector
coplanarity = all(x==normals[0] for x in normals)

print("Coplanar: ", coplanarity)


First selection:



results:

Link Faces: &lt;BMFace(0x11f892818), index=311, totverts=4&gt;
Normal:  &lt;Vector (0.0000, -0.0000, 1.0000)&gt;
Normal copy:  &lt;Vector (0.0000, -0.0000, 1.0000)&gt;
Link Faces: &lt;BMFace(0x11f8927e0), index=310, totverts=4&gt;
Normal:  &lt;Vector (0.0000, -0.0000, 1.0000)&gt;
Normal copy:  &lt;Vector (0.0000, -0.0000, 1.0000)&gt;
Coplanar:  True


Second selection:



Results:

Link Faces: &lt;BMFace(0x109d47b80), index=226, totverts=4&gt;
Normal:  &lt;Vector (0.0000, 0.0000, 0.0000)&gt;
Normal copy:  &lt;Vector (0.0000, 0.0000, 0.0000)&gt;
Coplanar:  True


The two edges are selected to be on the same face; as you can see, the normals result being different while they're obviously the same. Looks like a non-manifold kind-of bug. So I need to take another route... 

EDIT2:

No it's not a bug. I did more tests, there's st. I don't get here...

the blend
Checking if all selected geometry is coplanar.

Similarly to this answer I find using the convex hull bmesh operator, and calculate volume on result a quick and dirty (and somewhat bulletproof) way to calculate if all geometry lies on the same plane.  Doesn't need to calculate face normals at a all.

Here is a test script to run in edit mode, that will report if all selected edges are coplanar.

import bpy
import bmesh
from mathutils import Vector

def coplanar(geom, TOL=0.0001):
    verts = []
    for g in geom:
        if hasattr(g, "verts"):
            verts.extend(v.co for v in g.verts)
        else:
            verts.append(g.co)
    if len(verts) &lt; 3:
        return True
    o = sum(verts, Vector((0,0,0))) / len(verts)
    bm2 = bmesh.new()    
    for v in verts:
        bm2.verts.new(v - o)    
    bmesh.ops.convex_hull(bm2, input=bm2.verts)    
    vol = bm2.calc_volume() 
    bm2.free()
    return vol &lt;= TOL

context = bpy.context
ob = context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)
edges = [e for e in bm.edges if e.select]

print("Coplanar:", coplanar(edges))


As mentioned by @kheetor if you are seeing zero normals, you most likely need to update them bm.normal_update() or on a per face basis with face.normal_update(). 

Also suggest using a tolerance rather than equality when comparing float values.  For example in your script above.

# check they're all the same vector
coplanarity = all((normals[0]).angle(x) &lt; 0.0001 for x in normals)


would IMO be a better test than normals[0] == x.