mcneel/rhinocommon — Issue #75: set array count
Author: piac
Created: 2011-12-15 17:58:26+00:00
State: open

It would be good if this code could be valid, or if not possible, if it did throw exceptions at the point where it sets the vertex count.

``` C#
var pts = new Point3f[]
{
new Point3f(10, 11, 12),
new Point3f(11, 12, 13),
new Point3f(7, 11, 12),
};

Mesh m = new Mesh();

//Setting the count here
m.Vertices.Count = pts.Length; //does not give hints that it fails

for(int i = pts.Length - 1; i > -1; --i)
m.Vertices[i] = pts[i]; //this raises exception. But it's too late

m.Faces.AddFace(0, 1, 2);
```