mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
--unify-shapes setting
This commit is contained in:
+21
-13
@@ -208,29 +208,37 @@ IfcGeom::BRepElement* ifcopenshell::geometry::Converter::create_brep_for_represe
|
||||
Logger::Message(Logger::LOG_ERROR, "Error processing openings for:", product);
|
||||
}
|
||||
|
||||
if (caught_error && opened_shapes.size() < shapes.size()) {
|
||||
opened_shapes = shapes;
|
||||
}
|
||||
|
||||
if (settings_.get<ifcopenshell::geometry::settings::UseWorldCoords>().get()) {
|
||||
for (auto it = opened_shapes.begin(); it != opened_shapes.end(); ++it) {
|
||||
it->prepend(place);
|
||||
if (!(caught_error && opened_shapes.size() < shapes.size())) {
|
||||
if (settings_.get<ifcopenshell::geometry::settings::UseWorldCoords>().get()) {
|
||||
for (auto it = opened_shapes.begin(); it != opened_shapes.end(); ++it) {
|
||||
it->prepend(place);
|
||||
}
|
||||
place = ifcopenshell::geometry::taxonomy::make<ifcopenshell::geometry::taxonomy::matrix4>();
|
||||
representation_id_builder << "-world-coords";
|
||||
}
|
||||
place = ifcopenshell::geometry::taxonomy::make<ifcopenshell::geometry::taxonomy::matrix4>();
|
||||
representation_id_builder << "-world-coords";
|
||||
shapes = opened_shapes;
|
||||
}
|
||||
shape = new IfcGeom::Representation::BRep(settings_, product_type, representation_id_builder.str(), opened_shapes);
|
||||
} else if (settings_.get<ifcopenshell::geometry::settings::UseWorldCoords>().get()) {
|
||||
for (auto it = shapes.begin(); it != shapes.end(); ++it) {
|
||||
it->prepend(place);
|
||||
}
|
||||
place = ifcopenshell::geometry::taxonomy::make<ifcopenshell::geometry::taxonomy::matrix4>();
|
||||
representation_id_builder << "-world-coords";
|
||||
shape = new IfcGeom::Representation::BRep(settings_, product_type, representation_id_builder.str(), shapes);
|
||||
} else {
|
||||
shape = new IfcGeom::Representation::BRep(settings_, product_type, representation_id_builder.str(), shapes);
|
||||
}
|
||||
|
||||
if (settings_.get<ifcopenshell::geometry::settings::UnifyShapes>().get()) {
|
||||
IfcGeom::ConversionResults unified_shapes;
|
||||
try {
|
||||
if (kernel_->unify_shapes(shapes, unified_shapes)) {
|
||||
std::swap(shapes, unified_shapes);
|
||||
}
|
||||
} catch (std::exception& e) {
|
||||
Logger::Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
shape = new IfcGeom::Representation::BRep(settings_, product_type, representation_id_builder.str(), shapes);
|
||||
|
||||
std::string context_string = "";
|
||||
|
||||
// IfcShapeRepresentation.
|
||||
|
||||
Reference in New Issue
Block a user