generative 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
Permalink Reply by fernando molas garcia on April 29, 2012 at 5:41pm 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
Permalink Reply by Giulio Piacentino on April 30, 2012 at 2:51am 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
Permalink Reply by fernando molas garcia on April 30, 2012 at 10:11am David, all this stuff with the sum of the list is to solve this problem ...
Permalink Reply by fernando molas garcia on April 30, 2012 at 10:05am If that's what guys look!
I complicate the issue with the function "range ()" until I realized it works!
© 2013 Created by Scott Davidson.
Powered by