Rtree Insert\Remove

Hi,

i have difficulties in understanding the insert\remove mechanism of Rtrees in Rhino. Why do I need an index AND a point position to remove a point? And what is this pointposition refering to (also bounding box can be used)?

I can do
rtree = rc.Geometry.RTree() rtree.Insert(rs.coerce3dpoint([1,1,1]),10) print rtree.Count rtree.Remove(rs.coerce3dpoint([1,1,1]), 10) print rtree.Count

but this is also working.
rtree = rc.Geometry.RTree() rtree.Insert(rs.coerce3dpoint([1,1,1]),10) print rtree.Count rtree.Remove(rs.coerce3dpoint([1,1,2]), 10) print rtree.Count

Whats taking place under the hood? I am trying to add and remove a lot of points from rtree in several iterations. But if I always need to know the position of the point I want to remove I will run into performance issues.

Thanks in advance!

Philip

1 Like