ReferenceIntersector Get Normal at Intersection Points (mesh)

ReferenceIntersector Get Normal at Intersection Points (mesh)

MattKincaid
Advocate Advocate
920 Views
3 Replies
Message 1 of 4

ReferenceIntersector Get Normal at Intersection Points (mesh)

MattKincaid
Advocate
Advocate

I'm using the ReferenceIntersector API and need to know the surface normal, at the intersection point.  I followed the RayTraceBounce sample in the SDK, and the given technique works well if the intersection occurs at a Face.  But I can't seem to determine the normal if the intersection is with a Mesh Element, such as topography. 

 

Any techniques for doing this?  Thanks.

0 Likes
921 Views
3 Replies
Replies (3)
Message 2 of 4

Moustafa_K
Collaborator
Collaborator

Hi,

just a quick though came up... what if you get the closest xyz point to the globalpoint, and cross product both points to get the normal?

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes
Message 3 of 4

MattKincaid
Advocate
Advocate

@Moustafa_K Yep, that's roughly what I ended up doing.  Works correctly.  But searching all the Mesh Vertices for the closest one can be a slow operation for complicated meshes. 

 

It would be handy if the ReferenceWithContext object returned by the Reference Intersector had a Normal, in addition to the global point.  Or if Meshes had a computeNormal method, like Faces do. 

Message 4 of 4

mehdi.blanchard
Enthusiast
Enthusiast

Depending on the accuracy you need, you could project 2 more points nearby the original one, and get the normal from those three points on the surface. It could save you from looking for the nearby vertices.

0 Likes