[ 
https://issues.apache.org/jira/browse/GEOMETRY-43?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16764041#comment-16764041
 ] 

Matt Juntunen commented on GEOMETRY-43:
---------------------------------------

I looked into this a little bit more and what's happening is that the first 
intersection in your test is when the line going in the +y direction hits the 
very edge of the -y side of the cube. When you compute the next intersection 
with the line start point directly on the +z side of the cube, the logic I 
added with your last test says that it intersects that face since it is lying 
on the boundary. However, when you actually attempt to compute the 
intersection, no result is returned since the line is parallel to the plane. 
So, what I think I need to do is add an extra test to what I added previously 
to avoid returning faces that have no intersections with the lines. I 
experimented a bit with that and it did indeed return the {{0.5, 1.0, 0.0}} 
that your test expects (meaning it caught the top edge of the +y side). I'll 
need a bit of time to verify this and write it up, though. Does that match the 
behavior you were expecting?

> Check unit test - line intersecting cube (line lies on a plane)
> ---------------------------------------------------------------
>
>                 Key: GEOMETRY-43
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-43
>             Project: Apache Commons Geometry
>          Issue Type: Task
>          Components: Euclidean 3D
>            Reporter: Sven Rathgeber
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Intersecting a cube with a Line (which lies on a plane) results in one 
> intersection only.
>  
> Please check the pull request:
> https://github.com/apache/commons-geometry/pull/23
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to