You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mike Zimmerman (JIRA)" <ji...@apache.org> on 2015/04/08 17:45:12 UTC

[jira] [Updated] (MATH-1211) PolyhedronsSet.firstIntersection(Vector3D point, Line line) sometimes reports intersections on wrong end of line

     [ https://issues.apache.org/jira/browse/MATH-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Zimmerman updated MATH-1211:
---------------------------------
    Attachment: IntersectionTest.java

Sorry, this is my first time reporting a bug.  I didn't realize how mangled the code would get if I copied and pasted as a comment.

> PolyhedronsSet.firstIntersection(Vector3D point, Line line) sometimes reports intersections on wrong end of line
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: MATH-1211
>                 URL: https://issues.apache.org/jira/browse/MATH-1211
>             Project: Commons Math
>          Issue Type: Bug
>            Reporter: Mike Zimmerman
>         Attachments: IntersectionTest.java
>
>
> I constructed a PolyhedronsSet from a list of triangular faces representing an icosphere (using the instructions found at https://mail-archives.apache.org/mod_mbox/commons-user/201208.mbox/<50...@free.fr>).  This seems to produce correct INSIDE/OUTSIDE results for randomly chosen points.  I think my mesh triangles are defined appropriately.
> However, using PolyhedronsSet.firstIntersection(Vector3D point, Line line) to shoot randomly oriented rays from the origin sometimes gives a wrong mesh intersection point "behind" the origin.  The intersection algorithm is sometimes picking up faces of the sphere-shaped mesh on the wrong semi-infinite portion of the line, i.e. meshIntersectionPoint.subtract(point).dotProduct(line.getDirection())<0 where point is the Vector3D at center of the sphere and line extends outward through the mesh.
> I think the dot product above should always be positive. If multiple intersections exist along a "whole" line then the first one in "front" of the line's origin should be returned. This makes ray tracing with a PolyhedronsSet possible.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)