public static void bienB_repOZ(ref B_Rep w, float a)
 {
     for (int i = 0; i < w.nVert; i++)
     {
         w.vert[i] = xoayDiemOZ(w.vert[i], a);
     }
 }
 //--------------- Khu mat khuat ------------------
 public static void khuMatKhuat(ref B_Rep w, Vector v)
 {
     Vector n;
     for (int i = 0; i < w.nPoly - 2; i++)
     {
         n = w.poly[i].PVector;
         if (n.x * v.x + n.y * v.y + n.z * v.z < 0) w.poly[i].Visible = 0;
         else w.poly[i].Visible = 1;
     }
 }
        public static void tinhPhapVector(ref B_Rep w, double phiTraiDat, double tetaTraiDat)
        {
            Point3D p1 = new Point3D();
            Point3D p2 = new Point3D();
            Point3D p3 = new Point3D();
            Vector n = new Vector();

            for (int i = 0; i < w.nPoly - 2; i++)
            {

                p1 = w.vert[w.poly[i].Vertexes[0]];
                p2 = w.vert[w.poly[i].Vertexes[1]];
                p3 = w.vert[w.poly[i].Vertexes[2]];

                DoiHeToaDo(ref p1, 200, phiTraiDat, tetaTraiDat);
                DoiHeToaDo(ref p2, 200, phiTraiDat, tetaTraiDat);
                DoiHeToaDo(ref p3, 200, phiTraiDat, tetaTraiDat);

                n.x = p1.y * (p2.z - p3.z) + p2.y * (p3.z - p1.z) + p3.y * (p1.z - p2.z);
                n.y = p1.z * (p2.x - p3.x) + p2.z * (p3.x - p1.x) + p3.z * (p1.x - p2.x);
                n.z = p1.x * (p2.y - p3.y) + p2.x * (p3.y - p1.y) + p3.x * (p1.y - p2.y);
                w.poly[i].PVector = n;
            }
        }
        public static void veSS_viewxyMT(Graphics graphics,B_Rep w, double phiMatTroi, double tetaMatTroi,Point2D p0, Color color)
        {
            int j;

            var p1 = new Point2D();
            var p2 = new Point2D();

            for (int i = 0; i < w.nPoly - 2; i++)
            {
                if (w.poly[i].Visible == 1)
                {
                    for (j = 0; j < w.poly[i].NVert - 1; j++)
                    {
                        Point3D p13D = w.vert[w.poly[i].Vertexes[j]];

                        DoiHeToaDo(ref p13D, 200, phiMatTroi, tetaMatTroi);

                        p1.x = p13D.x;
                        p1.y = p13D.y;
                        //p1 = this.chieuPCoxy(p13D, 500);

                        Point3D p23D = w.vert[w.poly[i].Vertexes[j + 1]];

                        DoiHeToaDo(ref p23D, 200, phiMatTroi, tetaMatTroi);

                        p2.x = p23D.x;
                        p2.y = p23D.y;

                        //p2 = this.chieuPCoxy(p23D, 500);

                        //MyLine(p1, p2, this.graphics);
                        MyLine(p0, color, p1, p2, graphics);
                    }

                    Point3D p113D = w.vert[w.poly[i].Vertexes[0]];

                    DoiHeToaDo(ref p113D, 200, phiMatTroi, tetaMatTroi);

                    p1.x = p113D.x;
                    p1.y = p113D.y;

                    Point3D p123D = w.vert[w.poly[i].Vertexes[j]];

                    DoiHeToaDo(ref p123D, 200, phiMatTroi, tetaMatTroi);

                    p2.x = p123D.x;
                    p2.y = p123D.y;

                    MyLine(p0, color, p1, p2, graphics);

                }
            }
        }
 public void bienB_repOZ(ref B_Rep w, float a)
 {
     Drawing.bienB_repOZ(ref this.wireFrame, gocQuay);
 }