Medial axis of compound mesh tube

I have a mesh tube imported from a secondary software. I’m trying to find the medial axis of the mesh tube so I can make a polyline to drive a CNC toolpath.

I tried to take the mesh face point/normal to make and SDL line I was hoping to to find where curve|curve intersect then interpolate the points to a poly line.

Two problems. The mesh tube seems to twist and causing the normals to be flip/flop. This method also seems to create ~40k lines. Doesn’t seem very eloquent.

I would appreciate any guidance.

.gh is attached. Mesh is internalized.



Medial_Tube.gh (1.4 MB)