//constructors public Mesh(ref List <double> _x, ref List <double> _y, ref List <double> _z, ref List <Int32> _ind1, ref List <Int32> _ind2, ref List <Int32> _ind3) { int countPoints = _x.Count; Point3D[] vertices = new Point3D[countPoints]; for (int i = 0; i < countPoints; i++) { vertices[i] = new Point3D(_x[i], _y[i], _z[i]); } int countElements = _ind1.Count; elements = new MeshElement[countElements]; for (int i = 0; i < countElements; i++) { Point3D p1 = vertices[_ind1[i] - 1]; Point3D p2 = vertices[_ind2[i] - 1]; Point3D p3 = vertices[_ind3[i] - 1]; Triangle tr = new Triangle(p1, p2, p3, i); elements[i] = new MeshElement() { Center = tr.Center, Area = tr.Square, Norma = tr.Norma, Triangle = tr }; } ListX = _x; ListY = _y; ListZ = _z; ListI1 = _ind1; ListI2 = _ind2; ListI3 = _ind3; }
public static Mesh Copy(RadomeElement rel) { MeshElement[] mel = new MeshElement[rel.Count]; for (int i = 0; i < rel.Count; i++) { mel[i] = rel.elements[i]; } return(new Mesh() { elements = mel }); }
public Mesh(Point3D[] points, double[] areas, DVector[] norma) { int countPoints = points.Length; elements = new MeshElement[countPoints]; for (int i = 0; i < countPoints; i++) { elements[i] = new MeshElement() { Center = points[i], Area = areas[i], Norma = norma[i] }; } }