#2305 fix cone boolean op

This commit is contained in:
Thomas Krijnen
2022-08-30 13:31:26 +02:00
parent af1a40c913
commit 7df94a906d
3 changed files with 29 additions and 3 deletions
+11 -1
View File
@@ -45,8 +45,18 @@ double IfcGeom::util::min_edge_length(const TopoDS_Shape & a) {
double min_edge_len = std::numeric_limits<double>::infinity();
TopExp_Explorer exp(a, TopAbs_EDGE);
for (; exp.More(); exp.Next()) {
const TopoDS_Edge& e = TopoDS::Edge(exp.Current());
TopoDS_Vertex v0, v1;
TopExp::Vertices(e, v0, v1);
if (!v0.IsNull() && !v1.IsNull() && v0.IsSame(v1)) {
// Don't consider a 3d-degenerate edge (for example cone apex)
// in calculating overall shape min edge length.
continue;
}
GProp_GProps prop;
BRepGProp::LinearProperties(exp.Current(), prop);
BRepGProp::LinearProperties(e, prop);
double l = prop.Mass();
if (l < min_edge_len) {
min_edge_len = l;