Revision: 74697
          http://sourceforge.net/p/brlcad/code/74697
Author:   starseeker
Date:     2020-01-15 17:13:29 +0000 (Wed, 15 Jan 2020)
Log Message:
-----------
Don't need to do inside/outside test twice

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

Modified: brlcad/trunk/src/libbrep/cdt/tri_isect.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt/tri_isect.cpp  2020-01-15 15:45:05 UTC (rev 
74696)
+++ brlcad/trunk/src/libbrep/cdt/tri_isect.cpp  2020-01-15 17:13:29 UTC (rev 
74697)
@@ -494,24 +494,22 @@
                ON_Line l = t1_fedges[i];
                ON_3dPoint lmid = l.PointAt(0.5);
                struct ON_Brep_CDT_State *s_cdt = (struct ON_Brep_CDT_State 
*)fmesh2->p_cdt;
+               // TODO - need some distance metric here - ON the mesh is fine, 
to within tolerance...
+               // The below is a start, but the correct mesh for the closest 
distance to the
+               // surface may not be fmesh2...  Need a s_cdt level 
closest_surf_pnt function
                if (on_point_inside(s_cdt, &lmid)) {
-                   // TODO - need some distance metric here - ON the mesh is 
fine, to within tolerance...
-                   // The below is a start, but the correct mesh for the 
closest distance to the
-                   // surface may not be fmesh2...  Need a s_cdt level 
closest_surf_pnt function
-                   if (on_point_inside(s_cdt, &lmid)) {
-                       ON_3dPoint bs_p;
-                       bool cpeval = 
fmesh2->omesh->closest_brep_mesh_point(bs_p, &lmid, s_cdt);
-                       if (!cpeval) {
-                           std::cout << "Error - couldn't find closest point 
for mesh\n";
-                           continue;
-                       }
-                       //std::cout << "lmin_dist_to_sp vs elen_min: " << 
lmid.DistanceTo(bs_p) << "," << 0.001*elen_min << "\n";
+                   ON_3dPoint bs_p;
+                   bool cpeval = fmesh2->omesh->closest_brep_mesh_point(bs_p, 
&lmid, s_cdt);
+                   if (!cpeval) {
+                       std::cout << "Error - couldn't find closest point for 
mesh\n";
+                       continue;
+                   }
+                   //std::cout << "lmin_dist_to_sp vs elen_min: " << 
lmid.DistanceTo(bs_p) << "," << 0.001*elen_min << "\n";
 
-                       if (lmid.DistanceTo(bs_p) > BN_TOL_DIST) {
-                           //std::cout << "center " << lmid.x << "," << lmid.y 
<< "," << lmid.z << "\n";
-                           //std::cout << s_cdt->name << " dist: " << 
lmid.DistanceTo(bs_p) << "\n";
-                           mid_inside_cnt++;
-                       }
+                   if (lmid.DistanceTo(bs_p) > BN_TOL_DIST) {
+                       //std::cout << "center " << lmid.x << "," << lmid.y << 
"," << lmid.z << "\n";
+                       //std::cout << s_cdt->name << " dist: " << 
lmid.DistanceTo(bs_p) << "\n";
+                       mid_inside_cnt++;
                    }
                }
            }
@@ -519,22 +517,20 @@
                ON_Line l = t2_fedges[i];
                ON_3dPoint lmid = l.PointAt(0.5);
                struct ON_Brep_CDT_State *s_cdt = (struct ON_Brep_CDT_State 
*)fmesh1->p_cdt;
+               // TODO - need some distance metric here - ON the mesh is fine, 
to within tolerance...
                if (on_point_inside(s_cdt, &lmid)) {
-                   // TODO - need some distance metric here - ON the mesh is 
fine, to within tolerance...
-                   if (on_point_inside(s_cdt, &lmid)) {
-                       ON_3dPoint bs_p;
-                       bool cpeval = 
fmesh1->omesh->closest_brep_mesh_point(bs_p, &lmid, s_cdt);
-                       if (!cpeval) {
-                           std::cout << "Error - couldn't find closest point 
for mesh\n";
-                           continue;
-                       }
-                       //std::cout << "lmin_dist_to_sp vs elen_min: " << 
lmid.DistanceTo(bs_p) << "," << 0.001*elen_min << "\n";
+                   ON_3dPoint bs_p;
+                   bool cpeval = fmesh1->omesh->closest_brep_mesh_point(bs_p, 
&lmid, s_cdt);
+                   if (!cpeval) {
+                       std::cout << "Error - couldn't find closest point for 
mesh\n";
+                       continue;
+                   }
+                   //std::cout << "lmin_dist_to_sp vs elen_min: " << 
lmid.DistanceTo(bs_p) << "," << 0.001*elen_min << "\n";
 
-                       if (lmid.DistanceTo(bs_p) > BN_TOL_DIST) {
-                           //std::cout << "center " << lmid.x << "," << lmid.y 
<< "," << lmid.z << "\n";
-                           //std::cout << s_cdt->name << " dist: " << 
lmid.DistanceTo(bs_p) << "\n";
-                           mid_inside_cnt++;
-                       }
+                   if (lmid.DistanceTo(bs_p) > BN_TOL_DIST) {
+                       //std::cout << "center " << lmid.x << "," << lmid.y << 
"," << lmid.z << "\n";
+                       //std::cout << s_cdt->name << " dist: " << 
lmid.DistanceTo(bs_p) << "\n";
+                       mid_inside_cnt++;
                    }
                }
            }

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