grasshopper DataTree 树形数据以及Graft Flatten Simplify的理解
问题的来源:
要在grasshopper里面输出 类似于二维数组的数据
但是在 grasshopper里的 C# 电池里面,无法显示 二维ArrayList里面的数据。
在 C# 电池里参考这个帖子:
https://discourse.mcneel.com/t/create-data-tree-with-c/68944/2
C#电池codes如下:
// object 可以替换成其他的数据格式,也可以不换 输入端口 type 可能需要改
Grasshopper.DataTree<object> tree = new Grasshopper.DataTree<object>(); // 建立个list
System.Collections.Generic.List<object> subtree = new System.Collections.Generic.List<object>(); // 添加数据
subtree.Add(10);
subtree.Add(78);
subtree.Add(56); GH_Path subPath = new GH_Path(124); tree.AddRange(subtree, subPath); A = tree;
或者更简单一点:
// 建立list C# 版本
System.Collections.Generic.List<object> subtree = new System.Collections.Generic.List<object>(); // 添加数据
subtree.Add(10);
subtree.Add(78);
subtree.Add(56); // 采用默认的序列
result = subtree;
# python 版本 from Grasshopper.Kernel.Data import GH_Path
from Grasshopper import DataTree layerTree = DataTree[object]() path = GH_Path(555)
layerTree.Add(2323, path)
这里有类似的定义:
http://james-ramsden.com/data-trees-and-c-in-grasshopper/
DataTree, GH_Structure, IGH_Structure 三者之间的关系:
具体可参见官方文档:
https://developer.rhino3d.com/api/grasshopper/html/T_Grasshopper_Kernel_Data_GH_Structure_1.htm
https://developer.rhino3d.com/api/grasshopper/html/T_Grasshopper_DataTree_1.htm#!
到此为止,可以引出 grasshopper 树形数据的处理 以及 list 和 tree:
在 Param Viewer中, 我们看到只有一个分支包含48个元素的一个列表。将所有数据放到 {0} 的路径下。
在 Param Viewer中 , 所有的数据有8个分支,每个分支有6个原子,每个原子含有一个元素。
在 Param Viewer 中, 仍然有8个分支,每个分支有6个原子,但是第一个分支已经去掉了。
Path mapper
路径映射,对路径进行编辑修改 ,可以针对自己想要的结果,自定义。
一些经常用到的快捷键:
双击输入 scribble就行 输入注释;
选择多个电池 ,右击 选择组;
point list 画出点对象的默认 index;
参考资料:
grasshopper 官方文件
链接:https://pan.baidu.com/s/1LhvslLPdcs1zKxtj5NxJfw
提取码:e9y0
复制这段内容后打开百度网盘手机App,操作更方便哦
https://modelab.gitbooks.io/grasshopper-primer/1-foundations/1-5/3_creating-data-trees.html
https://developer.rhino3d.com/api/grasshopper/html/d823ee90-ea94-4a8a-a972-df5d006a8d9f.htm
https://www.youtube.com/watch?v=9TvVahUs3cQ
http://jinjieming.com/grasshopper%E6%A0%91%E5%BD%A2%E6%95%B0%E6%8D%AE%E7%9A%84%E9%80%89%E5%8F%96/
最新文章
- 【代码笔记】iOS-替换电话号码中间4位为-号
- PAT A 1018. Public Bike Management (30)【最短路径】
- HTML语义化:HTML5新标签——template
- .Net语言 APP开发平台——Smobiler学习日志:仿12306的APP登陆界面
- 轻松掌握:JavaScript状态模式
- USACO Section 2.4 回家 Bessie Come Home
- Omnithreadlibary学习(2)-IOmniTask异步执行
- 用js代码判断是否IE浏览器
- 读书笔记:java并发
- css 三角实例
- Access Violation at address 00000000.Read of address 00000000 解决办法
- 海尔U+的启发:让用户对智能家居拥有“话语权”
- Python内置函数(31)——object
- [TJOI2015] 棋盘
- 请不要在广州.NET俱乐部群里谈郑智话题,谢谢!
- python技巧 计算字符串中字母出现的次数并取出最大
- android模拟器不能上网设置
- slf4j 作用及logback概述
- picker(级联)组件及组件封装经验
- Sign in with the app-specific password you generated. If you forgot the app-specific password or need to create a new one, go to appleid.apple.com
热门文章
- SpringMVC请求参数解析
- 数据结构(3):java使用数组模拟堆栈
- [重要更新]微信小程序登录、用户信息相关接口调整:使用 wx.getUserProfile 取代 wx.getUserInfo
- Libraries
- 【cypress】5. 测试本地web应用
- hdu1815 2sat + 二分 + 建图
- hdu 1867 求两个串的"和"最小 ,KMP
- hdu 3265 线段树扫描线(拆分矩形)
- UVA11389巴士司机问题
- MySQL的Double Write并不难理解