How can I get the contour of a mesh pipe following its curvature to create the center line?

Hi everyone,

I want to create the center line of the mesh pipe. First I follow the idea of this post
but the resuls are not satisfying. Because the contour is just in one direction, and the center points are not so good.

I want to get the contour acccording to the curvature, actually I can see them but I can’t get them…
Thanks for any help and suggestion!
shortpipe.3dm (76.4 KB) (4.1 KB)

It’s a total hack, as it depends on the mesh structure, but if you know the meshes will always be like this it might be enough: (37.9 KB)

1 Like

Thank you so much, Daniel!!
That result is exactly what I need.
I will spend some time to full understand your code :slight_smile:

Hi Daniel, a problem of this code is that if there the tube is very long, the step of join the lines will be too time consuming (actually GH is freezing). Do you have any idea to simplify this step?