Join small separated polylines

Hi, I hope someone can help me. I divide 3D fabric tent by panels and on each panels I make lines for sew (or paint) adverts on the tent.
So at the end of my modeling and grasshopper definition I received correct panels, but adverts’ lines is consists of many separate polylines with very small distance between lines – usually less then 0.3mm. I can consistently join lines in Rhino by hand, but it is not very cose and take many time.
One of my panels is in attachment. Maybe you can give me any ideas how to join small separated polylines with a little distance between ends to continuous polylines?
P24.3dm (202.4 KB)

A one-liner in c# saves the day!

join curve (5.7 KB)


private void RunScript(List<Curve> C, double t, ref object A)
    A = Rhino.Geometry.Curve.JoinCurves(C, t, true);

Hi Riccardo,

This is really perfect!!!

Thanks, Thanks and Thanks a lot!