The surfaces bounded by edge

Hello. I have one problem. In one CADsystem, there are two methods that allow return the surfaces bounded by select edge. “The methods pfcGeometry.Edge.GetSurface1and pfcGeometry.Edge.GetSurface2 return the surfaces bounded by this edge”. Can you please tell me if there are analogues of these methods in Rhino, because I rummaged through everything, but it gave nothing? Any help would be very helpful, thanks in advance))

 BrepLoopList contours = face.Loops;
                foreach (BrepLoop contour in contours)
                {
                    BrepEdgeList edges = contour.Brep.Edges;
                    foreach (BrepEdge edge in edges)
                    {
                        Face faceNode2 = null;
                        BrepFace secondFace = null;
                        int edgeIndex = edge.EdgeIndex; //GetId();

                        BrepFace f1 = null;
                        BrepFace f2 = null;

                        try
                        {
                             f1 = edge.????? //  GetSurface1();
                        }
                        catch (Exception ex)
                        {
                            throw new Exception(ex.Message);
                        }

                        try
                        {
                            f2 = edge.?????   //GetSurface2();
                        }
                        catch (Exception ex)
                        {
                            throw new Exception(ex.Message);
                        }                    
                    }
                }

Hi @leusd100,

Does this help?

/// <summary>
/// A BrepEdge is connector for joining BrepTrim objects and representing
/// a 3-D location of the seam they form. An edge can connect 1 or more trims.
/// In the case of a simple "joined edge" there will be 2 trims, one from each
/// adjacent face. In a closed face, like a cylinder, the trims will be different
/// on each side of the face, and they will both be in the same loop and belong to
/// the same face.
/// </summary>
public static BrepFace[] GetFacesFromEdge(BrepEdge edge)
{
  var rc = new BrepFace[0];
  if (null != edge && null != edge.Brep)
  {
    var list = new List<BrepFace>();
    foreach (var ti in edge.TrimIndices())
    {
      var trim = edge.Brep.Trims[ti];
      if (null != trim)
        list.Add(trim.Face);
    }
    if (list.Count > 0)
      rc = list.ToArray();
  }
  return rc;
}

– Dale

Also: the guide to the BRep data structure - which consists of faces, loops, trims, edges and vertices - can be found here https://developer.rhino3d.com/guides/cpp/brep-data-structure/

Thanks a lot)))