algorithmic modeling for Rhino
Tags:
Hi Fernando,
you can use the PathMapper to group your long list of vectors into sublists of 3.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
thanks david for your reply
I fail to see your raise. Anyway, my intention is to this purpose in the Python code. Ivastaria an example for how to adapt to my code. If you look at the attachment I am not far to do!
Ah, I don't do python support (I suck at it), but in C# it would be something like this:
List<Vector3d> vectors = ......;
List<Vector3d> result = new List<Vector3d>();
for (int i = 0; i < vectors.Count-2; i += 3)
{
result.Add((vectors[i] + vectors[i+1] + vectors[i+2]) / 3.0);
}
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi again Fernando,
what David wrote would be:
# choose list access for "vectors", and type hint it as Vector3d
result = []
for i in range(0, len(vectors) - 2, 3):
result.append((vectors[i]+vectors[i+1]+vectors[i+2]) / 3.0)
Thanks,
- Giulio
________________
giulio@mcneel.com
David, all this stuff with the sum of the list is to solve this problem ...
If that's what guys look!
I complicate the issue with the function "range ()" until I realized it works!
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by