I have a curve and I want to put points on it. The amount of points is fixed. The distance between the points should be controllable and I want to be able to give a minimum and maximum for the distance between the points (for example min 0.6m max 1.4m).
I managed to be able to control the distance between the points with a kind of drawable graph mapper I would call it. But the minimum and maximum distance between the points is just random. By changing the curve I can control it a bit, but it needs a lot of fine tuning and is not really convenient.
Would there be a solution where I can control the distance (for example with a curve like I did) and be able to set a min and max distance in grasshopper?
I did look into this, and also now again too, I’m not sure, maybe I’m overseeing something, but is there a possibility to give a minimum and a maximum for the distance between each point? For what it seems to me it reaches the same as my code with the addition that you can move the second and second last point?
I want to divide a curve by x amount of curves and have an y min and z max distance between the points. Adding to that I want to be able to control where the distance is larger (so closer to the max) or smaller (so closer to the min).
In my code in the end there is a panel which shows the min and max distance between the points. I want to be able to control give somewhere in my code a value for that. The distances should vary between the min and max according to the controlingcurve. But in the end the distances still have to add up to the curve length. I hope that makes sense, it’s quite difficult to explain. If not I will try to explain it again and add some sketches
Here is my overly complicated solution to a simple problem.
Since you want a fixed amount of points AND that those points are scattered on the entire curve AND control the spacing, the only thing I can think of is to divide the curve into equal segments, then add a random value to a segment and subtract the same value to the next one. So you end up with N/2 “pairs” of segments, this guarantees the sum is the total length of the curve.
Then the attractor comes into play, with a bunch of Sort Lists to make it work.
Finally you can “control” randomness by defining a minimum value that is added/subtracted.
If your amounf of points is too low or too high, there might not be a solution depending on the bounds of the spacing.
I’m sure you’l find cases where this does not work in less than a minute, but keep in mind that your requirements are quite heavy.