Include invisible entities when calculating BBox for chord tolerance.

Otherwise, loading a file with all entities invisible becomes
pathologically slow.
pull/4/head
whitequark 2016-02-18 10:09:29 +00:00
parent bdd02ac3a8
commit d4ecf155f6
1 changed files with 2 additions and 2 deletions

View File

@ -186,8 +186,8 @@ void SolveSpaceUI::GenerateAll(int first, int last, bool andFindFree, bool genFo
// If we're generating entities for display, first we need to find
// the bounding box to turn relative chord tolerance to absolute.
if(!SS.exportMode && !genForBBox) {
GenerateAll(first, last, false, true);
BBox box = SK.CalculateEntityBBox(false);
GenerateAll(first, last, /*andFindFree=*/false, /*genForBBox=*/true);
BBox box = SK.CalculateEntityBBox(/*includeInvisibles=*/true);
Vector size = box.maxp.Minus(box.minp);
double maxSize = std::max({ size.x, size.y, size.z });
chordTolCalculated = maxSize * chordTol / 100.0;