From f09bf02b6d7906f52e1fb1edf917b219ec988bd4 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 14 May 2023 18:12:50 +0200 Subject: [PATCH] Part: fixes #5967: Weird behavior in Placement dialog when using "center of mass" with Datum Plane --- src/Mod/Part/App/TopoShape.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 98a6428d0b..36ce36688a 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -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;