Ejemplo n.º 1
0
            bool IsBridgeValid(SimpleClosedPath exterior, ExtendedEdge bridge)
            {
                foreach (Edge e in exterior.AllEdges())
                {
                    List <Vector2> intersections = bridge.GetIntersectionsWith(e);

                    if (intersections.Count > 0 && !e.HasEqualEndpoint(bridge))
                    {
                        return(false);
                    }
                }

                return(true);
            }
Ejemplo n.º 2
0
            SimpleClosedPath Simplify(SimpleClosedPath exterior, Polygon newPolygon)
            {
                SimpleClosedPath result = new SimpleClosedPath(newPolygon);

                foreach (SimpleClosedPath hole in exterior.Holes())
                {
                    UpdatePossibleBridges(exterior, hole);

                    while (!possibleBridges.IsEmpty())
                    {
                        ExtendedEdge bridge = possibleBridges.ExtractFirst();

                        if (IsBridgeValid(exterior, bridge))
                        {
                            //result.JoinByBridge(bridge);
                        }
                    }
                }

                return(result);
            }