rhinosweep1 creat a smoth face

sweep1.rar(233.0 KB)
Problem as bellowing:
The tested filed attached has 6 sec curves, 1 rail curve,one brep will be created using command sweep1, but the brep not smooth and overlap also. Using the function I wrote( Sweep1.cpp as original index), two breps will be produced, and the breps are also overlap
What in need:
One function is needed to optimize the input curves(of course, the variation causing by the optimization must be reasonable ), then the result could be a single smooth brep without overlap.
Based on command Sweep1.cpp, kindly help check how to do this optimization, thank you!

First of all: please use the “Developer” category.

The problem, I think, is that your rail is a polycurve which is only G0 continuous. If you explode it, it has 4 segments. Therefore the sweep does not work.

Instead of using sweep1, why not create two interpolated curves, one that connect the input curves’ start points and one that connects the input curves’ end points. Then you can use NetworkSrf command (this can also be done from code) to create a network surface, like in the attached file.sweep1.3dm(746.2 KB)

thanks for you sugeset,I will try it.