public MyLinearPath(MyLinearPath another) : base(another) { vp = another.vp; Lines = new IndexLine[another.Lines.Length]; Array.Copy(another.Lines, Lines, Lines.Length); }
private void LinearPathSpheres() { // creates the entities int slices = 20; int stacks = 10; MyLinearPath m2 = new MyLinearPath(model1, new LinearPath(Mesh.CreateSphere(10, slices, stacks).Vertices)); //computes group of lines IndexLine[] edges = new IndexLine[slices * (stacks - 1)]; for (int i = 0; i < (stacks - 1); i++) { for (int j = 0; j < (slices - 1); j++) { int v1 = i * slices + j; edges[v1] = new IndexLine(v1, v1 + 1); } edges[i * slices + (slices - 1)] = new IndexLine(i * slices + (slices - 1), i * slices); } m2.Lines = edges; MyLinearPath m1 = (MyLinearPath)m2.Clone(); m2.Translate(25, 0, 0); m2.LineWeight = 4; model1.Entities.Add(m1, Color.FromArgb(255, Color.Green)); model1.Entities.Add(m2, Color.FromArgb(155, Color.Red)); }