Grasshopper

algorithmic modeling for Rhino

intersection of ray and mesh/surface how to find normal?

Hello,
I am trying to make a small definition to scatter "sound" [rays] inside a volume [Brep/Mesh] the reflections will be calculated simply using the normal of the surface/mesh at the point of intersection.
If I try to use meshray intersection component then is there a possibility to find the normal at the point of intersection?
If I try to use Brep/line intersection then i also only get a point but no normal.
If my Brep is made out of a number of surfaces and I am only looking for the first intersection [which is returned as a point] why does the component not return also WHICH surface am I intersecting -> in that case i could evaluate said surface at uv coordinates using closest point or otherwise...
any hints?
Thanks :-)

Views: 1282

Replies to This Discussion

Hey -

It's not an ideal solution, but here's a kind of hack that will give you the normal at the intersection. It works by displacing the ray twice so that for each original ray there are 3 intersections, from which a plane and then a normal can be constructed.


There may also be a solution involving finding the closest mesh vertex and extracting the vertex normal from that. I would steer away from trying to do it with BRreps and surfaces, although it could probably be done by exploding (BRep components) the BRep and grafting the resulting faces to be able to keep track of which is which. But the problem with this approach is that the intersections for all rays would need to be calculated separately for each face, which is pretty inefficient.

Hope this helps!

Andrew
Attachments:
Thank you ! for the quick reply ...it is quite clever and useful

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service