I have a a closed curve, and a mesh.
I want the shape of the mesh to approximate that of the patched surface from the curves
I tried soap film but, the resulting mesh is ‘taut,’ so, the closer to the ‘basin’ of the patched surface, the bigger the deviation, which is wrong for my goals.
Could you please give me some guidance?
Note: in the following file, the patched surface has 4 sides–in my project, that number can change e.g. 5-sides, 3-sides ect. solve_for_patch.gh (21.7 KB)

I want to use solver because, I want the resulting mesh to be ‘relaxed’ e.g. regulated by the Smooth goal. Depending on the mesh initialization (such as mine), naively using Brep Closest Points cannot achieve that

Besides mesh relaxed-ness, another problem was that the Patch gives a surface that does not follow the given curves in a very obvious way–there are big gaps between the trimmed surface’s edges and the input curves

Thanks so much Daniel! This is exactly what I need! I didn’t realize that trimmed surface can be an input to the On Mesh goal. This will change many of my solver codes!

Sorry to bother you again. I put your method through a few other surfaces I need and, I think I’m stuck finding the right ‘hyperparameters’ after searching many combinations.

Two problems emerged from that:

the points won’t stay on surface

the mesh isn’t ‘relaxed’–some vertices like to stay super close to each other. If I force them apart with Smooth, they will stay off the surface itself.

Could you please give me some more guidance? I realize this is a bizarre situation, and I’m trying to find a work-around as well.

Thanks so much Quan! This looks like exactly what I need!

If you have time, could you please share some insights on [1] what the WarpWeft component is doing (and how that relates to EdgeLengths)? I kind-of get what equal length is doing there–it seems we need different values in either direction based on the ‘dimensions’ of this 4-sided patch.
[2] Following that, if I have many of these patches, does that mean I need to identify which is the ‘long’ side and which is the ‘short’ side?

In all quad mesh, edges have uv direction, just like untrimmed surface. I don’t know what dictates that order. so, if you feed uv separately into separate EdgeLength, that makes all u same and all v same.