From bd5a1b5bdaa9d793b2b6c9ebb30a8e2a6bf21ffb Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 30 Oct 2025 18:35:20 +0100 Subject: [PATCH] Account 2x3/4 differences in Shading/Rendering::Transparency() --- src/ifcgeom/mapping/mapping.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/mapping/mapping.cpp b/src/ifcgeom/mapping/mapping.cpp index 8c130aa5f6..f98bfe232d 100644 --- a/src/ifcgeom/mapping/mapping.cpp +++ b/src/ifcgeom/mapping/mapping.cpp @@ -670,12 +670,23 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSurfaceStyle* style) { if (rendering_style->TransmissionColour()) { // Not supported } +#ifndef SCHEMA_IfcSurfaceStyleShading_HAS_Transparency + // ifc2x3 if (rendering_style->Transparency()) { const double d = *rendering_style->Transparency(); surface_style->transparency = d; } +#endif } - + +#ifdef SCHEMA_IfcSurfaceStyleShading_HAS_Transparency + // ifc4 and onwards + if (shading->Transparency()) { + const double d = *shading->Transparency(); + surface_style->transparency = d; + } +#endif + return surface_style; }