mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
bop face addition check only for subtraction
This commit is contained in:
@@ -4387,9 +4387,10 @@ bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a_, const TopTools_L
|
|||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
|
|
||||||
|
bool all_faces_included_in_result = true;
|
||||||
|
if (op == BOPAlgo_CUT) {
|
||||||
TopTools_IndexedMapOfShape faces;
|
TopTools_IndexedMapOfShape faces;
|
||||||
TopExp::MapShapes(r, TopAbs_FACE, faces);
|
TopExp::MapShapes(r, TopAbs_FACE, faces);
|
||||||
bool all_faces_included_in_result = true;
|
|
||||||
for (TopExp_Explorer exp(a, TopAbs_FACE); exp.More(); exp.Next()) {
|
for (TopExp_Explorer exp(a, TopAbs_FACE); exp.More(); exp.Next()) {
|
||||||
auto& f = TopoDS::Face(exp.Current());
|
auto& f = TopoDS::Face(exp.Current());
|
||||||
if (!faces.Contains(f)) {
|
if (!faces.Contains(f)) {
|
||||||
@@ -4397,11 +4398,12 @@ bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a_, const TopTools_L
|
|||||||
break;
|
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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user