Fix creating representation with inherited materials

It should be considered as inherited material can also have a style.
Though occurrence's material is still prioritized.
This commit is contained in:
Andrej730
2024-06-18 13:51:03 +05:00
committed by Andrej
parent 882e0a4ae9
commit 301cdf6504
4 changed files with 26 additions and 2 deletions
+7
View File
@@ -107,6 +107,13 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_represe
bool material_style_applied = false;
auto single_material = mapping_->get_single_material_association(product);
if (!single_material) {
auto type_product = mapping_->get_product_type(product);
if (type_product) {
single_material = mapping_->get_single_material_association(type_product);
}
}
if (single_material) {
auto s = taxonomy::cast<taxonomy::style>(mapping_->map(single_material));
for (auto it = shapes.begin(); it != shapes.end(); ++it) {