Grasshopper

algorithmic modeling for Rhino

Dear David

I hope 'Intersection.Rayshoot' to return surface number when the ray hits.

Public Shared Function RayShoot 
(ray As Ray3d,geometry As IEnumerable(Of GeometryBase),
maxReflections As Integer _ ) As Point3d()

my code is as below.

Dim SrfL As new List(Of Surface)

Dim ry as Ray3d

Dim hpt As Point3d()
        hpt = Rhino.Geometry.Intersect.Intersection.RayShoot(ry, srfL, 1)

=> this returns hit point3d() and I only need first hit point and hitted surface number

Usually there are many surfaces,

So parameter 'geometry As IEnumerable(Of GeometryBase)' is very good to me,

But there is no sign of which surface is hitted.

So I have to find the hitted surface by evaluating 'hit point3d=>all the surface U.V=>all the point3d(U,V)' and find short distance point3d and its surface again.

Would you update theRayshoot function return both point3D() and GeometryNumber()'(list number)

Frankly i needs first hit point3d, and its Geometry Number('list number) return.

Thank you very much.
Best Regards,
Danial.

Views: 483

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2026   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service