Revision: 73818
          http://sourceforge.net/p/brlcad/code/73818
Author:   starseeker
Date:     2019-09-03 18:50:55 +0000 (Tue, 03 Sep 2019)
Log Message:
-----------
Only use the loop median lengths from associated non-planar surfaces.  This is 
still less than ideal for locality...

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

Modified: brlcad/trunk/src/libbrep/cdt2.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt2.cpp   2019-09-03 16:55:53 UTC (rev 73817)
+++ brlcad/trunk/src/libbrep/cdt2.cpp   2019-09-03 18:50:55 UTC (rev 73818)
@@ -431,8 +431,10 @@
     double max_allowed = (s_cdt->tol.absmax > ON_ZERO_TOLERANCE) ? 
s_cdt->tol.absmax : 1.1*bseg->cp_len;
     double min_allowed = (s_cdt->tol.rel > ON_ZERO_TOLERANCE) ? s_cdt->tol.rel 
* bseg->cp_len : 0.0;
     double max_edgept_dist_from_edge = (s_cdt->tol.abs > ON_ZERO_TOLERANCE) ? 
s_cdt->tol.abs : seg_len;
-    ON_BrepLoop *l1 = NULL;
-    ON_BrepLoop *l2 = NULL;
+    ON_BrepLoop *l1 = s_cdt->brep->m_T[bseg->tseg1->trim_ind].Loop();
+    ON_BrepLoop *l2 = s_cdt->brep->m_T[bseg->tseg2->trim_ind].Loop();
+    const ON_Surface *s1= l1->SurfaceOf();
+    const ON_Surface *s2= l2->SurfaceOf();
     double len_1 = -1;
     double len_2 = -1;
     double s_len;
@@ -447,11 +449,9 @@
            break;
        case 2:
            // Linear edge on non-planar surface - use the median segment 
lengths
-           // from the two trims associated with this edge
-           l1 = s_cdt->brep->m_T[bseg->tseg1->trim_ind].Loop();
-           l2 = s_cdt->brep->m_T[bseg->tseg2->trim_ind].Loop();
-           len_1 = s_cdt->l_median_len[l1->m_loop_index];
-           len_2 = s_cdt->l_median_len[l2->m_loop_index];
+           // from the trims from non-planar faces associated with this edge
+           len_1 = (!s1->IsPlanar(NULL, BN_TOL_DIST)) ? 
s_cdt->l_median_len[l1->m_loop_index] : -1;
+           len_2 = (!s2->IsPlanar(NULL, BN_TOL_DIST)) ? 
s_cdt->l_median_len[l2->m_loop_index] : -1;
            if (len_1 < 0 && len_2 < 0) {
                bu_log("Error - both loops report invalid median lengths\n");
                return false;

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



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to