#1705 fixes for missing object placement

This commit is contained in:
Thomas Krijnen
2021-09-26 11:25:36 +02:00
parent 165966bc59
commit 39b1f4c477
+15 -7
View File
@@ -1941,7 +1941,9 @@ IfcGeom::BRepElement* IfcGeom::Kernel::create_brep_for_representation_and_produc
gp_Trsf trsf; gp_Trsf trsf;
try { try {
convert(product->ObjectPlacement(),trsf); if (product->ObjectPlacement()) {
convert(product->ObjectPlacement(), trsf);
}
} catch (const std::exception& e) { } catch (const std::exception& e) {
Logger::Error(e); Logger::Error(e);
} catch (...) { } catch (...) {
@@ -2205,7 +2207,9 @@ IfcGeom::BRepElement* IfcGeom::Kernel::create_brep_for_processed_representation(
gp_Trsf trsf; gp_Trsf trsf;
try { try {
convert(product->ObjectPlacement(),trsf); if (product->ObjectPlacement()) {
convert(product->ObjectPlacement(), trsf);
}
} catch (const std::exception& e) { } catch (const std::exception& e) {
Logger::Error(e); Logger::Error(e);
} catch (...) { } catch (...) {
@@ -2608,8 +2612,10 @@ bool IfcGeom::Kernel::fold_layers(const IfcSchema::IfcWall* wall, const IfcRepre
} }
gp_Trsf local; gp_Trsf local;
if (!convert(wall->ObjectPlacement(), local)) { if (wall->ObjectPlacement()) {
return false; if (!convert(wall->ObjectPlacement(), local)) {
return false;
}
} }
local.Invert(); local.Invert();
@@ -2710,9 +2716,11 @@ bool IfcGeom::Kernel::fold_layers(const IfcSchema::IfcWall* wall, const IfcRepre
const IfcSchema::IfcProduct* other_wall = it->second; const IfcSchema::IfcProduct* other_wall = it->second;
gp_Trsf other; gp_Trsf other;
if (!convert(other_wall->ObjectPlacement(), other)) { if (other_wall->ObjectPlacement()) {
Logger::Error("Failed to convert placement", other_wall); if (!convert(other_wall->ObjectPlacement(), other)) {
continue; Logger::Error("Failed to convert placement", other_wall);
continue;
}
} }
IfcSchema::IfcRepresentation* axis_representation = find_representation(other_wall, "Axis"); IfcSchema::IfcRepresentation* axis_representation = find_representation(other_wall, "Axis");