bop face addition check only for subtraction

This commit is contained in:
Thomas Krijnen
2021-12-09 20:24:21 +01:00
parent 44581c77ac
commit 33d15b42b7
+10 -8
View File
@@ -4387,21 +4387,23 @@ bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a_, const TopTools_L
if (success) { if (success) {
TopTools_IndexedMapOfShape faces;
TopExp::MapShapes(r, TopAbs_FACE, faces);
bool all_faces_included_in_result = true; bool all_faces_included_in_result = true;
for (TopExp_Explorer exp(a, TopAbs_FACE); exp.More(); exp.Next()) { if (op == BOPAlgo_CUT) {
auto& f = TopoDS::Face(exp.Current()); TopTools_IndexedMapOfShape faces;
if (!faces.Contains(f)) { TopExp::MapShapes(r, TopAbs_FACE, faces);
all_faces_included_in_result = false; for (TopExp_Explorer exp(a, TopAbs_FACE); exp.More(); exp.Next()) {
break; auto& f = TopoDS::Face(exp.Current());
if (!faces.Contains(f)) {
all_faces_included_in_result = false;
break;
}
} }
} }
int result_n_faces = count(r, TopAbs_FACE); int result_n_faces = count(r, TopAbs_FACE);
int first_op_n_faces = count(a, TopAbs_FACE); int first_op_n_faces = count(a, TopAbs_FACE);
if (all_faces_included_in_result && result_n_faces > first_op_n_faces) { if (op == BOPAlgo_CUT && all_faces_included_in_result && result_n_faces > first_op_n_faces) {
success = false; success = false;
Logger::Notice("Boolean result discarded because subtractions results in only the addition of faces"); Logger::Notice("Boolean result discarded because subtractions results in only the addition of faces");
} else { } else {