Detect self-intersections in faceset helper and clamp bounding box eps factor to 1.

This commit is contained in:
Thomas Krijnen
2018-12-21 15:58:21 +01:00
parent 4de617e398
commit 31eac564f6
2 changed files with 17 additions and 3 deletions
+12
View File
@@ -121,6 +121,7 @@ private:
MAKE_TYPE_NAME(Kernel)* kernel_;
std::map<int, int> vertex_mapping_;
std::map<std::pair<int, int>, TopoDS_Edge> edges_;
double eps_;
template <typename Fn>
void loop_(IfcSchema::IfcCartesianPoint::list::ptr& ps, const Fn& callback) {
@@ -184,11 +185,22 @@ private:
});
if (count >= 3) {
wire.Closed(true);
TopTools_ListOfShape results;
if (kernel_->wire_intersections(wire, results)) {
Logger::Error("Self-intersections with " + boost::lexical_cast<std::string>(results.Extent()) + " cycles detected", loop);
kernel_->select_largest(results, wire);
}
return true;
} else {
return false;
}
}
double epsilon() const {
return eps_;
}
};
double deflection_tolerance;