From 77a6c8313fa084e709021add8c2316f5a709c4f3 Mon Sep 17 00:00:00 2001 From: nbv Date: Wed, 8 Jun 2016 17:42:18 +0300 Subject: [PATCH] 0027581: Logical error in Bnd_Box(2d)::SquareExtent() method. Code in method SquareExtent has been corrected. --- src/Bnd/Bnd_Box.lxx | 8 ++++---- src/Bnd/Bnd_Box2d.lxx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Bnd/Bnd_Box.lxx b/src/Bnd/Bnd_Box.lxx index f42707fa20..edf29b7e57 100644 --- a/src/Bnd/Bnd_Box.lxx +++ b/src/Bnd/Bnd_Box.lxx @@ -21,8 +21,8 @@ inline Standard_Real Bnd_Box::SquareExtent() const { if ( IsVoid() ) return 0.; - Standard_Real dx = Xmax-Xmin+Gap; - Standard_Real dy = Ymax-Ymin+Gap; - Standard_Real dz = Zmax-Zmin+Gap; - return dx*dx + dy*dy + dz*dz; + const Standard_Real aDx = Xmax - Xmin + Gap + Gap; + const Standard_Real aDy = Ymax - Ymin + Gap + Gap; + const Standard_Real aDz = Zmax - Zmin + Gap + Gap; + return aDx*aDx + aDy*aDy + aDz*aDz; } diff --git a/src/Bnd/Bnd_Box2d.lxx b/src/Bnd/Bnd_Box2d.lxx index 346aac6268..57697d66b0 100644 --- a/src/Bnd/Bnd_Box2d.lxx +++ b/src/Bnd/Bnd_Box2d.lxx @@ -238,8 +238,8 @@ inline Standard_Boolean Bnd_Box2d::IsOut (const gp_Trsf2d& T1, inline Standard_Real Bnd_Box2d::SquareExtent() const { if ( IsVoid() ) return 0.; - Standard_Real dx = Xmax-Xmin+Gap; - Standard_Real dy = Ymax-Ymin+Gap; - return dx*dx + dy*dy; + const Standard_Real aDx = Xmax - Xmin + Gap + Gap; + const Standard_Real aDy = Ymax - Ymin + Gap + Gap; + return aDx*aDx + aDy*aDy; }