From 5f202fd4eaa305a72fc2cae0a45c0499d1faa5e3 Mon Sep 17 00:00:00 2001 From: "mhochsteger@cerbsim.com" Date: Mon, 17 Jan 2022 10:02:11 +0100 Subject: [PATCH] clear geom data in OCCGeometry::BuildFMap() (fixes broken meshing after Heal()) --- libsrc/meshing/basegeom.cpp | 13 +++++++++++++ libsrc/meshing/basegeom.hpp | 1 + libsrc/occ/occgeom.cpp | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index ae4130c4..c2834d42 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -199,6 +199,19 @@ namespace netgen } }; + void NetgenGeometry :: Clear() + { + vertex_map.clear(); + edge_map.clear(); + face_map.clear(); + solid_map.clear(); + + vertices.SetSize0(); + edges.SetSize0(); + faces.SetSize0(); + solids.SetSize0(); + } + void NetgenGeometry :: ProcessIdentifications() { for(auto i : Range(vertices)) diff --git a/libsrc/meshing/basegeom.hpp b/libsrc/meshing/basegeom.hpp index d7371e2b..49bf8710 100644 --- a/libsrc/meshing/basegeom.hpp +++ b/libsrc/meshing/basegeom.hpp @@ -197,6 +197,7 @@ namespace netgen const GeometryFace & GetFace(int i) const { return *faces[i]; } + void Clear(); virtual int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam); diff --git a/libsrc/occ/occgeom.cpp b/libsrc/occ/occgeom.cpp index 1b245a7f..f6d38a2b 100644 --- a/libsrc/occ/occgeom.cpp +++ b/libsrc/occ/occgeom.cpp @@ -1107,6 +1107,12 @@ namespace netgen fsingular = esingular = vsingular = false; + NetgenGeometry::Clear(); + edge_map.clear(); + vertex_map.clear(); + face_map.clear(); + solid_map.clear(); + // Add shapes for(auto i1 : Range(1, vmap.Extent()+1)) {