Difference between revisions of "Macro CenterOfMass"

From FreeCAD Documentation
Jump to navigation Jump to search
m (minor)
m (Change section to 'Usage')
Line 30: Line 30:
==How to use== <!--T:4-->
==Usage== <!--T:4-->

Revision as of 15:02, 28 February 2020

Other languages:
English • ‎français • ‎hrvatski • ‎italiano

Macro CenterOfMass.png Macro CenterOfMass

Gives the Center of mass multiple of multiple objects selected.

Macro version: 0.4.1
Last modified: 2019-05-25
FreeCAD version: 0.18
Download: Download the Macro_CenterOfMass_Icon package and extract it in the same directory of the macro.
Author: schupin
Download the Macro_CenterOfMass_Icon package and extract it in the same directory of the macro.
Macro Version
Date last modified
FreeCAD Version(s)
Default shortcut
See also


Gives the total mass and the location of the center of mass resulting of multiple objects selected. Different densities could be chosen for each object.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager.

# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "This macro must be downloaded from this link\n"
    "https://raw.githubusercontent.com/chupins/FreeCAD-macros/SC_Branch/Information/CenterOfMass.FCMacro" + "\n"
    "Quit this window to access the download page")


import webbrowser 
<class="rawcodeurl"><a href="https://raw.githubusercontent.com/chupins/FreeCAD-macros/SC_Branch/Information/CenterOfMass.FCMacro">raw code</a>

Macro CenterOfMass 01.png

The values (mass and center of mass) results can be saved in a spreadsheet

Macro CenterOfMass 02.png


Select the object(s)

Run the macro


icon file download and paste in a sub directory named CenterOfMass in the macro directory

toolBar icon

Macro CenterOfMass.png

Macro CenterOfMass save.png Macro CenterOfMass com.png Macro CenterOfMass compute.png Macro CenterOfMass import.png Macro CenterOfMass material.pngMacro CenterOfMass colorify.png

Download the Macro_CenterOfMass_Icon package and extract it in the same directory of the macro.

Macro CenterOfMass.FCMacro Download in Github

Macro CenterOfMass.FCMacro


the forum discussion Macro to compute center of mass


0.4.1 / 2019-05-25 : add default density button, sphere cursor, change window behavior, correct a container part issue

0.3.6 / 2019-05-22 : Radius of pheres representing centers of mass of each solid depends on each masses

0.3.5 / 2019-05-21 : Arrays and clone correction

0.3.4 / 2019-03-18 : minor

0.3.3 / 2019-03-17 : loading .csv corrections

0.3.2 / 2019-03-14 : add a colorify push button to add color on shapes depending on their density

0.3.0 / 2019-03-03 : python 3 compatibility

0.2.3 / 2018-11-22 : new icon name

0.1.2 / 2018-11-10 : xx