Ejemplo n.º 1
0
        public List <Node> FindNodesWithinRadius(UV location, double radius)
        {
            var nodes  = new List <Node>();
            var circle = Circle.ByCenterPointRadius(
                Autodesk.DesignScript.Geometry.Point.ByCoordinates(location.U, location.V),
                radius);

            if (!Intersects(circle))
            {
                return(nodes);
            }

            if (IsLeafNode)
            {
                nodes.Add(this);
                return(nodes);
            }

            nodes.AddRange(NW.FindNodesWithinRadius(location, radius));
            nodes.AddRange(NE.FindNodesWithinRadius(location, radius));
            nodes.AddRange(SW.FindNodesWithinRadius(location, radius));
            nodes.AddRange(SE.FindNodesWithinRadius(location, radius));

            return(nodes);
        }