Revision: 73897
          http://sourceforge.net/p/brlcad/code/73897
Author:   starseeker
Date:     2019-09-11 22:34:43 +0000 (Wed, 11 Sep 2019)
Log Message:
-----------
Adjustments to surface point insertion.

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

Modified: brlcad/trunk/src/libbrep/cdt.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt.cpp    2019-09-11 22:12:06 UTC (rev 73896)
+++ brlcad/trunk/src/libbrep/cdt.cpp    2019-09-11 22:34:43 UTC (rev 73897)
@@ -611,9 +611,6 @@
        tol_linear_edges_split(s_cdt);
 #endif
 
-#if 0
-       // TODO - this step may be redundant with the close_edge refinement...
-       //
        // Split singularity trims in 2D to provide an easier input to the 2D 
CDT logic.  NOTE: these
        // splits will produce degenerate (zero area, two identical vertex) 
triangles in 3D that have
        // to be cleaned up.
@@ -634,7 +631,7 @@
                    while (!wq->empty()) {
                        cdt_mesh::cpolyedge_t *ce = wq->front();
                        wq->pop();
-                       std::set<cdt_mesh::cpolyedge_t *> nedges = 
split_singular_seg(s_cdt, ce);
+                       std::set<cdt_mesh::cpolyedge_t *> nedges = 
split_singular_seg(s_cdt, ce, 0);
                        std::set<cdt_mesh::cpolyedge_t *>::iterator n_it;
                        for (n_it = nedges.begin(); n_it != nedges.end(); 
n_it++) {
                            nq->push(*n_it);
@@ -644,7 +641,6 @@
                }
            }
        }
-#endif
 
        // Rebuild finalized 2D RTrees for faces (needed for surface processing)
        finalize_rtrees(s_cdt);

Modified: brlcad/trunk/src/libbrep/cdt_surf.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt_surf.cpp       2019-09-11 22:12:06 UTC (rev 
73896)
+++ brlcad/trunk/src/libbrep/cdt_surf.cpp       2019-09-11 22:34:43 UTC (rev 
73897)
@@ -504,7 +504,7 @@
        a_context.use = &include_pnt;
 
        double dlen = tseg->bb.Diagonal().Length();
-       dlen = 0.01 * dlen;
+       dlen = 0.1 * dlen;
        double px = tseg->spnt.x + (bn_rand_half(prand) * dlen);
        double py = tseg->spnt.y + (bn_rand_half(prand) * dlen);
 
@@ -1089,12 +1089,25 @@
            tMax[0] = (*b_it)->Max().x;
            tMax[1] = (*b_it)->Max().y;
            size_t nhits = sinfo.rtree_trim_spnts_2d.Search(tMin, tMax, NULL, 
NULL);
+           tMin[0] = px - ON_ZERO_TOLERANCE;
+           tMin[1] = py - ON_ZERO_TOLERANCE;
+           tMin[0] = px + ON_ZERO_TOLERANCE;
+           tMin[1] = py + ON_ZERO_TOLERANCE;
+           size_t tboxhits = sinfo.rtree_2d->Search(tMin, tMax, NULL, NULL);
+           {
+               struct bu_vls fname = BU_VLS_INIT_ZERO;
+               bu_vls_sprintf(&fname, "%d-surf_rtree.plot3", 
sinfo.f->m_face_index);
+               
plot_rtree_2d2(sinfo.s_cdt->face_rtrees_2d[sinfo.f->m_face_index], 
bu_vls_cstr(&fname));
+               bu_vls_free(&fname);
 
-           if (!nhits) {
+           }
+
+
+           if (!nhits && !tboxhits) {
                sinfo.on_surf_points.insert(new ON_2dPoint(px,py));
                std::cout << "accept pnt\n";
            } else {
-               std::cout << "reject - already have trim point in here\n";
+               std::cout << "reject - already have trim point in patch or 
point is in trim box\n";
            }
        }
 

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