diff --git a/src/ifcgeom/kernel_agnostic/AbstractKernel.cpp b/src/ifcgeom/kernel_agnostic/AbstractKernel.cpp index a7e5a5699b..92f1e5865d 100644 --- a/src/ifcgeom/kernel_agnostic/AbstractKernel.cpp +++ b/src/ifcgeom/kernel_agnostic/AbstractKernel.cpp @@ -34,6 +34,9 @@ bool ifcopenshell::geometry::kernels::AbstractKernel::convert_impl(const taxonom } for (auto i = s; i < r.size(); ++i) { r[i].prepend(collection->matrix); + if (!r[i].hasStyle()) { + r[i].setStyle(collection->surface_style); + } } return r.size() > s; } diff --git a/src/ifcgeom/schema/mapping.cpp b/src/ifcgeom/schema/mapping.cpp index a7e436a315..fc4f0f13bc 100644 --- a/src/ifcgeom/schema/mapping.cpp +++ b/src/ifcgeom/schema/mapping.cpp @@ -364,6 +364,14 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcProduct* inst) { auto c = new taxonomy::collection; c->matrix = as(map(inst->ObjectPlacement())); + const IfcSchema::IfcMaterial* single_material = get_single_material_association(inst); + if (single_material) { + auto material_style = map(single_material); + if (material_style) { + c->surface_style = as(material_style); + } + } + if (openings->size() && !settings_.get(settings::DISABLE_OPENING_SUBTRACTIONS) && use_body) { auto ci = c->matrix.components->inverse(); @@ -387,6 +395,7 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcProduct* inst) { return nullptr; } } + return c; }