Пример #1
0
        public static bool TestPolys()
        {
            try
            {
                var polyoId = SelectionManager.GetAllPolylines();
                var ordered = SelectionManager.OrderPolylines(polyoId);

                foreach (Polyline p in ordered)
                {
                    //Identify Outer Boundary

                    if (p.Area < 55000)
                    {
                        continue;
                    }

                    if (p == null)
                    {
                        continue;
                    }

                    try
                    {
                        var bndypnts = GetPoints(p);
                        var num      = bndypnts.Count;

                        foreach (Polyline t in ordered)
                        {
                            if (t.Layer == p.Layer &&
                                t.Area == p.Area)
                            {
                                continue;
                            }

                            var tstpnts = GetPoints(t);

                            foreach (Point2d tpnt in tstpnts)
                            {
                                if (WNumAlgorithm.wn_PnPoly(tpnt, bndypnts.ToArray(), num) != 0)
                                {
                                    COMS.MessengerManager.AddLog("Point is Inside" + tpnt.ToString());
                                    AddCircle(tpnt);
                                    //return true;
                                }
                            }
                        }
                    }
                    catch (System.Exception ex)
                    {
                        COMS.MessengerManager.LogException(ex);
                    }
                }
            }
            catch (System.Exception ex)
            {
                COMS.MessengerManager.LogException(ex);
            }

            return(false);
        }
Пример #2
0
        public static bool WN_Algorithm(Point2dCollection b, Point2dCollection t)
        {
            var ba = b.ToArray();

            foreach (Point2d p in t)
            {
                if (WNumAlgorithm.wn_PnPoly(p, ba, b.Count) != 0)
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #3
0
        public static bool TestPolysRuntime()
        {
            try
            {
                var polyoId = SelectionManager.GetAllPolylines();
                var ordered = SelectionManager.OrderPolylines(polyoId);

                foreach (Polyline p in ordered)
                {
                    if (p == null)
                    {
                        continue;
                    }

                    try
                    {
                        var bndypnts = GetPoints(p);
                        var num      = bndypnts.Count;

                        foreach (Polyline t in ordered)
                        {
                            if (t.Layer == p.Layer &&
                                t.Area == p.Area)
                            {
                                continue;
                            }

                            var tstpnts = GetPoints(t);

                            foreach (Point2d tpnt in tstpnts)
                            {
                                if (WNumAlgorithm.wn_PnPoly(tpnt, bndypnts.ToArray(), num) != 0)
                                {
                                    return(true);
                                }
                            }
                        }
                    }
                    catch (System.Exception ex)
                    {
                        COMS.MessengerManager.LogException(ex);
                    }
                }
            }
            catch (System.Exception ex)
            {
                COMS.MessengerManager.LogException(ex);
            }

            return(false);
        }