Hello,
I’ve encountered a very annoying Bug using the Isovist Ray. I’m trying to use it to hit objects and and retrieve the objects it hits. For some reason it fails inexplicably(at least to me) when dealing with multiple obstacles, some of the time. No hits are made and the error “Index must be less than the size of the collection” occurs. As shown in my examples below:
Item 1 - It fails with many obstacles. No Hits and the infamous “error”
Item 2 - It works. Successful hit and retrieved the obstacle. From the same list of obstacles of Item 1, I had to the select the polyline that it will literally hit judging from vision. I don’t understand why only when doing this works. It’s the same polyline from the master list of obstacles.
Item 3 - Using another set of curves as Line Rays and Obstacles works fine! It works in this instance. It has multiple obstacles and yet works as it should. Item 1 failing doesn’t make sense.
@Japhy Sorry to tag japhy but if you have any solutions to this it would be great.
Or if anyone can suggest a more robust way of projecting a Ray and retrieving the first object it hits, that would be extremely helpful. I’ve tried the method of using Line SDL and using the Cuve/Curve intersection but I don’t like that because it becomes convoluted and slow especially when dealing with multiple Data trees to match and not just a single list pair.
Here is the grasshopper file.
Isovist Ray Bug.gh (21.2 KB)
Thank you.




