algorithmic modeling for Rhino
I think there's a problem with the Cartesian Product component. It appears to only give matching elements from the two lists. For example, if I give it series from one to nine I only get [0,0], [1,1], [2,2], etc. Is this intended behavior? Thanks.
Trygve
Tags:
David,
Yes, that's correct, but only because Cartesian Products operate on sets, a defining characteristic of which is uniqueness. Thus the set {A,A,A,A,A,A} reduces to simply {A}. See Wikipedia for a more thorough definition - http://en.wikipedia.org/wiki/Cartesian_product
Here's a Grasshopper explanation:
The first result demonstrates the uniqueness property of sets.
The second result is the current CProd output.
The third result does the same thing with the Merge tree component. It makes more sense for this function to be a tree component. Since the current CProd requires input lists of the same length, it's more like Python's zip command. Since order matters, it's not an operation on orderless sets but on ordered lists.
The fourth and fifth results are correct Cartesian Products. As shown in the last result, these should allow for input sets of differing lengths.
I think the problem is primarily one of naming. Maybe the current CProd could be renamed to 'Zip'? Though it's not really necessary as the same can be achieved with Merge. I guess then this becomes a request for a true cartesian product component.
Thanks!
Trygve
That's true, a bunch of Set components operate on invalid sets (sets where the same member occurs more than once). They are therefore not actually Set operators as such.
It probably does make sense to make the Carthesian Set component operate as suggested.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
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