//----------------------------------------------- TO RHINO TYPES public static Plane CastToPlane(GH_Plane p) { Plane pl = new Plane(); p.CastTo <Plane>(out pl); return(pl); }
/// <summary> /// 将二维树转化为列表 /// </summary> /// <param name="tree"></param> /// <returns></returns> public static List <List <Plane> > TreeToList2(GH_Structure <GH_Plane> tree) { IList <GH_Path> paths = tree.Paths; List <List <Plane> > list = new List <List <Plane> >(); IEnumerable <GH_Plane> this_branch = new List <GH_Plane>(); for (int i = 0; i < paths.Count; i++) { list.Add(new List <Plane>()); this_branch = tree.get_Branch(paths[i]).Cast <GH_Plane>(); List <GH_Plane> this_list = this_branch.ToList(); for (int j = 0; j < this_list.Count(); j++) { GH_Plane raw_item = this_list[j]; Plane item = new Plane(); raw_item.CastTo(out item); list[i].Add(item); } } return(list); }