Part: fixes #5967: Weird behavior in Placement dialog when using "center of mass" with Datum Plane
This commit is contained in:
@@ -1223,6 +1223,9 @@ bool TopoShape::getCenterOfGravity(Base::Vector3d& center) const
|
||||
// Computing of CentreOfMass
|
||||
GProp_GProps prop;
|
||||
if (getShapeProperties(_Shape, prop)) {
|
||||
if (prop.Mass() > Precision::Infinite()) {
|
||||
return false;
|
||||
}
|
||||
gp_Pnt pnt = prop.CentreOfMass();
|
||||
center.Set(pnt.X(), pnt.Y(), pnt.Z());
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user