Grasshopper

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

Views: 1257

Replies to This Discussion

Can you post a screenshot of the problem or a file? This is what I get:

--

David Rutten

david@mcneel.com

Poprad, Slovakia

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

Attachments:

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

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service