Revision: 72004
          http://sourceforge.net/p/brlcad/code/72004
Author:   starseeker
Date:     2018-11-13 19:24:36 +0000 (Tue, 13 Nov 2018)
Log Message:
-----------
Kicked this around with Keith trying to come up with a fix that is minimally 
invasive as far as disturbing other parts of this logic - this seems to do the 
job.

Modified Paths:
--------------
    brlcad/trunk/src/librt/primitives/brep/brep.cpp

Modified: brlcad/trunk/src/librt/primitives/brep/brep.cpp
===================================================================
--- brlcad/trunk/src/librt/primitives/brep/brep.cpp     2018-11-13 16:57:37 UTC 
(rev 72003)
+++ brlcad/trunk/src/librt/primitives/brep/brep.cpp     2018-11-13 19:24:36 UTC 
(rev 72004)
@@ -1189,7 +1189,7 @@
                _pt = ray.m_origin + (ray.m_dir * t[i]);
                VMOVE(vpt, _pt);
                if (face->m_bRev) {
-                   bu_log("Reversing normal for Face:%d\n", 
face->m_face_index);
+                   //bu_log("Reversing normal for Face:%d\n", 
face->m_face_index);
                    _norm.Reverse();
                }
                VMOVE(vnorm, _norm);
@@ -1457,6 +1457,23 @@
                            }
                        }
                    }
+               } else {
+                   prev = curr;
+                   prev--;
+                   brep_hit &prev_hit = (*prev);
+                   if ((curr_hit.hit == brep_hit::CLEAN_HIT || curr_hit.hit == 
brep_hit::NEAR_HIT) && prev_hit.hit == brep_hit::NEAR_MISS) {
+                       if (curr_hit.direction == brep_hit::ENTERING) {
+                           if (debug_output > 2) {
+                               bu_log("Removing only remaining near miss (face 
%d)\n", prev_hit.face.m_face_index);
+                           }
+                           (void)hits.erase(prev);
+                       } else {
+                           if (debug_output) {
+                               bu_log("Clean hit is an exit, but we have an 
unculled near miss behind it - promote to a crack hit\n");
+                           }
+                           prev_hit.hit = brep_hit::CRACK_HIT;
+                       }
+                   }
                }
            }
            curr++;

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



_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to