Construct a Brep

Helo to all,
I need to construct an open Brep, composed by a series of flat surfaces.
After get the points and surfaces. I and append the surfaces to the Brep.
My questions are:
This is the best way to do it?
Do I need to include an extra method. like compact, or dispose, or something else at the end of the loop?
thanks in advance
Carlos.

            for (int j = 0; j < polA.Count - 1; j++)
            {
                pa = polA[j];
                pb = polA[j + 1];
                pc = polB[j];
                pd = polB[j + 1];
                pe = polC[j];
                pf = polC[j + 1];

                srf = NurbsSurface.CreateFromCorners(pa, pb, pd, pc);
                srfW = NurbsSurface.CreateFromCorners(pc, pd, pf, pe);

                brepB.Append(srf.ToBrep());
                brepB.Append(srfW.ToBrep());
            }

What you’re doing is fine, but you can directly make BRep objects from corner points as well.
Also, rather than using Brep.Append, you can use Brep.JoinBreps at the end.

List<Brep> surfaces = new List<Brep>();
for (int j = 0; j < polA.Count - 1; j++)
{
    pa = polA[j];
    pb = polA[j + 1];
    pc = polB[j];
    pd = polB[j + 1];
    pe = polC[j];
    pf = polC[j + 1];
                
    surfaces.Add(Brep.CreateFromCornerPoints(pa, pb, pd, pc, doc.ModelAbsoluteTolerance));
    surfaces.Add(Brep.CreateFromCornerPoints(pc, pd, pf, pe, doc.ModelAbsoluteTolerance));
}

// join the flat surfaces 
Brep[] joined = Brep.JoinBreps(surfaces, doc.ModelAbsoluteTolerance);

// This is optional, the .NET garbage collector will eventually also free the memory
foreach (var s in surfaces)
    s.Dispose();

Greate! thanks a lot.
best
C.