通知:E拓建筑网正式更名为拓筑在线!

拓筑在线

 找回密码
 快速注册

QQ登录

只需一步,快速开始

微信登录

微信扫一扫,快速登录

GH中数据选取的语法规则变更(DataTree selection rules)


[版块:参数化设计] [分类:经验教程] [复制链接] 报告无效帖子查看: 2360|回复: 1   
拓邑团练|zdjdevil 发表于 2014-8-13 14:53:32 | 显示全部楼层
发帖得20e币  e币充值  开通VIP会员  快速免费获取e币
今天在处理一组树状数据结构的时候用到split tree这个电池,发现原先的masks的语法规则发生了变化,之前例如我需要提取前6个branches,需要写0-6即可,但是今天一直出错,上网一搜才发现在0.9版本后数据选取的规则发生了变化,现在需要写成0 to 6。为了方便大家之后在其他地方产生疑惑的查询,将作者David Rutten解释帖引用并提供链接,很简单的内容就不翻译了哈。顺带说一句,其实基本上对于树状结构的处理都可以通过Param Viewer转换成List的问题再用Tree Branch转回,但是既然都有这些直接处理树状结构的命令,还是应该多多挖掘其中的强大,例如下面内容会提到的类似编程语言的?和!的用法,会在某些时候给你带来意想不到的便捷。(单位没法上传图片就没法一一截图了,大家探索愉快!)
From David Rutten:

Imagine we have the following data tree, containing a bunch of textual characters:

[size=1em]{0;0} = [a,e,i,o,u,y]
{0;1} = [ä,ë,ê,ï,î,ö,ô,õ,ü,û,ÿ,y]
{1;0} = [b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,z]
{1;1} = [ç,ĉ,č,ĝ,ř,š,ş,ž]

There are a total of four branches {0;0}, {0;1}, {1;0} and {1;1}. The first branch contains all the vowels that are part of the standard English alphabet. The second branch contains all non-standard vowels and branches three and four contain the standard and non-standard consonants respectively.


So what if we want to select from this tree only the standard vowels? Basically include everything in the first branch and disregard everything else. We can use the [Tree Split] component with a selection rule to achieve this:

[size=1em]{0;0}

This selection rule hard-codes the number zero in both tree path locations. It doesn't define an item index rule, so all items in {0;0} will be selected.


If we want all the vowels (both standard and non-standard), then we have several options:

[size=1em]{0;?}         = select all branches that start with 0
[size=1em]{0;(0,1)}    = select all branches that start with 0 and end in either 0 or 1
[size=1em]{0;(0 to 1)} =    ......................................... and end in the range 0 to 1.

Conversely, selecting all standard vowels and consonants while disregarding all non-standard character can be achieved with rules as follows:

[size=1em]{?;0}
[size=1em]{(0,1);0}
[size=1em]{(0 to 1);0}

It is also possible to select items from each branch in addition to limiting the selection to specific branches. In this case another rule stated in square brackets needs to be appended:

[size=1em]{0;?}[0 to 2]

The above rule will select the first three vowels from the standard and the non-standard lists.


Basically, rules work in a very consistent way, but there are some syntax conventions you need to know. The first thing to realize is that every individual piece of data in a data-tree can be uniquely and unambiguously identified by a collection of integers. One integer describes its index within the branch and the others are used to identify the branch within the tree. As a result a rule for selection items always looks the same:

[size=1em]{A;B;C;...;Z}              where A, B, C, Z and i represent rules.

It's very similar to the Path Mapper syntax except it uses square brackets instead of parenthesis for the index (the Path Mapper will follow suit soon, but that won't be a breaking change). You always have to define the path selector rule in between curly brackets. You can supply any number of rules as long as you separate them with semi-colons.

The index rule is optional, but -when provided- it has to be encased in square brackets after the path selection rule(s).


The following rule notations are allowed:

[size=1em]*  Any number of integers in a path

[size=1em]?  Any single integer

[size=1em]6  Any specific integer

[size=1em]!6  Anything except a specific integer

[size=1em](2,6,7)  Any one of the specific integers in this group.

[size=1em]!(2,6,7)  Anything except one of the integers in this group.

[size=1em](2 to 20)  Any integer in this range (including both 2 and 20).

[size=1em]!(2 to 20) Any integer outside this range.

