Trimming NURBS surface with closed NURBS curve

Hi,

sorry to revive an old topic, but my question is so closely related, I think this is the right place for it.

I have a 3D nurbs surface and a closed 2D domain curve. I would like to make a brep with just the part of the surface that is inside the curve. The way I see it, the brep surface should be uniquely defined by just the surface and the curve. From the IsValid output, it seems to me that I also need a 3D curve, but I don’t understand what its purpose should be or how I should define it. It would be a great help to me, if someone could shed some light on that or point me to a resource that does so. I think the brepstructure link is trying to do that, but I don’t quite get it.