Invalidate the boolean result for a particular warning reported by pavefiller

This commit is contained in:
Thomas Krijnen
2021-12-19 22:14:09 +01:00
parent 6b0b64b869
commit 20dcb68009
+8 -5
View File
@@ -4704,6 +4704,10 @@ bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a_, const TopTools_L
builder->SetTools(B); builder->SetTools(B);
builder->Build(); builder->Build();
if (builder->IsDone()) { if (builder->IsDone()) {
if (builder->DSFiller()->HasWarning(STANDARD_TYPE(BOPAlgo_AlertAcquiredSelfIntersection))) {
Logger::Notice("Builder reports self-intersection in output");
success = false;
} else {
TopoDS_Shape r = *builder; TopoDS_Shape r = *builder;
ShapeFix_Shape fix(r); ShapeFix_Shape fix(r);
@@ -4835,12 +4839,10 @@ bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a_, const TopTools_L
if ((v = min_edge_length(r)) < fuzziness * 3.) { if ((v = min_edge_length(r)) < fuzziness * 3.) {
reason = 0; reason = 0;
success = false; success = false;
} } else if ((v = min_vertex_edge_distance(r, getValue(GV_PRECISION), fuzziness * 3.)) < fuzziness * 3.) {
else if ((v = min_vertex_edge_distance(r, getValue(GV_PRECISION), fuzziness * 3.)) < fuzziness * 3.) {
reason = 1; reason = 1;
success = false; success = false;
} } else if ((v = min_face_face_distance(r, 1.e-4)) < 1.e-4) {
else if ((v = min_face_face_distance(r, 1.e-4)) < 1.e-4) {
reason = 2; reason = 2;
success = false; success = false;
} }
@@ -4892,12 +4894,13 @@ bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a_, const TopTools_L
dump(r); dump(r);
Logger::Notice(str.str()); Logger::Notice(str.str());
}
} }
} else { } else {
std::stringstream str; std::stringstream str;
#if OCC_VERSION_HEX >= 0x70200 #if OCC_VERSION_HEX >= 0x70200
if (builder->HasError(STANDARD_TYPE(BOPAlgo_AlertBOPNotAllowed))) { if (builder->HasError(STANDARD_TYPE(BOPAlgo_AlertBOPNotAllowed))) {
Logger::Error("Invalid operands. Using first operand"); Logger::Error("Invalid operands. Using first operand");
result = a; result = a;