How to create ridge line in grasshopper

If I want red as an out put from the closed curves. what should I do

Try Nautilus plug in and its medial axis components they do exactly that.

thank you

if you want perfectly straight lines though, as you are showing on the picture, i do not know any simple way. Only making geometrical algorithm for your specific case

Ya I want straight line .

Nautilus is not working

Then you have to share more information about your project for people to be able to help

This topic might be helpful:

Far better for lines and arc geometry is


It will give quite exact skeleton for a roof skeleton


roof skeleton.gh (6.4 KB)

Thank you so much for help. This Forum is actual fun :smiling_face_with_three_hearts:

This component calculating all other stuffs that is why it is taking too much time for giving output is there any other way :smiling_face_with_tear:

It calculates using brep intersection. It is rhinocommon calculations so there is no big room for improvement.
The others uses points and voronoi but are not very clean for your geometry.

So at my level I have no better solution.

The improvement that could be done is the extend curve a bit smarter. There must be no extend curve on point of intersection of curve.

First, always upload your file :wink:

Second, not saying what you should do, just showing what I did for your shape type:
mid-lines.gh (17.2 KB)

Thank you so much.. :smiling_face_with_three_hearts:

Next time I’ll definitely follow :winking_face_with_tongue:

Just realized I actually don’t know what defines a medial axis (is it supposed to strictly go in the middle?) or a ridge line (crest?) in terms of line network—but most examples point to ‘mid’ lines that touch but aren’t necessarily joined together, so I tweaked it in case it helps:
mid-lines.gh (28.7 KB)

I also tried an alternative method and put together a sample definition.
The idea is to first filter the input curves based on certain matching rules, then use offset, extension, and Boolean operations to extract the center line. The final result is a ridge‑like skeleton.

Attached is a screenshot of my Rhino and Grasshopper script for reference.

Test_001.gh (17.6 KB)