]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Use tolerance while calculating center of mass.
authorazv <azv@opencascade.com>
Fri, 29 Dec 2017 07:59:39 +0000 (10:59 +0300)
committerazv <azv@opencascade.com>
Fri, 29 Dec 2017 08:11:55 +0000 (11:11 +0300)
Increase threshold for dumping volume while checking python dump.

src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp
src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp

index 60b9fe4531168004468d09c66bee1393db19ca88..c5bf768024a3e473734eae3696af4094b5872f5e 100644 (file)
@@ -131,7 +131,8 @@ std::shared_ptr<GeomAPI_Pnt>
     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<GeomAPI_Pnt>(new GeomAPI_Pnt(aCentre.X(), aCentre.Y(), aCentre.Z()));
index f0806abc45101a31433907385a62b9f688faf41b..f0d4deb48d9b2f427daa53e5b842b01ac79a8bf5 100644 (file)
@@ -360,7 +360,7 @@ std::string ModelHighAPI_FeatureStore::dumpShape(std::shared_ptr<GeomAPI_Shape>&
     aResult<<": "<<aCount<<std::endl;
   }
   // output the main characteristics
-  if (GeomAlgoAPI_ShapeTools::volume(theShape) > 1.e-7) {
+  if (GeomAlgoAPI_ShapeTools::volume(theShape) > 1.e-5) {
     aResult<<"Volume: "<<
       std::fixed<<setprecision(3)<<GeomAlgoAPI_ShapeTools::volume(theShape)<<std::endl;
   }