Extend curve using planer refrence curve

Hello I am struggling to extend sectioned curves with the help of refrence curves. I have used PHYTON to get something but some segments are getting fliped during this operation.
Hope someone has a solution….
I need this

Extend curve.gh (8.5 MB)

Dear Rane,

Using Closed + Dispatch I could make the curves you want to work on visible. (See image. ). Maybe there are a couple of curves you could extend to they can be closed. However, I would not know how???


In the panel you also see, that on several places there are two non-closed just on top of eachother. So I would suggest to not extend, but replace the curves wiht tween curves.

  • For every curve what is not closed:
  1. Check if the neighbours are both closed. If YES, then select these two neighbours and use Tween Curve to find the best fitting curve in between. Use Replace to exchange the non-closed with the tween curves.
  2. If there are two non-closed (or more ) on top of eachother count the number. Calculate the factors you need (P of Tween Curve) and create a tween curve for every curve to be replaced. Example when you have to replace two, you need a tween curve with factor 1/3 and the other with 2/3 both to be made with the closed neigbours above and below.
    See example below. Curve 79 is non-closed. Tweencurve is made of 80 + 81


Regards, Eef
Extend curveEW.gh (6.4 MB)