Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Removing nodes off rtree

$
0
0

I have a list of points and I want to remove all nodes off my rtree within 2mm radius of each point on the list, but the code below is making my rhino crash. I feel like I’m not doing this in the most optimum way tbh. Any advice?

        def Remove_Nodes(sender, e):
           node = nodes[e.Id]
            r_tree.Remove(node, e.Id)
        
        # removing surrounding nodes
        for point in points:
            bounding_sphere = rg.Sphere(point, 2)
            r_tree.Search(bounding_sphere, Remove_Nodes)
  • nodes is another list of points, and the rtree was created from those, so they should have the same index I assume.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles