algorithmic modeling for Rhino
Hi
I'm trying to divide the length of a parametric curve that is constructed with control points into decreasing increments as per the attached sketch. I can easily divide the curve into equal length segments but am having trouble reducing the size of each increment.
Any help would be appreciated
Cheers
Bob
Tags:
Hi BoB,
if you are familiar with script components you can try something like this (assuming that you want linear increments)
private void RunScript(Curve x, double y, ref object A)
{
tList.Clear();
double t = x.Domain.Min;
double increment = 0;
tList.Add(t);
while (t <= x.Domain.Max)
{
double s = t + increment;
tList.Add(s);
increment += y;
t = s;
}
Curve[] curveArray = x.Split(tList);
if (t > x.Domain.Max)
{
A = curveArray.Except(new Curve[]{curveArray.Last()});
}
else
{
A = curveArray;
}
}
// <Custom additional code>
List<double> tList = new List<double>();
// </Custom additional code>
But be careful - don't enter y values very close to zero.
hey tzin tzon,
is there a new version up to date of that code?
Thanks was great help!!
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by