예제 #1
0
        public static void Do_Mesh(ref GLCommon GLC)
        {
            /////电势处理
            WEntity2D[]       Ls   = Geos2D_Selection.SelectLines(GLC.Layer_Pole, GLC.Color_PotentL, ref GLC.WGC); /////找到所有零电势的圆
            WEntity2D[]       Hs   = Geos2D_Selection.SelectLines(GLC.Layer_Pole, GLC.Color_PotentH, ref GLC.WGC); /////找到所有正电势的圆
            List <WPoint2D>[] Ptts = new List <WPoint2D> [2];                                                      /////零电势及正电势的点集位置
            Ptts[0] = new List <WPoint2D>();
            for (int i = 0; i < Ls.Length; i++)
            {
                Ptts[0].Add(((WCircle2D)Ls[i]).Center);
            }
            Ptts[1] = new List <WPoint2D>();
            for (int i = 0; i < Ls.Length; i++)
            {
                Ptts[1].Add(((WCircle2D)Hs[i]).Center);
            }
            /////
            WMesh2D_Mesh Mesh_t;

            for (int i = 0; i < GLC.Rims.Count; i++)    /////GLC.Rims.Count
            {
                if (GLC.Rims[i].Trace >= 1000)
                {
                    continue;
                }
                if (GLC.Rims[i].Trace % 10 == 2)
                {
                    Mesh_t = Mesh_SinglePole(GLC.Rims[i], ref GLC, ref Ptts, Convert.ToString(i));
                    if (Mesh_t != null)
                    {
                        GLC.Meshs.Add(Mesh_t);
                    }
                }
            }
        }
예제 #2
0
        static void Do_Mesh(ref GLCommon GLC)
        {
            ///////得到各种线的ID
            WLine2D AxisX = GLC.Get_Line_XAxis();                                                                /////中间X轴线

            WEntity2D[] Ws        = Geos2D_Selection.SelectLines(GLC.Layer_Wires, GLC.Color_Wires, ref GLC.WGC); /////夹丝线
            WEntity2D[] Ws_Sorted = Sort_Wires(AxisX, ref Ws, ref GLC);                                          /////将线的ID按照X值从小到大排列
            Ws = null;
            MeshPara_Compute(ref Ws_Sorted, ref GLC);
            /////
            WMesh2D_Mesh Mesh_Glass;

            for (int i = 0; i < GLC.Rims.Count; i++)
            {
                if (GLC.Rims[i].Trace % 10 == 1)
                {
                    Mesh_Glass = Mesh_SingleRim(ref AxisX, ref GLC.Rims[i].Curves, ref Ws_Sorted, ref GLC);
                    if (Mesh_Glass == null)
                    {
                        continue;
                    }
                    GLC.Rims[i].Meshed = true;
                    Mesh_Glass.Trace   = 1;
                    Mesh_Glass.Color   = GLC.Rims[i].Color;
                    GLC.Meshs.Add(Mesh_Glass);
                }
            }
            for (int i = 0; i < GLC.Rims.Count; i++) //////GLC.Rims.Count
            {
                if (GLC.Rims[i].Trace % 10 == 1 && GLC.Rims[i].Meshed == false)
                {
                    Mesh_Glass = Mesh_FreeRim(ref GLC.Rims[i].Curves, ref Ws_Sorted, ref GLC, i.ToString());
                    if (Mesh_Glass == null)
                    {
                        continue;
                    }
                    Mesh_Glass.Trace = 1;
                    Mesh_Glass.Color = GLC.Rims[i].Color;
                    GLC.Meshs.Add(Mesh_Glass);
                    //Mesh_Glass.Output_ToFile("G:\\");
                }
            }
        }