Revision: 56497
          http://sourceforge.net/p/brlcad/code/56497
Author:   phoenixyjll
Date:     2013-08-03 08:43:33 +0000 (Sat, 03 Aug 2013)
Log Message:
-----------
More powerful error handling - try another two options if the mid point is not 
sufficient.

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

Modified: brlcad/trunk/src/libbrep/intersect.cpp
===================================================================
--- brlcad/trunk/src/libbrep/intersect.cpp      2013-08-03 01:48:15 UTC (rev 
56496)
+++ brlcad/trunk/src/libbrep/intersect.cpp      2013-08-03 08:43:33 UTC (rev 
56497)
@@ -2988,11 +2988,18 @@
        // The overlap region should be to the LEFT of that *m_curveA*.
        // (See opennurbs/opennurbs_x.h)
        double midA = x[i].m_curveA->Domain().Mid();
+       if (!x[i].m_curveA->IsContinuous(ON::G1_continuous, midA)) {
+           // using the middle point is not suffient, we try another options.
+           midA = x[i].m_curveA->Domain().NormalizedParameterAt(1.0/3.0);
+           if (!x[i].m_curveA->IsContinuous(ON::G1_continuous, midA)) {
+               midA = x[i].m_curveA->Domain().NormalizedParameterAt(2.0/3.0);
+           }
+       }
        ON_3dVector normalA = ON_CrossProduct(ON_3dVector::ZAxis, 
x[i].m_curveA->TangentAt(midA));
        ON_3dPoint left_ptA, right_ptA, mid_ptA;
        mid_ptA = x[i].m_curveA->PointAt(midA);
-       left_ptA = mid_ptA + 
normalA*x[i].m_curveA->BoundingBox().Diagonal().Length();
-       right_ptA = mid_ptA - 
normalA*x[i].m_curveA->BoundingBox().Diagonal().Length();
+       left_ptA = mid_ptA + 
normalA*(1+x[i].m_curveA->BoundingBox().Diagonal().Length());
+       right_ptA = mid_ptA - 
normalA*(1+x[i].m_curveA->BoundingBox().Diagonal().Length());
        // should be outside the closed region
        ON_LineCurve linecurve1(mid_ptA, left_ptA), linecurve2(mid_ptA, 
right_ptA);
        ON_SimpleArray<ON_X_EVENT> x_event1, x_event2;

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


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to