From 458ade64e6a9607e1973cf7af0f9568e091f11ad Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Wed, 20 Oct 2021 09:23:01 +0200 Subject: [PATCH 1/2] fix occ shape names in Load from step --- libsrc/occ/occgeom.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libsrc/occ/occgeom.cpp b/libsrc/occ/occgeom.cpp index 5d33eb19..cb3af3aa 100644 --- a/libsrc/occ/occgeom.cpp +++ b/libsrc/occ/occgeom.cpp @@ -1578,6 +1578,7 @@ namespace netgen timer_getnames.Start(); + occgeo->snames.SetSize(occgeo->somap.Size()); for (exp0.Init(occgeo->shape, TopAbs_SOLID); exp0.More(); exp0.Next()) { TopoDS_Solid solid = TopoDS::Solid(exp0.Current()); @@ -1586,25 +1587,28 @@ namespace netgen name = shape_names[solid.TShape()]; if (name == "") name = string("domain_") + ToString(occgeo->snames.Size()); - occgeo->snames.Append(name); + occgeo->snames[occgeo->somap.FindIndex(solid)-1] = name; } + occgeo->fnames.SetSize(fmap.Size()); + occgeo->enames.SetSize(emap.Size()); for (exp0.Init(occgeo->shape, TopAbs_FACE); exp0.More(); exp0.Next()) { TopoDS_Face face = TopoDS::Face(exp0.Current()); // name = STEP_GetEntityName(face,&reader); // cout << "getname = " << name << ", mapname = " << shape_names[face.TShape()] << endl; name = shape_names[face.TShape()]; + auto index = occgeo->fmap.FindIndex(face); if (name == "") - name = string("bc_") + ToString(occgeo->fnames.Size()); - occgeo->fnames.Append(name); + name = string("bc_") + ToString(index); + occgeo->fnames[index-1] = name; for (exp1.Init(face, TopAbs_EDGE); exp1.More(); exp1.Next()) { TopoDS_Edge edge = TopoDS::Edge(exp1.Current()); // name = STEP_GetEntityName(edge,&reader); // cout << "getname = " << name << ", mapname = " << shape_names[edge.TShape()] << endl; name = shape_names[edge.TShape()]; - occgeo->enames.Append(name); + occgeo->enames[occgeo->emap.FindIndex(edge)-1] = name; } } timer_getnames.Stop(); From e662449b69ce544fe3795d90b70f3fdfa8c3b255 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Wed, 20 Oct 2021 09:26:15 +0200 Subject: [PATCH 2/2] fix copy paste error --- libsrc/occ/occgeom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/occ/occgeom.cpp b/libsrc/occ/occgeom.cpp index cb3af3aa..ec37e424 100644 --- a/libsrc/occ/occgeom.cpp +++ b/libsrc/occ/occgeom.cpp @@ -1590,8 +1590,8 @@ namespace netgen occgeo->snames[occgeo->somap.FindIndex(solid)-1] = name; } - occgeo->fnames.SetSize(fmap.Size()); - occgeo->enames.SetSize(emap.Size()); + occgeo->fnames.SetSize(occgeo->fmap.Size()); + occgeo->enames.SetSize(occgeo->emap.Size()); for (exp0.Init(occgeo->shape, TopAbs_FACE); exp0.More(); exp0.Next()) { TopoDS_Face face = TopoDS::Face(exp0.Current());