How to find the coordinate for a point of intersection with a mesh object

How to find the coordinate for a point of intersection with a mesh object

jeg6BMD5N
Participant Participant
577 Views
2 Replies
Message 1 of 3

How to find the coordinate for a point of intersection with a mesh object

jeg6BMD5N
Participant
Participant

Screenshot 2024-01-22 145126.png

Hello,

I am still fairly new to fusion 360 workflows and the API, so thank you in advance for any help or general advice you may provide.

Essentially I have designed a prototype helmet for use in fNIRS research experiments. In my script I created circle sketches perpendicular to the surface of the helmet and extruded them to create holes where fiber optic cables are going to be inserted to sit on the scalp. I have center points for those sketches and construction axes running perpendicular to the surface of the helmet. 

The goal is to take a 3d scan of the person and project the points I have on the helmet down to the scalp to get the coordinates of where the fibers will be sitting on their head.

 

I can't find any method that will give me a point of intersection with a mesh object for use with the head scan.

Another method I tried is down sampling the mesh object and converting it to a BRep object to then project the center point along the construction axis vector to the nearest face on the converted mesh (pictured below). But for this, the problem then becomes figuring out which of the many hundreds/thousands of triangular faces to select in the code to automate the creation of the intersection point. I don't have the faintest idea of how to do that.

 

Is there a better way to do this? I am open to any ideas.

 

Thanks again!

 

Screenshot 2024-01-22 152841.png

0 Likes
Accepted solutions (1)
578 Views
2 Replies
Replies (2)
Message 2 of 3

BrianEkins
Mentor
Mentor
Accepted solution

I'm unaware of anything in the API that will do that. I think you will need to write the code yourself to intersect a line with a mesh. It would be a challenge, but it is possible. The real challenge would be making it performant, but I'm guessing that probably isn't that important for your case initially.

 

Here are a couple of things I found after a quick search.

https://stackoverflow.com/questions/42740765/intersection-between-line-and-triangle-in-3d

https://courses.cs.washington.edu/courses/cse457/09au/lectures/triangle_intersection.pdf

https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm

http://www.lighthouse3d.com/tutorials/maths/ray-triangle-intersection/

 

Good luck 😁

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 3

jeg6BMD5N
Participant
Participant
I was afraid of that! Thank you for your input and for sending me these resources. I will see what I can work out
0 Likes