Revision: 74687
          http://sourceforge.net/p/brlcad/code/74687
Author:   starseeker
Date:     2020-01-14 20:20:47 +0000 (Tue, 14 Jan 2020)
Log Message:
-----------
I think we want vert_closest here, but the vertex it's finding has a 
nonsensical bbox...

Modified Paths:
--------------
    brlcad/trunk/src/libbrep/cdt/ovlps.cpp

Modified: brlcad/trunk/src/libbrep/cdt/ovlps.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt/ovlps.cpp      2020-01-14 19:00:58 UTC (rev 
74686)
+++ brlcad/trunk/src/libbrep/cdt/ovlps.cpp      2020-01-14 20:20:47 UTC (rev 
74687)
@@ -54,7 +54,8 @@
     fclose(plot);
 }
 
-#define PPOINT 3.05501831768742305,7.50007628741969601,23.99999799973181069
+//#define PPOINT 23.75000091628566068,7.56415387307229370,4.69184016593825515
+#define PPOINT 23.249999993258228,8.311619640259547,5.3252579308096335
 bool
 PPCHECK(ON_3dPoint &p)
 {
@@ -602,7 +603,7 @@
        for (size_t i = 0; i < epnts.size(); i++) {
            bool skip_epnt = false;
 
-           //VPCHECK(epnts[i].ov, NULL);
+           VPCHECK(epnts[i].ov, NULL);
 
            ON_BoundingBox sbb(epnts[i].spnt,epnts[i].spnt);
            ON_3dVector vmin = epnts[i].ov->bb.Min() - epnts[i].ov->bb.Center();
@@ -614,22 +615,16 @@
            sbb.m_min = epnts[i].spnt + vmin;
            sbb.m_max = epnts[i].spnt + vmax;
 
-           std::set <overt_t *> nv = omesh->vert_search(sbb);
-           std::set<overt_t *>::iterator v_it;
-           for (v_it = nv.begin(); v_it != nv.end(); v_it++) {
 
-               ON_3dPoint cvpnt = (*v_it)->vpnt();
-               double cvbbdiag = (*v_it)->bb.Diagonal().Length() * 0.1;
-               if (cvpnt.DistanceTo(epnts[i].spnt) < cvbbdiag) {
-                   // Too close to a vertex in the current mesh, skip
-                   //std::cout << "skip epnt, too close to vert\n";
-                   skip_epnt = true;
-                   break;
-               }
-           }
-           if (skip_epnt) {
+           double vdist;
+           overt_t *v_closest = omesh->vert_closest(&vdist, epnts[i].spnt);
+           double cvbbdiag = v_closest->bb.Diagonal().Length() * 0.1;
+           if (vdist < cvbbdiag) {
+               // Too close to a vertex in the current mesh, skip
+               //std::cout << "skip epnt, too close to vert\n";
                continue;
            }
+
            // If the point is too close to a brep face edge,
            // we also need to reject it to avoid creating degenerate
            // triangles

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



_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to