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

Rtree Insert\Remove

$
0
0

@powerpp wrote:

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

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5875

Trending Articles