[MOAB-dev] r5326 - in MOAB/trunk: src test

iulian at mcs.anl.gov iulian at mcs.anl.gov
Fri Jan 20 08:24:08 CST 2012


Author: iulian
Date: 2012-01-20 08:24:05 -0600 (Fri, 20 Jan 2012)
New Revision: 5326

Modified:
   MOAB/trunk/src/FBEngine.cpp
   MOAB/trunk/test/crop_vol_test.cpp
   MOAB/trunk/test/mbfacet_test.cpp
   MOAB/trunk/test/mbground_test.cpp
Log:
Modify the splitting logic, so the boundary edges will always have to be
crossed by the polyline. In other words, the polyline has to end outside of 
the face that is splitted by a "grounding line" type.
Cropping will always involve a loop completely inside a face.
Also, pass the min_dot parameter to tests, so the topology can be kept
at a minimum 


Modified: MOAB/trunk/src/FBEngine.cpp
===================================================================
--- MOAB/trunk/src/FBEngine.cpp	2012-01-19 17:19:26 UTC (rev 5325)
+++ MOAB/trunk/src/FBEngine.cpp	2012-01-20 14:24:05 UTC (rev 5326)
@@ -1216,6 +1216,13 @@
       CartVect perpDir = dirct*normPlane;
       Range::iterator ite=boundary_mesh_edges.begin();
       // do a linear search for the best intersection point position (on a boundary edge)
+      if (debug_splits)
+      {
+        std::cout << " p1:" << p1 <<"\n";
+        std::cout << " p2:" << p2 <<"\n";
+        std::cout << " perpDir:" << perpDir << "\n";
+        std::cout<<" boundary edges size:" << boundary_mesh_edges.size() << "\n";
+      }
       for ( ; ite!=boundary_mesh_edges.end(); ite++)
       {
         EntityHandle candidateEdge = *ite;
@@ -1230,12 +1237,18 @@
         double parPos;
         bool intersect = intersect_segment_and_plane_slice(pts[0], pts[1],
             p1, p2, dirct, normPlane, intx_point,  parPos);
+        if (debug_splits)
+        {
+          std::cout << "   Edge:" << _mbImpl->id_from_handle(candidateEdge)<<"\n";
+          std::cout << "   Node 1:" << _mbImpl->id_from_handle(conn2[0]) << pts[0] <<"\n";
+          std::cout << "   Node 2:" << _mbImpl->id_from_handle(conn2[1]) << pts[1] <<"\n";
+          std::cout << "    Intersect bool:" << intersect << "\n";
+        }
         if (intersect)
         {
           double proj1 = (intx_point-p1)%perpDir;
           double proj2 = (intx_point-p2)%perpDir;
-          if ( (proj1*proj2>0) // this means outside of the imaginary p1 - p2 segment in xy plane
-                 &&
+          if (
                 ( fabs(proj1) > fabs(proj2) ) // this means it is closer to p2 than p1
               )
             continue; // basically, this means the intersection point is with a

Modified: MOAB/trunk/test/crop_vol_test.cpp
===================================================================
--- MOAB/trunk/test/crop_vol_test.cpp	2012-01-19 17:19:26 UTC (rev 5325)
+++ MOAB/trunk/test/crop_vol_test.cpp	2012-01-20 14:24:05 UTC (rev 5326)
@@ -30,7 +30,7 @@
 std::string filename_top;
 std::string filename_bot;
 std::string polygon_file_name;
-
+double min_dot = 0.8;
 std::string vol_file;


More information about the moab-dev mailing list