[size=1em](0,2,...)  Any integer part of this infinite sequence. Sequences have to be at least two integers long, and every subsequent integer has to be bigger than the previous one (sorry, that may be a temporary limitation, don't know yet).

[size=1em](0,2,...,48)  Any integer part of this finite sequence. You can optionally provide a single sequence limit after the three dots.

[size=1em]!(3,5,...)  Any integer not part of this infinite sequence. The sequence doesn't extend to the left, only towards the right. So this rule would select the numbers 0, 1, 2, 4, 6, 8, 10, 12 and all remaining even numbers.

[size=1em]!(7,10,21,...,425)  Any integer not part of this finite sequence.

Furthermore, it is possible to combine two or more rules using the boolean and/or operators. If you want to select the first five items in every list of a datatree and also the items 7, 12 and 42, then the selection rule would look as follows:

[size=1em]{*}[(0 to 4) or (6,11,41)]

The asterisk allows you to include all branches, no matter what their paths looks like.


It is at present not possible to use the parenthesis to define rule precedence, rules are always evaluated from left to right. It is at present also not possible to use negative integers to identify items from the end of a list.


原始链接http://www.grasshopper3d.com/for ... ree-selection-rules





评分

参与人数 1e币 +5 收起 理由
DanielJin + 5 爆料兼分享,分享总让我们知更多。

查看全部评分

拓邦元帅|沧月 发表于 2014-8-13 19:41:15 | 显示全部楼层
发帖得20e币  e币充值  开通VIP会员  快速免费获取e币
相关的变更还有表达式的写法
您需要登录后才可以回帖 登录 | 快速注册 微信登录

2024一级注册建筑师资格考试教材,最新版注考书籍
2024一级注册建筑师资格考试教材,最新版注考书籍
2024一级注册建筑师考试还剩一个月了,分享下最新版注考书籍,祝小伙伴们旗开得胜 2024-级注册建筑师考试教材---设计前期与场地设计.pdf 2024-级注册建筑
  马甲不能少  安徽阿才最后回复于 2024-04-28 建筑师讨论区

图书馆超全资料合集(含su cad等)
图书馆超全资料合集(含su cad等)
**** 本内容被作者隐藏 ****
  sadapple  czt17300743052最后回复于 2024-04-28 设计模型

Enscape高级渲染参数预设合集(宝藏参数)
Enscape高级渲染参数预设合集(宝藏参数)
和所有软件的参数预设类似,仅仅需要在场景中简单加载渲染参数,即可得到已经调整好的渲染效果。让效果更上一层楼! 包含百余款渲染
  sadapple  basten272最后回复于 2024-04-28 虚拟化表现

2024年密斯奖最终获奖名单公布
2024年密斯奖最终获奖名单公布
2024年4月25日,布鲁塞尔城市/建筑/景观/城市规划信息/文献和展览中心(CIVA)新闻发布会上,宣布了2024年欧盟当代建筑奖|密斯·凡·德·罗奖建筑与新锐类别最终
  深圳老梁  basten272最后回复于 2024-04-28 项目实践·作品库

“未来社区”第四代住宅政策、研发与设计案例(设计新动向)
“未来社区”第四代住宅政策、研发与设计案例(设计新动向)
未来已来。2018年,浙江省首次提出未来社区概念,19年写入《政府工作报告》,且被定义为2019年扎实推进大湾区建设的“标志性项目”之一。 在国内,“未来社区”
  成之歌  basten272最后回复于 2024-04-27 精选资料

[日本版]Jutakukenchiku 住宅建筑 2024年01-02期
[日本版]Jutakukenchiku 住宅建筑 2024年01-02期
本杂志PDF电子版收集于网络,仅供学习研究之用,百度网盘下载链接: [ck8_view=1]链接:https://pan.baidu.com/s/1g-sfctN3yQ9HOCLwhFbmKQ 提取码:vg7c
  设计杂志  basten272最后回复于 2024-04-27 建筑景观

[日本版]A+U 建筑与都市 2024年03(642)期
[日本版]A+U 建筑与都市 2024年03(642)期
本杂志PDF电子版收集于网络,仅供学习研究之用,百度网盘下载链接: [ck8_view=1]链接:https://pan.baidu.com/s/1Ohq9S14d0cJ3p0PHA3mxTQ 提取码:u344
  设计杂志  basten272最后回复于 2024-04-27 建筑景观

[日本版]Casa Brutus 建筑室内艺术杂志 2024年04期
[日本版]Casa Brutus 建筑室内艺术杂志 2024年04期
本杂志PDF电子版收集于网络,仅供学习研究之用,百度网盘下载链接: [ck8_view=1]链接:https://pan.baidu.com/s/1AiUxc5aW_ZQRhZWwsnXjtg 提取码:tqek
  设计杂志  basten272最后回复于 2024-04-27 室内家居

建筑师如何甩出一份让老板满足的PPT(162页,免费领取)
建筑师如何甩出一份让老板满足的PPT(162页,免费领取)
建筑师如何甩出一份让老板满足的PPT(162页,免费领取) 非常不错的一份资料哦,希望对大家有帮助! 百度网盘下载链接
  小迷妹建筑梦  a49181511最后回复于 2024-04-27 建筑师讨论区

建筑构想——当代建筑手绘草图、透视图和技术图(PDF免费下载))
建筑构想——当代建筑手绘草图、透视图和技术图(PDF免费下载)
分享一本《建筑构想——当代建筑手绘草图、透视图和技术图》的电子书。 **** 本内容被作者隐藏 ****
  ruanming9830  四度66644最后回复于 2024-04-26 设计图书

