Revision: 55994
          http://sourceforge.net/p/brlcad/code/55994
Author:   phoenixyjll
Date:     2013-07-10 06:00:49 +0000 (Wed, 10 Jul 2013)
Log Message:
-----------
If there are points on the line, there should be an intersection, and the 
following code will work - don't need to calculate points_on_line, which will 
cause some cases to fail.

Modified Paths:
--------------
    brlcad/trunk/src/libbrep/intersect.cpp

Modified: brlcad/trunk/src/libbrep/intersect.cpp
===================================================================
--- brlcad/trunk/src/libbrep/intersect.cpp      2013-07-10 04:27:56 UTC (rev 
55993)
+++ brlcad/trunk/src/libbrep/intersect.cpp      2013-07-10 06:00:49 UTC (rev 
55994)
@@ -1667,18 +1667,16 @@
     double dp2 = ON_DotProduct(TriA.B - intersect.from, line_normal);
     double dp3 = ON_DotProduct(TriA.C - intersect.from, line_normal);
 
-    int points_on_line = ON_NearZero(dp1) + ON_NearZero(dp2) + 
ON_NearZero(dp3);
     int points_on_one_side = (dp1 >= ON_ZERO_TOLERANCE) + (dp2 >= 
ON_ZERO_TOLERANCE) + (dp3 >= ON_ZERO_TOLERANCE);
-    if (points_on_one_side == 0 || points_on_one_side == 3-points_on_line)
+    if (points_on_one_side == 0 || points_on_one_side == 3)
        return false;
 
     line_normal = ON_CrossProduct(plane_b.Normal(), intersect.Direction());
     double dp4 = ON_DotProduct(TriB.A - intersect.from, line_normal);
     double dp5 = ON_DotProduct(TriB.B - intersect.from, line_normal);
     double dp6 = ON_DotProduct(TriB.C - intersect.from, line_normal);
-    points_on_line = ON_NearZero(dp4) + ON_NearZero(dp5) + ON_NearZero(dp6);
     points_on_one_side = (dp4 >= ON_ZERO_TOLERANCE) + (dp5 >= 
ON_ZERO_TOLERANCE) + (dp6 >= ON_ZERO_TOLERANCE);
-    if (points_on_one_side == 0 || points_on_one_side == 3-points_on_line)
+    if (points_on_one_side == 0 || points_on_one_side == 3)
        return false;
 
     double t[4];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to