unfortunately that is how it has always been and applies to vbscript, python and rhino common. The helpfile mentions:
Only Surface and Brep objects are currently supported. Trims are ignored on Breps.
Your script looks like you’re only interested in the first reflection point ? Why not intersect with a line or project the points and try to keep the closest one ? Below is an example script using projection and scene based on yours. Note that a projection can hit an object multiple times and goes in two directions…
and was therefore blissfully unaware of this. With the limitations in place (no trimmed Breps, no meshes), ShootRays() is essentially useless for most tasks.
Thank you also for providing a ProjectPointsToBreps() example. Yes, for my particular application, this works very well. I’ve now re-written my code around rs.ProjectPointToSurface().
at least for meshes you could now use Rhino.Geometry.Intersect.Intersection.MeshRay. I’ve used it for breps (their rendermesh) as well and then pulled the points to the brep if required. But i agree, a method to work around this would be great.
The best you can do for now is shoot a ray at a surface and then see if the first intersection point falls on face’s active region using BrepFace.IsPointOnFace.
It seems BrepFace.IsPointOnFace takes in a u,v parameter, so how can the point3d that is returned by shootray be turned into a u,v? Would this also mean you need to iterate through every brep object and every face of those objects that were passed to shootray as an IEnumerable?
Is there a way to just make a new brep that does not include the trimmed part?
unless I am missing something, if I have 1000 brep objects and do shootray, I can pass those 1000 breps, but then need to make a for loop to go over each one and use ClosestPoint, correct?
Not exactly that, but you could mesh your Brep and use the MeshRay intersection method instead. That doesn’t do reflections though, but you could script that as well.