From f29add28ea010ab76fe32889b61c06fbdcbb535d Mon Sep 17 00:00:00 2001 From: azv Date: Fri, 29 Dec 2017 10:59:39 +0300 Subject: [PATCH] Use tolerance while calculating center of mass. Increase threshold for dumping volume while checking python dump. --- src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp | 3 ++- src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp index 60b9fe453..c5bf76802 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp @@ -131,7 +131,8 @@ std::shared_ptr BRepGProp::LinearProperties(aShape, aGProps); aCentre = aGProps.CentreOfMass(); } else { - BRepGProp::SurfaceProperties(aShape, aGProps); + const Standard_Real anEps = 1.e-6; + BRepGProp::SurfaceProperties(aShape, aGProps, anEps); aCentre = aGProps.CentreOfMass(); } return std::shared_ptr(new GeomAPI_Pnt(aCentre.X(), aCentre.Y(), aCentre.Z())); diff --git a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp index f0806abc4..f0d4deb48 100644 --- a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp +++ b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp @@ -360,7 +360,7 @@ std::string ModelHighAPI_FeatureStore::dumpShape(std::shared_ptr& aResult<<": "< 1.e-7) { + if (GeomAlgoAPI_ShapeTools::volume(theShape) > 1.e-5) { aResult<<"Volume: "<< std::fixed<