Part: fixes #5967: Weird behavior in Placement dialog when using "center of mass" with Datum Plane

This commit is contained in:
wmayer
2023-05-14 18:12:50 +02:00
committed by 0penBrain
parent a88b8feacf
commit f09bf02b6d

View File

@@ -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;