[MOAB-dev] commit/MOAB: iulian07: fix vtk polydata reader

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Jul 1 13:15:33 CDT 2014


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/b6592ff6ee49/
Changeset:   b6592ff6ee49
Branch:      iulian07/vtk_polydata
User:        iulian07
Date:        2014-07-01 20:13:54
Summary:     fix vtk polydata reader

issue found by Huayi Wei.

Also, mbsize for polygon mesh was reporting not a number , because
indexing in polygons error

Affected #:  2 files

diff --git a/src/io/ReadVtk.cpp b/src/io/ReadVtk.cpp
index 2936a85..53d307a 100644
--- a/src/io/ReadVtk.cpp
+++ b/src/io/ReadVtk.cpp
@@ -685,7 +685,7 @@ ErrorCode ReadVtk::vtk_read_polygons( FileTokenizer& tokens,
     
     if (prev +1 != handle) {
       if (first) { // true except for first iteration (first == 0)
-        if (first < elem_list.back().front()) // only need new range if order would get mixed up
+        if ( elem_list.empty() || first < elem_list.back().front()) // only need new range if order would get mixed up, or we just begun inserting
           elem_list.push_back( empty );
         elem_list.back().insert( first, prev );
       }
@@ -694,7 +694,7 @@ ErrorCode ReadVtk::vtk_read_polygons( FileTokenizer& tokens,
     prev = handle;
   }
   if (first) { // true unless no elements (size[0] == 0)
-    if (first < elem_list.back().front()) // only need new range if order would get mixed up
+    if (elem_list.empty() || first < elem_list.back().front()) // only need new range if order would get mixed up, or we just begun inserting
       elem_list.push_back( empty );
     elem_list.back().insert( first, prev );
   }

diff --git a/tools/size.cpp b/tools/size.cpp
index 7d4311d..737fb00 100644
--- a/tools/size.cpp
+++ b/tools/size.cpp
@@ -169,7 +169,7 @@ static ErrorCode gather_set_stats( EntityHandle set, set_stats& stats )
         {
           if (type == MBPOLYGON) {
             edge_vtx_idx[0] = e;
-            edge_vtx_idx[1] = e+1;
+            edge_vtx_idx[1] = (e+1)%num_edges;
           }
           else
             CN::SubEntityVertexIndices( type, 1, e, edge_vtx_idx );

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list