摩登犀牛

标题: Grasshopper 0.9版的列表匹配 [打印本页]

作者: modern    时间: 2012-11-21 10:00
标题: Grasshopper 0.9版的列表匹配
As of Grasshopper 0.9 components no longer offer a Cross Reference option in their pop-up menus. This feature was removed because I felt it was not flexible enough. Now, you can achieve Cross Reference matching with a dedicated component which creates combinations of items. You can find the [Cross Reference] component in the Sets.List panel.
 
由于Grasshopper 0.9不再在pop-up菜单中提供列表匹配选项。这个功能的移除,我想是因为它不够灵活。现在,大家可以用一种专门完成项目组合的组件来完成列表匹配的功能。大家可以在Sets.List面板下找到这种组件。
 
When Grasshopper iterates over lists of items, it will match the first item in list A with the first item in list B. Then the second item in list A with the second item in list B and so on and so forth. Sometimes however you want all items in list A to combine with all items in list B, the [Cross Reference] component allows you to do this.
 
在Grasshopper重复匹配列表选项时,它会将A列表中的第一项和B列表中的第一项相匹配。然后,将A中的第二项和B中的第二项相匹配,依次如此重复。如果你想要A中的所有项和B列表中的所有项相匹配,Cross Reference组件就可以让你完成这种匹配。
 
 
Here we have two input lists {A,B,C} and {X,Y,Z}. Normally Grasshopper would iterate over these lists and only consider the combinations {A,X}, {B,Y} and {C,Z}. There are however six more combinations that are not typically considered, to wit: {A,Y}, {A,Z}, {B,X}, {B,Z}, {C,X} and {C,Y}. As you can see the output of the [Cross Reference] component is such that all nine permutations are indeed present.
 
这里如上图,我们有两个输入列表{A,B,C}和{X,Y,Z}. 正常情况下,Grasshoper只会完成这种组合:{A,X}, {B,Y}和{C,Z} 。可是有另外六个组合方式是一般不会被考虑到的:{A,Y}, {A,Z}, {B,X}, {B,Z}, {C,X} 和 {C,Y}。正如你所看到,Cross Reference组件的输出结果正是这所有的9个排列组合的正确呈现。
 
We can denote the behaviour of data cross referencing using a table. The rows represent the first list of items, the columns the second. If we create all possible permutations, the table will have a dot in every single cell, as every cell represents a unique combination of two source list indices:
 
我们可以用表格来表示数据匹配的行为。这个表格的行表示第一个列表的项,列表示第二个列表项。如果我们创造所有可能的数据匹配,表格会在每一个格子内有一个点,即每一个表格的点表示一种两列表项目的组合匹配。
 
 
Sometimes however you don't want all possible permutations. Sometimes you wish to exclude certain areas because they would result in meaningless or invalid computations. A common exclusion principle is to ignore all cells that are on the diagonal of the table. The image above shows a 'holistic' matching, whereas the 'diagonal' option (available from the [Cross Reference] component menu) has gaps for {0,0}, {1,1}, {2,2} and {3,3}:
 
然而,有时你不想要所有可能的排列组合,而希望排除掉一些无意义或者无效的排列方式。普遍的排除原则是忽略掉所有表格对角线的元素。上图显示了holistic匹配的状况,然而,如下图,diagonal选项的结果有一些缺口:{0,0}, {1,1}, {2,2} and {3,3}。
 
 
If we apply this to our {A,B,C}, {X,Y,Z} example, we should expect to not see the combinations for {A,X}, {B,Y} and {C,Z}:
 
如果我们将这个运用到{A,B,C}, {X,Y,Z}的例子中,我们不希望看到{A,X}, {B,Y} and {C,Z}这三种组合。
 
 
The rule that is applied to 'diagonal' matching is: "Skip all permutations where all items have the same list index". 'Coincident' matching is the same as 'diagonal' matching in the case of two input lists which is why I won't show an example of it here (since we are only dealing with 2-list examples), but the rule is subtly different: "Skip all permutations where any two items have the same list index".
 

这种diagonal匹配运用的规则是:跳过所有具有相同列表索引的项目之间的排列组合。Coincident组合和diagonal组合在一种情况下相同,即当输入端为两个列表时,所以这里举的这个例子无法反映出区别。但是Coinciden的规则有细微的差别:跳过所有任何两个项目有相同的列表索引的排列组合。

The four remaining matching algorithms are all variations on the same theme. 'Lower triangle' matching applies the rule: "Skip all permutations where the index of an item is less than the index of the item in the next list", resulting in an empty triangle but with items on the diagonal.
 
这四个剩下的匹配算法都是在相同主题下的变化。Lower triangle匹配的规则是:当一个列表中项目的索引值比下一个列表中项目的索引值小时,跳过这种排列组合。这种算法的结果如图,右上角有了三角空白区域。
 
'Lower triangle (strict)' matching goes one step further and also eliminates the items on the diagonal:
 
Lower triangle (strict)的匹配,比Lower triangle多消除了一列斜边。
 
 
'Upper Triangle' and 'Upper Triangle (strict)' are mirror images of the previous two algorithms, resulting in empty triangles on the other side of the diagonal line:
 
Upper Triangle和Upper Triangle (strict)是之前两种算法的镜像图像,结果在表格的另一边空出了三角区域。如下图:
 
 

作者: colonnade    时间: 2017-12-23 15:07

作者: tsone    时间: 2018-1-14 12:50
wow, that`s very helpful.




欢迎光临 摩登犀牛 (http://rhino3d.us/) Powered by Discuz! X3.2