示例#1
0
        private void CreateEdges3D()
        {
            #region Edge1

            Edge edge1 = new Edge();
            edge1.ID                    = 0;
            edge1.Degree                = this.DegreeZeta;
            edge1.KnotValueVector       = this.KnotValueVectorZeta;
            edge1.NumberOfControlPoints = this.NumberOfControlPointsZeta;
            edge1.Patch                 = this;
            int counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsZeta; i++)
            {
                edge1.ControlPointsDictionary.Add(counter++, ControlPoints[i]);
            }

            EdgesDictionary.Add(0, edge1);

            #endregion Edge1

            #region Edge2

            Edge edge2 = new Edge();
            edge2.ID                    = 1;
            edge2.Degree                = this.DegreeZeta;
            edge2.KnotValueVector       = this.KnotValueVectorZeta;
            edge2.NumberOfControlPoints = this.NumberOfControlPointsZeta;
            edge2.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsZeta; i++)
            {
                edge2.ControlPointsDictionary.Add(counter++,
                                                  ControlPoints[i + this.NumberOfControlPointsZeta * (this.NumberOfControlPointsHeta - 1)]);
            }

            EdgesDictionary.Add(1, edge2);

            #endregion Edge2

            #region Edge3

            Edge edge3 = new Edge();
            edge3.ID                    = 2;
            edge3.Degree                = this.DegreeHeta;
            edge3.KnotValueVector       = this.KnotValueVectorHeta;
            edge3.NumberOfControlPoints = this.NumberOfControlPointsHeta;
            edge3.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsHeta; i++)
            {
                edge3.ControlPointsDictionary.Add(counter++,
                                                  ControlPoints[i * this.NumberOfControlPointsZeta]);
            }

            EdgesDictionary.Add(2, edge3);

            #endregion Edge3

            #region Edge4

            Edge edge4 = new Edge();
            edge4.ID                    = 3;
            edge4.Degree                = this.DegreeHeta;
            edge4.KnotValueVector       = this.KnotValueVectorHeta;
            edge4.NumberOfControlPoints = this.NumberOfControlPointsHeta;
            edge4.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsHeta; i++)
            {
                edge4.ControlPointsDictionary.Add(counter++,
                                                  ControlPoints[i * this.NumberOfControlPointsZeta + this.NumberOfControlPointsZeta - 1]);
            }

            EdgesDictionary.Add(3, edge4);

            #endregion Edge4

            #region Edge5

            Edge edge5 = new Edge();
            edge5.ID                    = 4;
            edge5.Degree                = this.DegreeZeta;
            edge5.KnotValueVector       = this.KnotValueVectorZeta;
            edge5.NumberOfControlPoints = this.NumberOfControlPointsZeta;
            int offset = this.NumberOfControlPointsZeta * this.NumberOfControlPointsHeta *
                         (this.NumberOfControlPointsKsi - 1);
            edge5.Patch = this;
            counter     = 0;
            for (int i = 0; i < this.NumberOfControlPointsZeta; i++)
            {
                edge5.ControlPointsDictionary.Add(counter++, ControlPoints[i + offset]);
            }

            EdgesDictionary.Add(4, edge5);

            #endregion Edge5

            #region Edge6

            Edge edge6 = new Edge();
            edge6.ID                    = 5;
            edge6.Degree                = this.DegreeZeta;
            edge6.KnotValueVector       = this.KnotValueVectorZeta;
            edge6.NumberOfControlPoints = this.NumberOfControlPointsZeta;
            edge6.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsZeta; i++)
            {
                edge6.ControlPointsDictionary.Add(counter++,
                                                  ControlPoints[i + this.NumberOfControlPointsZeta * (this.NumberOfControlPointsHeta - 1) + offset]);
            }

            EdgesDictionary.Add(5, edge6);

            #endregion Edge6

            #region Edge7

            Edge edge7 = new Edge();
            edge7.ID                    = 6;
            edge7.Degree                = this.DegreeHeta;
            edge7.KnotValueVector       = this.KnotValueVectorHeta;
            edge7.NumberOfControlPoints = this.NumberOfControlPointsHeta;
            edge7.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsHeta; i++)
            {
                edge7.ControlPointsDictionary.Add(counter++,
                                                  ControlPoints[i * this.NumberOfControlPointsZeta + offset]);
            }

            EdgesDictionary.Add(6, edge7);

            #endregion Edge7

            #region Edge8

            Edge edge8 = new Edge();
            edge8.ID                    = 7;
            edge8.Degree                = this.DegreeHeta;
            edge8.KnotValueVector       = this.KnotValueVectorHeta;
            edge8.NumberOfControlPoints = this.NumberOfControlPointsHeta;
            edge8.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsHeta; i++)
            {
                edge8.ControlPointsDictionary.Add(counter++,
                                                  ControlPoints[i * this.NumberOfControlPointsZeta + this.NumberOfControlPointsZeta - 1 + offset]);
            }

            EdgesDictionary.Add(7, edge8);

            #endregion Edge8

            #region Edge9

            Edge edge9 = new Edge();
            edge9.ID                    = 8;
            edge9.Degree                = this.DegreeKsi;
            edge9.KnotValueVector       = this.KnotValueVectorKsi;
            edge9.NumberOfControlPoints = this.NumberOfControlPointsKsi;
            edge9.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsKsi; i++)
            {
                edge9.ControlPointsDictionary.Add(counter++,
                                                  ControlPoints[i * this.NumberOfControlPointsZeta * this.NumberOfControlPointsHeta]);
            }

            EdgesDictionary.Add(8, edge9);

            #endregion Edge9

            #region Edge10

            Edge edge10 = new Edge();
            edge10.ID                    = 9;
            edge10.Degree                = this.DegreeKsi;
            edge10.KnotValueVector       = this.KnotValueVectorKsi;
            edge10.NumberOfControlPoints = this.NumberOfControlPointsKsi;
            edge10.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsKsi; i++)
            {
                edge10.ControlPointsDictionary.Add(counter++,
                                                   ControlPoints[i * this.NumberOfControlPointsZeta * this.NumberOfControlPointsHeta
                                                                 + this.NumberOfControlPointsZeta - 1]);
            }

            EdgesDictionary.Add(9, edge10);

            #endregion Edge10

            #region Edge11

            Edge edge11 = new Edge();
            edge11.ID                    = 10;
            edge11.Degree                = this.DegreeKsi;
            edge11.KnotValueVector       = this.KnotValueVectorKsi;
            edge11.NumberOfControlPoints = this.NumberOfControlPointsKsi;
            edge11.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsKsi; i++)
            {
                edge11.ControlPointsDictionary.Add(counter++,
                                                   ControlPoints[i * this.NumberOfControlPointsZeta * this.NumberOfControlPointsHeta +
                                                                 this.NumberOfControlPointsZeta * (this.NumberOfControlPointsHeta - 1)]);
            }

            EdgesDictionary.Add(10, edge11);

            #endregion Edge11

            #region Edge12

            Edge edge12 = new Edge();
            edge12.ID                    = 11;
            edge12.Degree                = this.DegreeKsi;
            edge12.KnotValueVector       = this.KnotValueVectorKsi;
            edge12.NumberOfControlPoints = this.NumberOfControlPointsKsi;
            edge12.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsKsi; i++)
            {
                edge12.ControlPointsDictionary.Add(counter++,
                                                   ControlPoints[i * this.NumberOfControlPointsZeta * this.NumberOfControlPointsHeta +
                                                                 this.NumberOfControlPointsZeta * (this.NumberOfControlPointsHeta - 1) +
                                                                 this.NumberOfControlPointsZeta - 1]);
            }

            EdgesDictionary.Add(11, edge12);

            #endregion Edge12
        }
