mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 03:14:23 +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) {
|
||||
auto s = taxonomy::cast<taxonomy::style>(mapping_->map(single_material));
|
||||
for (auto it = shapes.begin(); it != shapes.end(); ++it) {
|
||||
if (!it->hasStyle() && s) {
|
||||
it->setStyle(s);
|
||||
material_style_applied = true;
|
||||
if (auto itm = mapping_->map(single_material)) {
|
||||
auto s = taxonomy::cast<taxonomy::style>(itm);
|
||||
for (auto it = shapes.begin(); it != shapes.end(); ++it) {
|
||||
if (!it->hasStyle() && s) {
|
||||
it->setStyle(s);
|
||||
material_style_applied = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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>();
|
||||
material_style->instance = material;
|
||||
if (settings_.get<settings::UseMaterialNames>().get()) {
|
||||
@@ -566,6 +570,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcMaterial* material) {
|
||||
material_style->name = oss.str();
|
||||
}
|
||||
return material_style;
|
||||
*/
|
||||
|
||||
// @todo
|
||||
// IfcGeom::SurfaceStyle material_style = IfcGeom::SurfaceStyle(material->data().id(), material->Name());
|
||||
|
||||
Reference in New Issue
Block a user