Revision: 45532
          http://brlcad.svn.sourceforge.net/brlcad/?rev=45532&view=rev
Author:   brlcad
Date:     2011-07-18 21:37:07 +0000 (Mon, 18 Jul 2011)

Log Message:
-----------
fixed a bug in NURBS plot where it was getting stuck in an infinite loop due to 
hitting an edge case where our v estimate for a given u was _exactly_ hitting 
the test point causing subsequent tests to repeatedly test the same point over 
and over.  this edge case is actually a happy done-with-function case so we can 
just return the precise v value.

Modified Paths:
--------------
    brlcad/trunk/NEWS
    brlcad/trunk/src/librt/opennurbs_ext.h

Modified: brlcad/trunk/NEWS
===================================================================
--- brlcad/trunk/NEWS   2011-07-18 21:23:26 UTC (rev 45531)
+++ brlcad/trunk/NEWS   2011-07-18 21:37:07 UTC (rev 45532)
@@ -9,15 +9,16 @@
 descriptive text that emphasizes or further describes significant
 changes made.  See document footer for additional details.
 
------------------------------------------------------------------------
+----------------------------------------------------------------------
 --- 2011-07-XX  Release 7.20.4                                     ---
 ----------------------------------------------------------------------
 
+* fixed infinite loop bug plotting NURBS wireframes - Sean Morrison
 * added ringworld proc-db - Erik Greenwald
 * fixed mged Manual page item in help menu - Brandon Hinesley
 
 
----------------------------------------------------------------------
+----------------------------------------------------------------------
 --- 2011-07-01  Release 7.20.2                                     ---
 ----------------------------------------------------------------------
 

Modified: brlcad/trunk/src/librt/opennurbs_ext.h
===================================================================
--- brlcad/trunk/src/librt/opennurbs_ext.h      2011-07-18 21:23:26 UTC (rev 
45531)
+++ brlcad/trunk/src/librt/opennurbs_ext.h      2011-07-18 21:37:07 UTC (rev 
45532)
@@ -541,6 +541,12 @@
     while (du > 0.05) {
        guess = Ta + dT/2;
        p = m_trim->PointAt(guess);
+
+       if (UNLIKELY(NEAR_EQUAL(p[X], u, SMALL_FASTF))) {
+           /* hit 'u' exactly, done deal */
+           return p[Y];
+       }
+
        if (p[X] < u) {
            Ta = guess;
            VMOVE(A, p);


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

------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to