Prevent Loop in BRepBuilderAPI_Transform

- if a scale transform with scale = 0 is passed to
  BRepBuilderAPI_Transform, it will loop forever.
  If Page.keepUpdated is false, and Views have not yet
  been executed (ex at load time), Views will have a
  0.0 x 0.0 bbox and if Autoscale is true, a scale of
  0.0 will be used in fit-to-page.
This commit is contained in:
WandererFan
2018-02-01 15:46:01 -05:00
parent 1402e39ba0
commit 356f879659
5 changed files with 24 additions and 2 deletions

View File

@@ -400,6 +400,9 @@ Base::Vector3d DrawUtil::closestBasis(Base::Vector3d v)
double DrawUtil::sensibleScale(double working_scale)
{
double result = 1.0;
if (!(working_scale > 0.0)) {
return result;
}
//which gives the largest scale for which the min_space requirements can be met, but we want a 'sensible' scale, rather than 0.28457239...
//eg if working_scale = 0.115, then we want to use 0.1, similarly 7.65 -> 5, and 76.5 -> 50