From: azv Date: Fri, 29 Dec 2017 07:59:39 +0000 (+0300) Subject: Use tolerance while calculating center of mass. X-Git-Tag: V_2.10.1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f29add28ea010ab76fe32889b61c06fbdcbb535d;p=modules%2Fshaper.git Use tolerance while calculating center of mass. Increase threshold for dumping volume while checking python dump. --- 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<