@lawrenceyy wrote:
I am trying to write a script via ghpython that simulates refraction but am running into some unexpected errors when it comes to the intersection of lines and breps. In the images below, you can see a red surface which is the source (the surface is divided to get 25 points, and “light” is emitted normal to the surface). The blue is the medium that refracts. And the two lines represents the light- only 2 of the 25 had issues. My overall strategy is to explode the medium to get its brepfaces, then intersect with a line (which is converted ToNurbsCurve()) and pick the closest point from the start of the line to evaluate refraction. When these two lines are intersected with the medium, points are generated for the flat back brepface, but none for the wavy brepface. Why is this happening and how do I fix it? Even when I intersect the lines with the medium (unexploded) in Rhino, only intersection points on the back a generated.
Better yet, maybe someone can show me how to use
Rhino.Geometry.Intersect.Intersection.RayShoot()
. I can generate the rays with the same inputs that generate the lines, but I am not sure how to convertRhino.Geometry.BrepFace
togeometry: IEnumerable[GeometryBase]
.
180111 Intersection Problem.3dm (94.0 KB)
Thanks,
Lawrence Yun
Posts: 1
Participants: 1