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)

Try this solution, not very precise.

1 Like

This is rather silly. It uses a temporary, approximate medial axis (yellow group) to create pFrames that use MMX to determine the actual size and position of the mesh tube (white circles). Manual adjustment of three sliders is required but it’s possible to very closely match the purple pipe to the original mesh tube.


Medial_Tube_2025Apr6a.gh (1.4 MB)

I like that - and though I am unsure it’d work, I think you could at least offset the mesh (not solid offset) inwards, by a tiny amount, just so you could pull the original mesh vertices to the offset mesh and form your line from ‘outside mesh’ to ‘inside mesh’, but then your situation might still get compromised at those twisted regions.

My lazy attempt uses PGroups, though it comes at a cost :timer_clock::
Medial_Tube.gh (1.3 MB)


1 Like

This method works great!

1 Like

Cockroach