algorithmic modeling for Rhino
Hello,
I've been having some trouble using the Rhino.Geometry.Intersect.Intersection.RayShoot function. It seems that sometimes it works, other times it doesn't return a proper Point3d [] array (or so it seems, I just get the "1. Solution exception:Object reference not set to an instance of an object." error).
Code is simply trying to find the first ray intersection on a set of surfaces:
Point3d Intersect(List<Surface> s, Ray3d ray)
{
Point3d [] pts = Rhino.Geometry.Intersect.Intersection.RayShoot(ray, s, 1);
f (pts.Length != 0 && pts[0].IsValid)
{
return pts[0];
}
return ray.Position;
}
Anyone have any idea of what I'm doing wrong? Can post more code if necessary...
Tags:
Does s perhaps contain null elements?
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2025 Created by Scott Davidson.
Powered by