Flow polyline on curve

Hello
a bit late to the party, here a way of doing with curve divide distance and Galapagos.


Curve Divide Distance from Nautilus plugin but you can use
Divide Distance Multiple

I kept the distance from the original polyline, but you could get the other effect by scaling 1/0.5868
Flow_scale_Delrieu.gh (16.1 KB)

HI Laurent

the logic in your definition is clear and Nautilis CDD component is very useful.

i tried to run the script but i don’t know if i am doing something wrong but it does not converge.

Galapagos stops generating solutions almost immediately without reaching convergence and when the list lenght of adapted polyline is lower to the number of segments of the original one

i also tried to control list lenghts and add to the fitness function yet it should not be necessary but result does not change

i dont know if i should reset it or what ,i haven’t used it many times but i never faced this problem

Hello
I used Maggic Eddy yesterday, and I swapped with my tool. I surely forgot to test it with Galapagos.
I just see that my tool if the factor is too low it puts a point at the end of the curve so it stops Galapagos.

I advise you to use Magic Eddy tool for now or use this script that add some tricks to be sure to have the good segments lengths and the good ending

Flow_scale_Delrieu.gh (14.6 KB)

HI Laurent and thanks

I see what you mean , anyway thanks for the improved fitness function , now its working better.

shame on me Laurent but i don’t know “magic Eddy”, is it an additional GH plugin ?

thanks

It is the maker of this tool

Hi @inno Hi @DanielPiker !

the lenght ratio goal is still having problems on the points order …with some crv ( crv 3 for example ) the order is not respected

I am not able to explain why

2 Flow_scale_DanielPiker_LengthRatio inno.gh (21.4 KB)

Hi @cloudsvisitor77
The input curves appear to be missing from that definition.
I suspect it will be caused by the starting positions you are choosing.

You are right @DanielPiker , I am sorry , i havent internialized the crv !

Attached please find the definition with curves

  • crv 2 is working correclty
  • crv 3 and crv 4 are not working

Thus meaning that the 3 goals are all achieved but the OnCurve Goal does not consider the domain of the curve so the points can fullfil the goal but making a step backward on the curve rather than keep moving forward, this depending i think on where is located the closest point that fullfil the “LenghtRatio” Goal.

unless there isn’t a additional goal to control the order of point on the reference curve we’d need an additional input on the LenghtRatio Goal ( true or false ) to decide wether the points can move back and forward or if they have to be consecutive and always growing with reference to “t” of the reference curve, does it make sense ?

2 Flow_scale_DanielPiker_LengthRatio inno.gh (22.5 KB)

A simple fix here - the balance between the constraint to curve and LengthRatio goals was off.
Fixing that it converges to the correct result:
crv_scale.gh (22.7 KB)

Another way to approach this would be to ignore the initial polyline geometry (since it is just the segment length ratios you actually care about), and initialise by dividing the smooth curve at t values in those ratios to make a new polyline. The lengths won’t be correct but would be close enough to give a good starting point for the optimisation, which then gives the accurate result.
(Note that you can set any target ratio between lengths, it doesn’t have to be the ratio they start out with)

These are simple ways with existing built in goals, but it is also true that it can sometimes be helpful to have a goal which enforces point order along a curve so the t value of each point can only ever be higher than the one before. I did write something for this some time back:

HI @DanielPiker I tried to download the definition with the additional goal in order to make the script more reliable but i have some problem

i reassigned the file path where kangarooSolver is located in my computer

but the component is not working and return a list of errors

I don’t know how to fix it, doed it maybe depend on the Rhino version ?
I am currently on RH8
Version 8 SR5
(8.5.24072.13001, 2024-03-12)
Commercial

Thanks in advance

Hi @cloudsvisitor77
The Kangaroo dll on a typical Windows Rhino 8 installation will be located in
C:\Program Files\Rhino 8\Plug-ins\Grasshopper\Components

I must say though - I’d be surprised if this extra goal is still really necessary here after initialising the polyline in the way described in my last post, unless the target curve is really pathological.

Thanks @DanielPiker

that makes totally sense!! I have rearranged the definition by implementing your suggestion
3 lenght ration only.gh (16.3 KB)

you are right no, it is not necessary , thanks for your unvaluable support Daniel !!