Ground work for processing opening placement up to parent wall

This commit is contained in:
Thomas Krijnen
2021-12-19 21:55:41 +01:00
parent 49c555c508
commit 03d4782cb7
4 changed files with 64 additions and 21 deletions
+20 -2
View File
@@ -1020,6 +1020,23 @@ bool IfcGeom::Kernel::convert_openings_fast(const IfcSchema::IfcProduct* entity,
if (fes->declaration().is(IfcSchema::IfcOpeningElement::Class())) {
if (!fes->Representation()) continue;
/*
// Not yet implemented and tested, process opening placement up to parent wall
// placement so that the matrix inverse can be eliminated.
// @todo property check and handle the decomposition into parts (where element
// carying geom and opening are in different branches).
// @todo properly check whether opening correctly references wall placement
// and fallback to matrix inverse when not the case.
auto relative = entity;
{
auto ds = relative->Decomposes();
if (ds->size() == 1) {
relative = (*ds->begin())->RelatingObject()->as<IfcSchema::IfcProduct>();
}
}
set_conversion_placement_rel_to_instance(relative);
*/
// Convert the IfcRepresentation of the IfcOpeningElement
gp_Trsf opening_trsf;
if (fes->ObjectPlacement()) {
@@ -1032,6 +1049,8 @@ bool IfcGeom::Kernel::convert_openings_fast(const IfcSchema::IfcProduct* entity,
}
}
// set_conversion_placement_rel_to_instance(nullptr);
// Move the opening into the coordinate system of the IfcProduct
opening_trsf.PreMultiply(entity_trsf.Inverted());
@@ -1102,8 +1121,7 @@ bool IfcGeom::Kernel::convert_openings_fast(const IfcSchema::IfcProduct* entity,
TopoDS_Shape intermediate_result;
if (boolean_operation(result, opening_list, BOPAlgo_CUT, intermediate_result)) {
result = intermediate_result;
}
else {
} else {
Logger::Message(Logger::LOG_ERROR, "Opening subtraction failed for " + boost::lexical_cast<std::string>(std::distance(jt, it)) + " openings", entity);
}