Use miimal bounding box edge length for faceset relative epsilon

This commit is contained in:
Thomas Krijnen
2018-12-14 17:14:55 +01:00
parent 27b9689e14
commit e3b415ad54
+12 -1
View File
@@ -3618,7 +3618,18 @@ IfcGeom::Kernel::faceset_helper::faceset_helper(Kernel* kernel, const IfcSchema:
}
}
const double eps = kernel->getValue(GV_PRECISION) * 10. * std::sqrt(box.SquareExtent());
// Find the minimal bounding box edge
double bmin[3], bmax[3];
box.Get(bmin[0], bmin[1], bmin[2], bmax[0], bmax[1], bmax[2]);
double bdiff = std::numeric_limits<double>::infinity();
for (size_t i = 0; i < 3; ++i) {
const double d = bmax[i] - bmin[i];
if (d > kernel->getValue(GV_PRECISION) * 10. && d < bdiff) {
bdiff = d;
}
}
const double eps = kernel->getValue(GV_PRECISION) * 10. * bdiff;
std::map<std::pair<int, int>, int> edge_use;