File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,11 +126,13 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_represe
126126 }
127127
128128 if (single_material) {
129- auto s = taxonomy::cast<taxonomy::style>(mapping_->map (single_material));
130- for (auto it = shapes.begin (); it != shapes.end (); ++it) {
131- if (!it->hasStyle () && s) {
132- it->setStyle (s);
133- material_style_applied = true ;
129+ if (auto itm = mapping_->map (single_material)) {
130+ auto s = taxonomy::cast<taxonomy::style>(itm);
131+ for (auto it = shapes.begin (); it != shapes.end (); ++it) {
132+ if (!it->hasStyle () && s) {
133+ it->setStyle (s);
134+ material_style_applied = true ;
135+ }
134136 }
135137 }
136138 } else {
Original file line number Diff line number Diff line change @@ -556,6 +556,10 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcMaterial* material) {
556556 }
557557 }
558558
559+ // When material does not have a representation we don't create a style from it
560+ return nullptr ;
561+
562+ /*
559563 taxonomy::style::ptr material_style = taxonomy::make<taxonomy::style>();
560564 material_style->instance = material;
561565 if (settings_.get<settings::UseMaterialNames>().get()) {
@@ -566,6 +570,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcMaterial* material) {
566570 material_style->name = oss.str();
567571 }
568572 return material_style;
573+ */
569574
570575 // @todo
571576 // IfcGeom::SurfaceStyle material_style = IfcGeom::SurfaceStyle(material->data().id(), material->Name());
You can’t perform that action at this time.
0 commit comments