[MOAB-dev] r4742 - in MOAB/trunk/src: . moab

iulian at mcs.anl.gov iulian at mcs.anl.gov
Fri Apr 15 01:41:40 CDT 2011


Author: iulian
Date: 2011-04-15 01:41:39 -0500 (Fri, 15 Apr 2011)
New Revision: 4742

Modified:
   MOAB/trunk/src/FBEngine.cpp
   MOAB/trunk/src/moab/FBEngine.hpp
Log:
second iteration in splitting a mesh-based face
split is now successful, new faces have to be created before deleting 
affected triangles and moving the new intersection points closer to the smooth
surface
one bug was due to the fact that in my version of gcc, (-1)%3 is -1
in python, this is 2; maybe a bug in gcc
I avoided it by adding a 3 ( using x%3 = (x+3)%3 )



Modified: MOAB/trunk/src/FBEngine.cpp
===================================================================
--- MOAB/trunk/src/FBEngine.cpp	2011-04-15 03:56:13 UTC (rev 4741)
+++ MOAB/trunk/src/FBEngine.cpp	2011-04-15 06:41:39 UTC (rev 4742)
@@ -1115,7 +1115,7 @@
   // use a fill to determine the new sets, up to the polyline
   // points on the polyline will be moved to the closest point location, with some constraints
   // then the sets will be reset, geometry recomputed. new vertices, new edges, etc.
-  int num_points = (int) points.size();
+  int num_points = (int) points.size()/3;
   // if first point is the same as last point, we have a loop for cropping
   // otherwise, we have a trimming line for splitting
 
@@ -1160,8 +1160,8 @@
     }
     else // if (et2==MBEDGE || et2==MBTRI)
     {
-      double coord_vert[3] = { points[3 * i], points[3 * i + 1], points[3 * i
-          + 2] };
+      double coord_vert[3] = { points[3 * i+3], points[3 * i + 4], points[3 * i
+          + 5] };
       EntityHandle newVertex;
       rval = _mbImpl->create_vertex(coord_vert, newVertex);
       MBERRORR(rval, "can't create vertex");
@@ -1239,6 +1239,26 @@
 
   return MB_SUCCESS;
 }
+void FBEngine::print_debug_triangle(EntityHandle t)
+{
+  std::cout<< " triangle id:" << _mbImpl->id_from_handle(t) << "\n";
+  const EntityHandle * conn3;
+  int nnodes;
+  _mbImpl->get_connectivity(t, conn3, nnodes);
+  // get coords
+  CartVect P[3];
+  _mbImpl->get_coords(conn3, 3, (double*) &P[0]);
+  std::cout <<"  nodes:" << conn3[0] << " " << conn3[1] << " " << conn3[2] << "\n";
+  CartVect PP[3];
+  PP[0] = P[1]-P[0];
+  PP[1] = P[2]-P[1];
+  PP[2] = P[0] - P[2];
+
+  std::cout <<"  pos:" <<  P[0] << " " << P[1] << " " << P[2] << "\n";
+  std::cout <<"   x,y diffs " <<  PP[0][0] <<" " << PP[0][1]  << ",  " << PP[1][0] <<" " << PP[1][1]
+                   << ",  " << PP[2][0] <<" " << PP[2][1]  << "\n";
+  return;
+}
 // actual breaking of triangles
 // case 1: n2 interior to triangle
 ErrorCode FBEngine::BreakTriangle(EntityHandle tri, EntityHandle e1, EntityHandle e3, EntityHandle n1,


More information about the moab-dev mailing list