Exemple #1
0
 /// 将计算出夹丝线与边界线的交点加入边界线的节点中
 private static void Add_Ps2_Bnds(ref List <WPoint2D> Pts, ref WCurve2D[] Bds_O)
 {
     for (int j = 0; j < Pts.Count; j++)
     {
         Bds_O[Pts[j].CheckNum].Nodes.Add(new WPoint2D(Pts[j].X, Pts[j].Y, 0));
         for (int k = 0; k < Bds_O.Length; k++)
         {
             if (Bds_O[k].Meshed_Check == true)
             {
                 continue;
             }
             if (k == Pts[j].CheckNum)
             {
                 continue;
             }
             if (Geos2D_Other.Check_PsMerge(Pts[j], Bds_O[k].StartPoint) == true)
             {
                 Bds_O[k].Nodes.Add(new WPoint2D(Pts[j].X, Pts[j].Y, 0));
             }
             if (Geos2D_Other.Check_PsMerge(Pts[j], Bds_O[k].EndPoint) == true)
             {
                 Bds_O[k].Nodes.Add(new WPoint2D(Pts[j].X, Pts[j].Y, 0));
             }
         }
         Pts[j] = new WPoint2D(Pts[j].X, Pts[j].Y, 0);
     }
 }
Exemple #2
0
        public WRim2D(ref WEntity2D[] Cs, List <int> Rim)
        {
            this.Meshed      = false;
            this.Nums        = Rim;
            this.Trace       = 0;
            this.Smaller     = new List <int>();
            this.Curves      = new WEntity2D[Rim.Count];
            this.Shape       = new List <WPoint2D>();
            this.Layer       = "Rims";
            this.Color       = Color.AliceBlue;
            this.Color_Shape = Color.Black;
            this.Kind        = GeoKind.Rim;
            Initial_Bound();
            ///
            WCurve2D C;
            WPoint2D P0 = new WPoint2D();
            WPoint2D P1 = new WPoint2D();
            WPoint2D P2 = new WPoint2D();

            for (int i = 0; i < Rim.Count; i++)
            {
                this.Curves[i] = Cs[Rim[i]];
                C = (WCurve2D)Cs[Rim[i]];
                Update_Bound(C.Xmax, C.Ymax);
                Update_Bound(C.Xmin, C.Ymin);
                /////形成边界
                if (i == 0)
                {
                    P1 = ((WCurve2D)(Cs[Rim[Rim.Count - 1]])).StartPoint;
                    P2 = ((WCurve2D)(Cs[Rim[Rim.Count - 1]])).EndPoint;
                    if (Geos2D_Other.Check_PsMerge(P1, C.StartPoint) == true ||
                        Geos2D_Other.Check_PsMerge(P2, C.StartPoint) == true)
                    {
                        P0 = C.StartPoint;
                    }
                    if (Geos2D_Other.Check_PsMerge(P1, C.EndPoint) == true ||
                        Geos2D_Other.Check_PsMerge(P2, C.EndPoint) == true)
                    {
                        P0 = C.EndPoint;
                    }
                }
                P0 = Add_Curve2Shape(C, P0);
            }
        }