diff --git a/libsrc/csg/identify.cpp b/libsrc/csg/identify.cpp index 8e5b8923..95a6bb13 100644 --- a/libsrc/csg/identify.cpp +++ b/libsrc/csg/identify.cpp @@ -1274,6 +1274,7 @@ BuildSurfaceElements (Array & segs, if (nst1 * dvec < 0) continue; Element2d el(s1[0], s1[1], s2[0], s2[1]); + el.SetIndex(s1.si); Vec<3> n = Cross (mesh[el[1]] - mesh[el[0]], mesh[el[3]] - mesh[el[0]]); diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index bc79a563..13177eba 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -314,7 +314,7 @@ namespace netgen SurfaceElementIndex si = surfelements.Size(); surfelements.Append (el); - if (el.index > facedecoding.Size()) + if (el.index<=0 || el.index > facedecoding.Size()) cerr << "has no facedecoding: fd.size = " << facedecoding.Size() << ", ind = " << el.index << endl; surfelements.Last().next = facedecoding[el.index-1].firstelement;