mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 11:18:18 +00:00
Don't assign material as style when it doesn't have any styles #6314
This commit is contained in:
@@ -126,11 +126,13 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_represe
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (single_material) {
|
if (single_material) {
|
||||||
auto s = taxonomy::cast<taxonomy::style>(mapping_->map(single_material));
|
if (auto itm = mapping_->map(single_material)) {
|
||||||
for (auto it = shapes.begin(); it != shapes.end(); ++it) {
|
auto s = taxonomy::cast<taxonomy::style>(itm);
|
||||||
if (!it->hasStyle() && s) {
|
for (auto it = shapes.begin(); it != shapes.end(); ++it) {
|
||||||
it->setStyle(s);
|
if (!it->hasStyle() && s) {
|
||||||
material_style_applied = true;
|
it->setStyle(s);
|
||||||
|
material_style_applied = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -556,6 +556,10 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcMaterial* material) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When material does not have a representation we don't create a style from it
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
/*
|
||||||
taxonomy::style::ptr material_style = taxonomy::make<taxonomy::style>();
|
taxonomy::style::ptr material_style = taxonomy::make<taxonomy::style>();
|
||||||
material_style->instance = material;
|
material_style->instance = material;
|
||||||
if (settings_.get<settings::UseMaterialNames>().get()) {
|
if (settings_.get<settings::UseMaterialNames>().get()) {
|
||||||
@@ -566,6 +570,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcMaterial* material) {
|
|||||||
material_style->name = oss.str();
|
material_style->name = oss.str();
|
||||||
}
|
}
|
||||||
return material_style;
|
return material_style;
|
||||||
|
*/
|
||||||
|
|
||||||
// @todo
|
// @todo
|
||||||
// IfcGeom::SurfaceStyle material_style = IfcGeom::SurfaceStyle(material->data().id(), material->Name());
|
// IfcGeom::SurfaceStyle material_style = IfcGeom::SurfaceStyle(material->data().id(), material->Name());
|
||||||
|
|||||||
Reference in New Issue
Block a user