mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-14 09:38:34 +05:00
0023247: [CEA 1771] Problem in computing dimensions of objects in GEOM module
This commit is contained in:
parent
fb146b65ce
commit
cfa4be5d95
@ -984,19 +984,20 @@ void GEOMImpl_IMeasureOperations::GetBasicProperties (Handle(GEOM_Object) theSha
|
|||||||
|
|
||||||
//Compute the parameters
|
//Compute the parameters
|
||||||
GProp_GProps LProps, SProps;
|
GProp_GProps LProps, SProps;
|
||||||
|
Standard_Real anEps = 1.e-6;
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS;
|
OCC_CATCH_SIGNALS;
|
||||||
BRepGProp::LinearProperties(aShape, LProps);
|
BRepGProp::LinearProperties(aShape, LProps);
|
||||||
theLength = LProps.Mass();
|
theLength = LProps.Mass();
|
||||||
|
|
||||||
BRepGProp::SurfaceProperties(aShape, SProps);
|
BRepGProp::SurfaceProperties(aShape, SProps, anEps);
|
||||||
theSurfArea = SProps.Mass();
|
theSurfArea = SProps.Mass();
|
||||||
|
|
||||||
theVolume = 0.0;
|
theVolume = 0.0;
|
||||||
if (aShape.ShapeType() < TopAbs_SHELL) {
|
if (aShape.ShapeType() < TopAbs_SHELL) {
|
||||||
for (TopExp_Explorer Exp (aShape, TopAbs_SOLID); Exp.More(); Exp.Next()) {
|
for (TopExp_Explorer Exp (aShape, TopAbs_SOLID); Exp.More(); Exp.Next()) {
|
||||||
GProp_GProps VProps;
|
GProp_GProps VProps;
|
||||||
BRepGProp::VolumeProperties(Exp.Current(), VProps);
|
BRepGProp::VolumeProperties(Exp.Current(), VProps, anEps);
|
||||||
theVolume += VProps.Mass();
|
theVolume += VProps.Mass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user