【活字外文】Residential Skin aand Details_住宅表皮与细节
【活字外文】Residential Skin aand Details_住宅表皮与细节
这是收集于网络的图书样本,仅供观摩试读,试读后请自觉删除。 这些样本由原出版机构发布于网络,清晰度和完整度均受限,请购买正版图书,以获得更加愉悦的阅读
  深圳老梁  四度66644最后回复于 2024-04-26 设计图书

Ecotect专用中国气象数据库(368个地区)
Ecotect专用中国气象数据库(368个地区)
Ecotect专用中国气象数据库(368个地区) 下载
  guzhoucheng  假如没如果最后回复于 2024-04-26 绿色化分析

地产培训 户型基本知识入门与优劣势解析(126页,免费领取)
地产培训 户型基本知识入门与优劣势解析(126页,免费领取)
百度网盘下载链接: **** 本内容被作者隐藏 ****
  小迷妹建筑梦  四度66644最后回复于 2024-04-26 设计专题

迪拜又出「空中别墅」,每户都有大泳池
迪拜又出「空中别墅」,每户都有大泳池
今天分享的这个住宅楼项目「Casa Canal」位于迪拜运河边,毗邻萨法公园。项目由 AHS Properties 开发,HBA Interiors 和 FENDI Casa 携手设计,预计 2026 年完工
  深圳老梁  basten272最后回复于 2024-04-26 项目实践·作品库

集良新作 | 湖州四边庭
集良新作 | 湖州四边庭
四边庭位于德清县龙胜村,房子坐落在武洛公路北边的农田里,是一个集展览、工作、会议于一体的最小化的公共空间单元。▲四边庭 雨后霁蓝▲四边庭 小雪白日▲四边
  深圳老梁  basten272最后回复于 2024-04-26 项目实践·作品库

长飞光纤产业大楼 / Gensler晋思建筑设计事务所
长飞光纤产业大楼 / Gensler晋思建筑设计事务所
全文刊登于《当代建筑》2024年第2期 p100-109[wxv=56.25]MzU1ODc3ODEzMg==||2247925513||wxv_3428065658858897415[/wxv]长飞光纤产业大楼位于武汉光谷,是设计团
  深圳老梁  深圳老梁最后回复于 2024-04-26 项目实践·作品库

20套商业综合体CAD(免费分享)
20套商业综合体CAD(免费分享)
百度网盘下载链接: **** 本内容被作者隐藏 ****
  深圳老梁  ljnzb最后回复于 2024-04-25 设计素材

学习Airpak
学习Airpak
刚开始学习Airpak这款软件,希望能和各位小伙伴共同讨论,如果有错误的地方小伙伴也可以指正,我们共同学习,共同进步!
  linruikun  sean_you最后回复于 2024-04-25 快速发帖

官方综合交流QQ群(更多):

240721746

拓筑在线——面向建筑师群体的

设计交流论坛、软件学习社区、资料下载网站及企业服务平台!

微信扫一扫关注我们

微信公众号

拓筑小助手

GMT+8, 2024-4-28 23:37 , Processed in 0.049934 second(s), 36 queries , Gzip On.    拓筑在线 ( 粤ICP备11043922号 )

Powered by Discuz! X3.4  © 2011-2023 拓筑在线

快速回复 返回顶部 返回列表