Revision: 52568
          http://brlcad.svn.sourceforge.net/brlcad/?rev=52568&view=rev
Author:   brlcad
Date:     2012-09-27 04:42:35 +0000 (Thu, 27 Sep 2012)
Log Message:
-----------
should achieve the same effect to call Length() instead of IsSingleton() and 
with considerably less computation.  also allows ON_Interval to remain 
unmodified.

Modified Paths:
--------------
    brlcad/trunk/src/libnurbs/opennurbs_ext.cpp

Modified: brlcad/trunk/src/libnurbs/opennurbs_ext.cpp
===================================================================
--- brlcad/trunk/src/libnurbs/opennurbs_ext.cpp 2012-09-26 21:56:31 UTC (rev 
52567)
+++ brlcad/trunk/src/libnurbs/opennurbs_ext.cpp 2012-09-27 04:42:35 UTC (rev 
52568)
@@ -225,7 +225,7 @@
                for (int knot_index = 1; knot_index <= knotcnt; knot_index++) {
                    ON_Interval range(knots[knot_index - 1], knots[knot_index]);
 
-                   if(!range.IsSingleton())
+                   if (range.Length() > TOL)
                        getHVTangents(trimCurve, range, splitlist);
                }
                for (std::list<double>::iterator l = splitlist.begin(); l != 
splitlist.end(); l++) {
@@ -477,9 +477,9 @@
            double midpoint = (t[1]+t[0])/2.0;
            ON_Interval left(t[0], midpoint);
            ON_Interval right(midpoint, t[1]);
-            if(!left.IsSingleton())
+            if (left.Length() > TOL)
                getHVTangents(curve, left, list);
-            if(!right.IsSingleton())
+            if (right.Length() > TOL)
                getHVTangents(curve, right, list);
            return true;
        } else if (tanx_changed) {//find horz
@@ -517,9 +517,9 @@
            double midpoint = (t[1]+t[0])/2.0;
            ON_Interval left(t[0], midpoint);
            ON_Interval right(midpoint, t[1]);
-           if(!left.IsSingleton())
+           if (left.Length() > TOL)
                getHVTangents(curve, left, list);
-           if(!right.IsSingleton())
+           if (right.Length() > TOL)
                getHVTangents(curve, right, list);
            return true;
        }

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


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to