Meshes.jl icon indicating copy to clipboard operation
Meshes.jl copied to clipboard

Intersection of Ray - Triangle: Suggestion for new intersection types

Open dorn-gerhard opened this issue 2 years ago • 2 comments

I am planning to work on the intersection of Ray - Triangle to provide more intersection types. Currently it just works in 3D which is basically fine though I don't see issues with a 2D implementation.

But most important if a Ray is parallel to a triangle in the sense that they lie in the same plane, then the intersection should be a segment.

So basically there are two main cases, namely whether Ray and triangle lie in the same plane (2D case) or not

Further I would indicate whether the boundary of the triangle is involved in the intersection.

Here are my suggested intersection types:

A) ray is in the plane of the trianlge (also 2D case, overlapping and touching)

  • CASE 1 do not touch or overlap (NoIntersection)
  • CASE 2 touch in one corner (CornerTouchingRayTriangle -> Point)
  • CASE 3 touch on an edge point (EdgeTouchingRayTriangle -> Point)
  • CASE 4 overlap with the triangle (OverlappingRayTriangle -> Segment)
  • CASE 5 overlap with an edge of the triangle (OverlappingRayTriangleEdge -> Segment)
  • CASE 6 overlap with the triangle includes a corner (OverlappingRayTriangleCorner -> Segment)

B) ray is not in the plane of the triangle (crossing and touching)

  • CASE 1 do not cross or touch (NoIntersection)
  • CASE 2 touch in one corner (CornerTouchingRayTriangle -> Point
  • CASE 3 touch on an edge point (EdgeTouchingRayTriangle -> Point)
  • CASE 7 cross in one inner point of the triangle (CrossingRayTriangle -> Point)

Cases A would be new and are not treated so far (I think). Cases B would change IntersectingRayTriangle to the three suggested cases. What do you think?

dorn-gerhard avatar Oct 10 '22 20:10 dorn-gerhard

You are the master of intersections, I am trusting the type hierarchy you designed carefully. Thank you for putting the time into it.

juliohm avatar Oct 10 '22 21:10 juliohm

Just wanted to say thanks for working on this. With these planned updates, #293 will finally be able to be finished!

kylebeggs avatar Oct 11 '22 22:10 kylebeggs

After finishing intersections between rays, lines and segments, I will work on intersections of these three geometries with plane and triangles.

Therefore I will think about a new (more general) intersectparameters function

dorn-gerhard avatar Nov 15 '22 22:11 dorn-gerhard

@kylebeggs has solved this issue already. We have more combinations of ray-triangle intersection types already. 🎉

juliohm avatar Mar 30 '23 18:03 juliohm