首页 > 其他 > 详细

grasshopper 树形数据以及Graft Flatten Simplify的理解

时间:2020-05-19 18:17:16      阅读:1257      评论:0      收藏:0      [点我收藏+]

问题的来源:

要在grasshopper里面输出 类似于二维数组的数据

技术分享图片

 

但是在 grasshopper里的 C# 电池里面,无法显示 二维ArrayList里面的数据。

技术分享图片

 

在 C# 电池里参考这个帖子:

https://discourse.mcneel.com/t/create-data-tree-with-c/68944/2

Grasshopper.DataTree<object> tree = new Grasshopper.DataTree<object>();

System.Collections.Generic.List<object> subtree1 = new System.Collections.Generic.List<object>();
System.Collections.Generic.List<object> subtree2 = new System.Collections.Generic.List<object>();

subtree1.Add(10);
subtree2.Add(20);

GH_Path path1 = new GH_Path(1);
GH_Path path2 = new GH_Path(2);

tree.AddRange(subtree1, path1);
tree.AddRange(subtree2, path2);

r = tree;

按照以上的结构,输出 r 接口。

这里有类似的定义:

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:

技术分享图片

 

 

 技术分享图片

 

技术分享图片

 

技术分享图片

 

 技术分享图片

 

   技术分享图片

技术分享图片

 晦涩难懂其义。

 

一些经常用到的快捷键:

双击输入 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/

 

grasshopper 树形数据以及Graft Flatten Simplify的理解

原文:https://www.cnblogs.com/qianyuesheng/p/12909120.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!