mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Check for empty result after BOPAlgo_MakerVolume and reset manifoldness state #8140
This commit is contained in:
@@ -152,12 +152,23 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const IfcUtil::IfcBaseEntity*
|
|||||||
BOPAlgo_MakerVolume mv;
|
BOPAlgo_MakerVolume mv;
|
||||||
mv.AddArgument(entity_part);
|
mv.AddArgument(entity_part);
|
||||||
mv.SetAvoidInternalShapes(true);
|
mv.SetAvoidInternalShapes(true);
|
||||||
|
// mv.SetFuzzyValue(settings_.get<settings::Precision>().get());
|
||||||
|
std::optional<std::string> failure;
|
||||||
try {
|
try {
|
||||||
mv.Perform();
|
mv.Perform();
|
||||||
entity_part = mv.Shape();
|
auto entity_part_2 = mv.Shape();
|
||||||
Logger::Warning("Sucessfully detected exterior volume to non-manifold first operand");
|
if (IfcGeom::util::count(entity_part_2, TopAbs_FACE) == 0) {
|
||||||
|
failure = "Empty result (no faces) for BOPAlgo_MakerVolume; original was " + std::to_string(IfcGeom::util::count(entity_part, TopAbs_FACE));
|
||||||
|
} else {
|
||||||
|
is_manifold = util::is_manifold(entity_part_2);
|
||||||
|
Logger::Warning(std::string("Sucessfully detected exterior volume to non-manifold first operand; shape is now ") + (is_manifold ? std::string("manifold") : std::string("non-manifold")));
|
||||||
|
entity_part = entity_part_2;
|
||||||
|
}
|
||||||
} catch (const Standard_Failure& e) {
|
} catch (const Standard_Failure& e) {
|
||||||
Logger::Warning("MakeVolume failed: " + std::string(e.GetMessageString()), entity);
|
failure.emplace(e.GetMessageString());
|
||||||
|
}
|
||||||
|
if (failure) {
|
||||||
|
Logger::Warning("MakeVolume failed: " + *failure, entity);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Logger::Warning("Non-manifold first operand, use --make-volume to try and make manifold");
|
Logger::Warning("Non-manifold first operand, use --make-volume to try and make manifold");
|
||||||
|
|||||||
Reference in New Issue
Block a user