示例#2
0
        private void CreateEdges2D()
        {
            #region EdgeRight

            Edge edgeRight = new Edge();
            edgeRight.ID                    = 0;
            edgeRight.Degree                = this.DegreeHeta;
            edgeRight.KnotValueVector       = this.KnotValueVectorHeta;
            edgeRight.NumberOfControlPoints = this.NumberOfControlPointsHeta;
            edgeRight.Patch                 = this;
            int counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsHeta; i++)
            {
                edgeRight.ControlPointsDictionary.Add(counter++, ControlPoints[i]);
            }

            EdgesDictionary.Add(0, edgeRight);

            #endregion EdgeRight

            #region EdgeLeft

            Edge edgeLeft = new Edge();
            edgeLeft.ID                    = 1;
            edgeLeft.Degree                = this.DegreeHeta;
            edgeLeft.KnotValueVector       = this.KnotValueVectorHeta;
            edgeLeft.NumberOfControlPoints = this.NumberOfControlPointsHeta;
            edgeLeft.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsHeta; i++)
            {
                edgeLeft.ControlPointsDictionary.Add(counter++,
                                                     ControlPoints[i + this.NumberOfControlPointsHeta * (this.NumberOfControlPointsKsi - 1)]);
            }

            EdgesDictionary.Add(1, edgeLeft);

            #endregion EdgeLeft

            #region EdgeBottom

            Edge edgeBottom = new Edge();
            edgeBottom.ID                    = 2;
            edgeBottom.Degree                = this.DegreeKsi;
            edgeBottom.KnotValueVector       = this.KnotValueVectorKsi;
            edgeBottom.NumberOfControlPoints = this.NumberOfControlPointsKsi;
            edgeBottom.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsKsi; i++)
            {
                edgeBottom.ControlPointsDictionary.Add(counter++, ControlPoints[i * this.NumberOfControlPointsHeta]);
            }

            EdgesDictionary.Add(2, edgeBottom);

            #endregion EdgeBottom

            #region EdgeUp

            Edge edgeUp = new Edge();
            edgeUp.ID                    = 3;
            edgeUp.Degree                = this.DegreeKsi;
            edgeUp.KnotValueVector       = this.KnotValueVectorKsi;
            edgeUp.NumberOfControlPoints = this.NumberOfControlPointsKsi;
            edgeUp.Patch                 = this;
            counter = 0;
            for (int i = 0; i < this.NumberOfControlPointsKsi; i++)
            {
                edgeUp.ControlPointsDictionary.Add(counter++,
                                                   ControlPoints[i * this.NumberOfControlPointsHeta + this.NumberOfControlPointsHeta - 1]);
            }

            EdgesDictionary.Add(3, edgeUp);

            #endregion EdgeUp
        }