Exemplo n.º 1
0
        public DeltaMesh[] CopyMeshes()
        {
            DeltaMesh[] meshes = new DeltaMesh[dm.Length];

            for (int i = 0; i < dm.Length; i++)
            {
                meshes[i] = dm[i].Copy();
            }

            return(meshes);
        }
Exemplo n.º 2
0
        public void SetRandom(int n)
        {
            Random r = new Random();

            dm = new DeltaMesh[n];

            for (int i = 0; i < dm.Length; i++)
            {
                dm[i] = new DeltaMesh();
                dm[i].SetRandom(r);
            }
        }
Exemplo n.º 3
0
        private DeltaPoint[] ConvertToPoints(DeltaMesh Mesh)
        {
            DeltaPoint[] final = new DeltaPoint[3];

            DeltaPoint[] dp = { Mesh.A, Mesh.B, Mesh.C };

            for (int i = 0; i < dp.Length; i++)
            {
                if (final[i] == null)
                {
                    final[i] = new DeltaPoint();
                }
                final[i].dX = ConvertDelta(origin.dX, dp[i].dX, ang);
            }

            return(final);
        }
Exemplo n.º 4
0
        public Model GenerateModel()
        {
            Random r = new Random();
            Model  final;

            DeltaMesh[] pts = new DeltaMesh[12];

            double hW = Width / 2;

            // top plane
            pts[0] = new DeltaMesh
            {
                A = new DeltaPoint(new double[] { X + hW, Y + hW, Z + hW }),
                B = new DeltaPoint(new double[] { X + hW, Y + hW, Z + -hW }),
                C = new DeltaPoint(new double[] { X + -hW, Y + hW, Z + -hW })
            };

            pts[1] = new DeltaMesh
            {
                A = new DeltaPoint(new double[] { X + hW, Y + hW, Z + hW }),
                B = new DeltaPoint(new double[] { X + -hW, Y + hW, Z + hW }),
                C = new DeltaPoint(new double[] { X + -hW, Y + hW, Z + -hW })
            };

            // bottom plane
            pts[2] = new DeltaMesh
            {
                A = new DeltaPoint(new double[] { X + hW, Y + -hW, Z + hW }),
                B = new DeltaPoint(new double[] { X + hW, Y + -hW, Z + -hW }),
                C = new DeltaPoint(new double[] { X + -hW, Y + -hW, Z + -hW })
            };

            pts[3] = new DeltaMesh
            {
                A = new DeltaPoint(new double[] { X + hW, Y + -hW, Z + hW }),
                B = new DeltaPoint(new double[] { X + -hW, Y + -hW, Z + hW }),
                C = new DeltaPoint(new double[] { X + -hW, Y + -hW, Z + -hW })
            };

            // forward plane
            pts[4] = new DeltaMesh //top
            {
                A = new DeltaPoint(new double[] { X + -hW, Y + hW, Z + hW }),
                B = new DeltaPoint(new double[] { X + hW, Y + hW, Z + hW }),
                C = new DeltaPoint(new double[] { X + hW, Y + -hW, Z + hW })
            };

            pts[5] = new DeltaMesh //bot
            {
                A = new DeltaPoint(new double[] { X + -hW, Y + hW, Z + hW }),
                B = new DeltaPoint(new double[] { X + -hW, Y + -hW, Z + hW }),
                C = new DeltaPoint(new double[] { X + hW, Y + -hW, Z + hW })
            };

            // Backward plane
            pts[6] = new DeltaMesh //top
            {
                A = new DeltaPoint(new double[] { X + -hW, Y + hW, Z + -hW }),
                B = new DeltaPoint(new double[] { X + hW, Y + hW, Z + -hW }),
                C = new DeltaPoint(new double[] { X + hW, Y + -hW, Z + -hW })
            };

            pts[7] = new DeltaMesh //bot
            {
                A = new DeltaPoint(new double[] { X + -hW, Y + hW, Z + -hW }),
                B = new DeltaPoint(new double[] { X + -hW, Y + -hW, Z + -hW }),
                C = new DeltaPoint(new double[] { X + hW, Y + -hW, Z + -hW })
            };

            // Right plane
            pts[8] = new DeltaMesh //top
            {
                A = new DeltaPoint(new double[] { X + hW, Y + hW, Z + hW }),
                B = new DeltaPoint(new double[] { X + hW, Y + hW, Z + -hW }),
                C = new DeltaPoint(new double[] { X + hW, Y + -hW, Z + -hW })
            };

            pts[9] = new DeltaMesh //bot
            {
                A = new DeltaPoint(new double[] { X + hW, Y + hW, Z + hW }),
                B = new DeltaPoint(new double[] { X + hW, Y + -hW, Z + hW }),
                C = new DeltaPoint(new double[] { X + hW, Y + -hW, Z + -hW })
            };

            // Left plane
            pts[10] = new DeltaMesh //top
            {
                A = new DeltaPoint(new double[] { X + -hW, Y + hW, Z + hW }),
                B = new DeltaPoint(new double[] { X + -hW, Y + hW, Z + -hW }),
                C = new DeltaPoint(new double[] { X + -hW, Y + -hW, Z + -hW })
            };

            pts[11] = new DeltaMesh //bot
            {
                A = new DeltaPoint(new double[] { X + -hW, Y + hW, Z + hW }),
                B = new DeltaPoint(new double[] { X + -hW, Y + -hW, Z + hW }),
                C = new DeltaPoint(new double[] { X + -hW, Y + -hW, Z + -hW })
            };

            final = new Model(pts);

            return(final);
        }