
I even tried to extrude the sketch by 0.0001 to get a solid, and still, the results were the same.

Please note that in the FreeCAD file, all I have is a single sketch and no parts or any 3D objects. The procedure is to divide the complex shape into its sub shapes and then use the centroidal moment of inertia formulas from Subsection 10.3.2, along with the parallel axis theorem (10.3.1) to calculate the moments of inertia of parts, and finally combine them to find the moment of inertia of the original shape. In other words, the moment of inertia is the measurement of resistance of the body to a change in its rotational motion. So, I am not sure what is the problem and get the information I want. The centre of area of such figure is known as centroid.

"(Unicode error) 'utf-8' codec can't decode byte 0xb3 in position 27:invalid start byte", ('C:/Users/…/CenterOfMass.FCMacro',137,4,None))Īlso, when I try to use your Macro, Macro_FCInfo, it give me all zeros for the centroid and moment of inertia.Īnd TheMarkster, when I use your suggestion of running the python command, I get the error:ĪttributeError: 'Part.Compound' object has no attribute 'CenterOfMass'. The plane figures (like triangle, quadrilateral, circle, trapezoid, etc.) have only areas but no mass.

Mario, unfortunately, when I create a simple geometry as a sketch (a 3x3 inch rectangle with a 0.4x0.4 inch rectangle inside of it, and not at the center), and I run Macro_CenterOfMass, it gives me the error:
