Quantcast
Viewing all articles
Browse latest Browse all 5809

Python 'IndexOutOfRangeException' error on Rhino Geometry RayShoot

def rays_intersect(plane, rays, context):

    intPs = []

    for ray in rays:
        ray_from_plane = rg.Ray3d(plane.Origin, ray)
        intP = rg.Intersect.Intersection.RayShoot(ray_from_plane, context, 1)
        if intP == None:
            intPs.append(None)
        else:
            intPs.append(intP[0])
    return intPs

Hi,

I am trying to use the python script in Rhino 7 that I have made using Rhino 6 and seeing some issues as below.
’IntP’ suppose to append the point3d object to ‘intPs’ list and I believe that the item from array generated by RayShoot command needs to be called out with [0].

As this error is happening only in Rhino 7.
Any help would be greatly appreciated.

Thank you!
Sun

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5809

Trending Articles