From 8ca63e78e68da0581e53b9fd393a7af0bc0b6b3b Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Fri, 8 Aug 2025 10:18:29 +0100 Subject: [PATCH] Modeling, Bnd_Box - CornerMax incorrect realisation (#664) - Fixed the logical error in `CornerMax()` method by correcting the openness condition checks - Added comprehensive GTest suite for `Bnd_Box` class to prevent similar regressions - Minor code formatting improvements in the `DumpJson()` method --- src/Bnd/Bnd_Box.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Bnd/Bnd_Box.cxx b/src/Bnd/Bnd_Box.cxx index 366692a178..7f6860ce6b 100644 --- a/src/Bnd/Bnd_Box.cxx +++ b/src/Bnd/Bnd_Box.cxx @@ -240,11 +240,11 @@ gp_Pnt Bnd_Box::CornerMax() const aCornerMax.SetX(Bnd_Precision_Infinite); else aCornerMax.SetX(Xmax + Gap); - if (IsOpenYmin()) + if (IsOpenYmax()) aCornerMax.SetY(Bnd_Precision_Infinite); else aCornerMax.SetY(Ymax + Gap); - if (IsOpenZmin()) + if (IsOpenZmax()) aCornerMax.SetZ(Bnd_Precision_Infinite); else aCornerMax.SetZ(Zmax + Gap); @@ -1106,12 +1106,13 @@ void Bnd_Box::Dump() const //================================================================================================= -void Bnd_Box::DumpJson(Standard_OStream& theOStream, Standard_Integer) const { - OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMin", 3, Xmin, Ymin, Zmin) - OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMax", 3, Xmax, Ymax, Zmax) - - OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Gap) - OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Flags)} +void Bnd_Box::DumpJson(Standard_OStream& theOStream, Standard_Integer) const +{ + OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMin", 3, Xmin, Ymin, Zmin); + OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMax", 3, Xmax, Ymax, Zmax); + OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Gap); + OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Flags) +} //================================================================================================= -- 2.39.5