Revision: 55755
          http://sourceforge.net/p/brlcad/code/55755
Author:   indianlarry
Date:     2013-06-13 17:40:16 +0000 (Thu, 13 Jun 2013)
Log Message:
-----------
The newton solver iterates until it gets within a program specified closeness 
tolerance to the ray under consideration.  The UV parameters are then checked 
to determine if they are within the current surface subdivision bounding (SSB) 
box under evaluation. For rays close to the UV border the solver occasionally 
fails because it jumps slightly out of its current UV but within the ray 
closeness tolerance. These rays are usually picked up when evaluating the 
adjacent SSB but not always. To make sure these valid hit points aren't dropped 
I've added a slight tolerance (VUNITIZE_TOL) to the UV check. This fix is 
related to speckling picked up on raytraced images of implicit geometries 
converted to a BREP.

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     2013-06-13 17:02:11 UTC 
(rev 55754)
+++ brlcad/trunk/src/librt/primitives/brep/brep.cpp     2013-06-13 17:40:16 UTC 
(rev 55755)
@@ -788,10 +788,13 @@
        }
 
        if (rootdist < ROOT_TOL) {
-           if (sbv->m_u.Includes(uv.x) && sbv->m_v.Includes(uv.y)) {
+           int ulow = (sbv->m_u.m_t[0] <= sbv->m_u.m_t[1]) ? 0 : 1;
+           int vlow = (sbv->m_v.m_t[0] <= sbv->m_v.m_t[1]) ? 0 : 1;
+           if ((sbv->m_u.m_t[ulow]-VUNITIZE_TOL < uv.x && uv.x < 
sbv->m_u.m_t[1-ulow]+VUNITIZE_TOL) &&
+                   (sbv->m_v.m_t[vlow]-VUNITIZE_TOL < uv.y && uv.y < 
sbv->m_v.m_t[1-vlow]-VUNITIZE_TOL)) {
                bool new_point = true;
                for (int j=0;j<count;j++) {
-                   if (NEAR_EQUAL(uv.x, ouv[j].x, 0.0001) && NEAR_EQUAL(uv.y, 
ouv[j].y, 0.0001)) {
+                   if (NEAR_EQUAL(uv.x, ouv[j].x, VUNITIZE_TOL) && 
NEAR_EQUAL(uv.y, ouv[j].y, VUNITIZE_TOL)) {
                        new_point = false;
                    }
                }

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


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to