Filtering Mesh edges sharing 2 faces - Sandbox Topology, EdgeAdjacency or?

HI i’m trying to filter the edges of a mesh to get those which share 2 faces. (basically getting the interior edges of a mesh)
I tried with sandbox, MeshTopologyEdgeFilter python command, with no luck.
I’m not sure if the problem is the data structure or the syntax.
here an attempt:

m_e=gh.Sandbox_Topology.MeshTopologyEdge(b)

filter=[]

for i in range(len(m_e[0])):
    filter.append(2)

me_f=gh.Sandbox_Topology.MeshTopologyEdgeFilter(m_e[0],m_e[2],filter)

his gives none as result

I tried also with an iteration and works slighlty better, but i’m not able to filter, and i always get just all the edges.

I guess this can be done in a lot of ways. Also I tried Rhino.Geometry.EdgeAdjacency but I cannot find the right input.

thanks in advance for any help

GetConnectedFaces returns all faces connected to an edge. If the number is two (2), then you have it. Like so:

int[] faces = ... GetConnectedFaces(edge_index);
if (faces.Length == 2)
{
    twoface_list.Add(edge_index);
}

http://developer.rhino3d.com/5/api/RhinoCommonWin/html/M_Rhino_Geometry_Collections_MeshTopologyEdgeList_GetConnectedFaces.htm

// Rolf

1 Like

Thanks ! it works much better!