本文整理汇总了C#中Dynamo.Nodes.List.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# List.ToArray方法的具体用法?C# List.ToArray怎么用?C# List.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamo.Nodes.List
的用法示例。
在下文中一共展示了List.ToArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RevitMeshToHelixMesh
// must return an array to make mesh double sided
public static Mesh3D[] RevitMeshToHelixMesh(Autodesk.Revit.DB.Mesh rmesh)
{
List<int> indices_front = new List<int>();
List<int> indices_back = new List<int>();
List<Point3D> vertices = new List<Point3D>();
for (int i = 0; i < rmesh.NumTriangles; ++i)
{
MeshTriangle tri = rmesh.get_Triangle(i);
for (int k = 0; k < 3; ++k)
{
Point3D new_point = RevitPointToWindowsPoint(tri.get_Vertex(k));
bool new_point_exists = false;
for (int l = 0; l < vertices.Count; ++l)
{
Point3D p = vertices[l];
if ((p.X == new_point.X) && (p.Y == new_point.Y) && (p.Z == new_point.Z))
{
indices_front.Add(l);
new_point_exists = true;
break;
}
}
if (new_point_exists)
continue;
indices_front.Add(vertices.Count);
vertices.Add(new_point);
}
int a = indices_front[indices_front.Count - 3];
int b = indices_front[indices_front.Count - 2];
int c = indices_front[indices_front.Count - 1];
indices_back.Add(c);
indices_back.Add(b);
indices_back.Add(a);
}
List<Mesh3D> meshes = new List<Mesh3D>();
meshes.Add(new Mesh3D(vertices, indices_front));
meshes.Add(new Mesh3D(vertices, indices_back));
return meshes.ToArray();
}