How to Merge Two Curve Segments into One Using Geometry Nodes?

Hi everyone,

I’m working on a project in Geometry Nodes where I need to merge two curve segments into a single curve. The idea is to “collapse” the two initial curves into one central curve that runs between them.

Here’s what I’m considering so far:

I want to identify and work with the two separate curve segments in the geometry.
I imagine merging these curves by calculating a midpoint between their positions or perhaps using another approach.

I’m unsure how to approach this in Geometry Nodes and would love to explore different methods or workflows.

Here’s a screenshot for better context:


Additionally, I’ve attached the .blend file for reference :slight_smile:
merge_two_curve_gn.blend (1.1 MB)

Thanks in advance for your ideas and help!

For curves this is mathematically impossible because continious curves can not split.
If at all then you have to use a mesh. Or have seperate curves which meet at somee point, but the question would does two of them “continue” or are this difffent curves (with possible different curvations ) ?

There exist some 2D filters to thin down some outline to a skeleton.

Which does not always what you thing it should. I played with this for some time… you get weird subbranches .

2024-11-27 14.31.45 usage.imagemagick.org d7373784560d

But in your example you also might be interest in the “thickness” of this.

I hope some geometry nodes guru can show some good approach for this… :smile_cat:

1 Like

Yeah, the shape is pretty ambiguous. And I don’t know the exact math for this. You could use blur nodes though, like this:

merge_two_curve_gn1.blend (1.0 MB)

3 Likes

Thank you for your reply. It’s quite interesting.

Placing points between the two curves following their “median” could be a solution. But calculating this median can be abstract or give imprecise results with my current knowledge… :sweat_smile:.

Ah, I forgot to mention that the curve is just an “image tracer” that I converted into a curve.

Yes, I can’t wait to see if anyone has any ideas. Thanks

:exploding_head:

I someday did read something on a thread here on BA about the blur node. But i only now understood the possibilities. My understanding of blurring was more the “traditional” one in 2D filtering.

So thanks for this insight.

2 Likes

Yepp… i had looked into the node group… nice… but i never thought of anything like @ogonek suggested… :sweat_smile:

1 Like

Interesting, I wouldn’t have thought of that. It’s true I didn’t choose the simplest example :sweat_smile:.
But thank you very much for this solution! Now it gives me other ideas to explore. :smiley:

1 Like