Trimming Nurbs Surfaces in the parameter space

@dale
More specific example:
why doesn’t this method create a trimmed Brep (assuming the curve is a closed curve defined in the 0,1 0,1 domain in Rhino)
//
public static Brep ConstructBrep(Surface s, Curve c)
{
Brep brep = s.ToBrep();

        //reparametrize brep (2d trimming curve to select has to be defined in the square defined by (0,0,0) and (0,1,0)
        brep.Faces[0].SetDomain(0, new Interval(0,1));
        brep.Faces[0].SetDomain(1, new Interval(0,1));

        Curve c3 = s.Pushup(c, 0.01);

        int indexedge = brep.AddEdgeCurve(c3);
        int indextrim = brep.AddTrimCurve(c);
        //surface -> 1 face
        BrepLoop innerLoop = brep.Loops.Add(BrepLoopType.Inner, brep.Faces[0]);
        BrepEdge innerEdge = brep.Edges.Add(indexedge);
        BrepTrim innerTrim = brep.Trims.Add(innerEdge, false, innerLoop, indextrim);
        brep.SetVertices();

        return brep;
    }

Thanks!