From 97f869207e17156976cc315ff25f6b8285b965eb Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Wed, 19 Mar 2025 08:58:49 +0100 Subject: [PATCH] fix colors from step read if they are set on solid for subshapes --- libsrc/occ/occgeom.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/libsrc/occ/occgeom.cpp b/libsrc/occ/occgeom.cpp index 9aeae9e0..303d2af2 100644 --- a/libsrc/occ/occgeom.cpp +++ b/libsrc/occ/occgeom.cpp @@ -2288,10 +2288,22 @@ namespace netgen XCAFPrs::CollectStyleSettings(label, loc, set); XCAFPrs_Style aStyle; set.FindFromKey(e.Current(), aStyle); - - auto & prop = OCCGeometry::GetProperties(e.Current()); if(aStyle.IsSetColorSurf()) - prop.col = step_utils::ReadColor(aStyle.GetColorSurfRGBA()); + { + for(TopExp_Explorer e2(e.Current(), TopAbs_FACE); e2.More(); e2.Next()) + { + auto & prop = OCCGeometry::GetProperties(e2.Current()); + prop.col = step_utils::ReadColor(aStyle.GetColorSurfRGBA()); + } + } + if(aStyle.IsSetColorCurv()) + { + for(TopExp_Explorer e2(e.Current(), TopAbs_EDGE); e2.More(); e2.Next()) + { + auto & prop = OCCGeometry::GetProperties(e2.Current()); + prop.col = step_utils::ReadColor(aStyle.GetColorSurfRGBA()); + } + } } // load names