From d7ffc68a300da687ce52b9c5624fc88517d99121 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Fri, 19 Jan 2024 08:07:57 +0100 Subject: [PATCH 1/2] add GetBackTrace to checksame --- libsrc/core/exception.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/core/exception.hpp b/libsrc/core/exception.hpp index cf068aaf..6cd5e4bf 100644 --- a/libsrc/core/exception.hpp +++ b/libsrc/core/exception.hpp @@ -95,7 +95,7 @@ namespace ngcore throw ngcore::Exception(__FILE__ ":" NETGEN_CORE_NGEXEPTION_STR(__LINE__) "\t: shape don't match"); } #define NETGEN_CHECK_SAME(a,b) \ { if(a != b) \ - throw ngcore::Exception(__FILE__ ":" NETGEN_CORE_NGEXEPTION_STR(__LINE__) "\t: not the same, a="+ToString(a) + ", b="+ToString(b)); } + throw ngcore::Exception(__FILE__ ":" NETGEN_CORE_NGEXEPTION_STR(__LINE__) "\t: not the same, a="+ToString(a) + ", b="+ToString(b) + GetBackTrace()); } #define NETGEN_NOEXCEPT #else // defined(NETGEN_ENABLE_CHECK_RANGE) && !defined(__CUDA_ARCH__) #define NETGEN_CHECK_RANGE(value, min, max) From 2024a67c743a221b26507e8e346f074bbf2ed8a4 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 22 Jan 2024 10:57:58 +0100 Subject: [PATCH 2/2] occ shapes _webgui_data - export color alpha values Also - don't create ShapeProperties objects for faces with default values - use default name/color from ShapeProperties --- libsrc/occ/python_occ_shapes.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 116788c1..bd265ca7 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -1233,20 +1233,14 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) // Handle(TopoDS_Face) face = e.Current(); fmap.Add(face); ExtractFaceData(face, index, p, n, box); - auto & props = OCCGeometry::GetProperties(face); - if(props.col) - { - auto & c = *props.col; - colors.append(py::make_tuple(c[0], c[1], c[2])); - } - else - colors.append(py::make_tuple(0.0, 1.0, 0.0)); - if(props.name) - { - names.append(*props.name); - } - else - names.append(""); + + ShapeProperties props; + if(OCCGeometry::HaveProperties(face)) + props = OCCGeometry::GetProperties(face); + + auto c = props.GetColor(); + colors.append(py::make_tuple(c[0], c[1], c[2], c[3])); + names.append(props.GetName()); index++; }