diff --git a/src/ifcgeom/Converter.cpp b/src/ifcgeom/Converter.cpp index a9a1eb75ec..38ca41da1f 100644 --- a/src/ifcgeom/Converter.cpp +++ b/src/ifcgeom/Converter.cpp @@ -363,8 +363,13 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_process } IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_representation_and_product(const IfcUtil::IfcBaseEntity* representation, const IfcUtil::IfcBaseEntity* product) { + auto interpreted_representation = mapping_->map(representation); + if (!interpreted_representation) { + interpreted_representation = taxonomy::make(); + interpreted_representation->instance = representation; + } return create_brep_for_representation_and_product( - mapping_->map(representation), + interpreted_representation, product, taxonomy::cast(mapping_->map(product))->matrix ); diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index fe08541a6f..a987a3c473 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -724,7 +724,7 @@ struct ShapeRTTI : public boost::static_visitor typename Schema::IfcProductRepresentation* prodrep = product->Representation(); typename Schema::IfcRepresentation::list::ptr reps = prodrep->Representations(); - typename Schema::IfcRepresentation* ifc_representation = (typename Schema::IfcRepresentation*) representation; + typename Schema::IfcRepresentation* ifc_representation = representation->as(); if (!ifc_representation) { // First, try to find a representation based on the settings